Files
Testing/blog/wp-content/plugins/post-carousel/admin/assets/js/mce-script.js
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

28 lines
755 B
JavaScript

(function() {
tinymce.PluginManager.add('sp_pc_mce_button', function( editor, url ) {
editor.addButton('sp_pc_mce_button', {
text: false,
icon: false,
image: url + '/pc-mce-logo.png',
tooltip: 'Post Carousel',
onclick: function () {
editor.windowManager.open({
title: 'Insert Shortcode',
width: 400,
height: 100,
body: [
{
type: 'listbox',
name: 'listboxName',
label: 'Select Shortcode',
'values': editor.settings.spPCShortcodeList
}
],
onsubmit: function( e ) {
editor.insertContent( '[post-carousel id="' + e.data.listboxName + '"]');
}
});
}
});
});
})();