ACC SHELL
(function ()
{
// create coffeeShortcodes plugin
tinymce.create("tinymce.plugins.coffeeShortcodes",
{
init: function ( ed, url )
{
ed.addCommand("coffeePopup", function ( a, params )
{
var popup = params.identifier;
// load thickbox
tb_show("Insert Shortcode", url + "/popup.php?popup=" + popup + "&width=" + 800);
});
},
createControl: function ( btn, e )
{
if ( btn == "coffee_button" )
{
var a = this;
// adds the tinymce button
btn = e.createMenuButton("coffee_button",
{
title: "Insert Shortcode",
image: "../wp-content/themes/amplius/shortcodes/tinymce/images/icon.png",
icons: false
});
// adds the dropdown to the button
btn.onRenderMenu.add(function (c, b)
{
a.addWithPopup( b, "Column", "column" );
a.addWithPopup( b, "Feature", "feature" );
a.addWithPopup( b, "Button", "button" );
a.addWithPopup( b, "Bar", "bar" );
a.addWithPopup( b, "Pricing", "pricing" );
a.addWithPopup( b, "Heading", "heading" );
a.addWithPopup( b, "List", "list" );
a.addWithPopup( b, "Accordion", "accordion" );
a.addWithPopup( b, "Toggle", "toggle" );
a.addWithPopup( b, "Tabs", "tabs" );
});
return btn;
}
return null;
},
addWithPopup: function ( ed, title, id ) {
ed.add({
title: title,
onclick: function () {
tinyMCE.activeEditor.execCommand("coffeePopup", false, {
title: title,
identifier: id
})
}
})
},
addImmediate: function ( ed, title, sc) {
ed.add({
title: title,
onclick: function () {
tinyMCE.activeEditor.execCommand( "mceInsertContent", false, sc )
}
})
},
getInfo: function () {
return {
longname: 'Coffee-Themes Shortcodes',
author: 'Coffee-Themes',
authorurl: 'http://themeforest.net/user/coffee-themes/',
infourl: 'http://wiki.moxiecode.com/',
version: "1.0"
}
}
});
tinymce.PluginManager.add("coffeeShortcodes", tinymce.plugins.coffeeShortcodes);
})();
ACC SHELL 2018