Files

28 lines
755 B
JavaScript
Raw Permalink Normal View History

2026-11-17 16:15:01 -05:00
(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 + '"]');
}
});
}
});
});
})();