2011-11-04 20:15:55 +00:00
|
|
|
(
|
|
|
|
function(){
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2011-11-04 20:15:55 +00:00
|
|
|
tinymce.create(
|
|
|
|
"tinymce.plugins.WooCommerceShortcodes",
|
|
|
|
{
|
|
|
|
init: function(d,e) {},
|
|
|
|
createControl:function(d,e)
|
|
|
|
{
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2012-09-10 16:56:29 +00:00
|
|
|
var ed = tinymce.activeEditor;
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2011-11-04 20:15:55 +00:00
|
|
|
if(d=="woocommerce_shortcodes_button"){
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2011-11-04 20:15:55 +00:00
|
|
|
d=e.createMenuButton( "woocommerce_shortcodes_button",{
|
2012-09-10 16:56:29 +00:00
|
|
|
title: ed.getLang('woocommerce.insert'),
|
|
|
|
icons: false
|
2011-11-04 20:15:55 +00:00
|
|
|
});
|
2012-09-10 16:56:29 +00:00
|
|
|
|
2011-11-04 20:15:55 +00:00
|
|
|
var a=this;d.onRenderMenu.add(function(c,b){
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2013-10-23 13:55:18 +00:00
|
|
|
a.addImmediate(b, ed.getLang('woocommerce.order_tracking'), '[' + ed.getLang('woocommerce.order_tracking_shortcode') + ']' );
|
2012-09-10 16:56:29 +00:00
|
|
|
a.addImmediate(b, ed.getLang('woocommerce.price_button'), '[add_to_cart id="" sku=""]');
|
|
|
|
a.addImmediate(b, ed.getLang('woocommerce.product_by_sku'), '[product id="" sku=""]');
|
|
|
|
a.addImmediate(b, ed.getLang('woocommerce.products_by_sku'), '[products ids="" skus=""]');
|
|
|
|
a.addImmediate(b, ed.getLang('woocommerce.product_categories'), '[product_categories number=""]');
|
|
|
|
a.addImmediate(b, ed.getLang('woocommerce.products_by_cat_slug'), '[product_category category="" per_page="12" columns="4" orderby="date" order="desc"]');
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2011-11-04 20:15:55 +00:00
|
|
|
b.addSeparator();
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2012-09-10 16:56:29 +00:00
|
|
|
a.addImmediate(b, ed.getLang('woocommerce.recent_products'), '[recent_products per_page="12" columns="4" orderby="date" order="desc"]');
|
|
|
|
a.addImmediate(b, ed.getLang('woocommerce.featured_products'), '[featured_products per_page="12" columns="4" orderby="date" order="desc"]');
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2011-11-04 20:15:55 +00:00
|
|
|
b.addSeparator();
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2013-10-23 13:55:18 +00:00
|
|
|
a.addImmediate(b, ed.getLang('woocommerce.shop_messages'), '[' + ed.getLang('woocommerce.shop_messages_shortcode') + ']');
|
2011-11-04 20:15:55 +00:00
|
|
|
});
|
|
|
|
return d
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2011-11-04 20:15:55 +00:00
|
|
|
} // End IF Statement
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2011-11-04 20:15:55 +00:00
|
|
|
return null
|
|
|
|
},
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2011-11-04 20:15:55 +00:00
|
|
|
addImmediate:function(d,e,a){d.add({title:e,onclick:function(){tinyMCE.activeEditor.execCommand( "mceInsertContent",false,a)}})}
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2011-11-04 20:15:55 +00:00
|
|
|
}
|
|
|
|
);
|
2012-12-30 15:51:37 +00:00
|
|
|
|
2011-11-04 20:15:55 +00:00
|
|
|
tinymce.PluginManager.add( "WooCommerceShortcodes", tinymce.plugins.WooCommerceShortcodes);
|
|
|
|
}
|
|
|
|
)();
|