JAVASCRIPT   27
macros select
Guest on 18th September 2023 07:54:34 AM


  1. if("undefined"!==typeof MPSL&&("woocommerce"===MPSL.Vars.slider.slider_type.value||"post"===MPSL.Vars.slider.slider_type.value)){var getItems=function(){var b=[],a=MPSL.Vars.lang.macros;b.push({text:a.general.post_content,menu:[{text:a.post.title,value:"%title%"},{text:a.post.content,value:"%content%"},{text:a.post.excerpt,value:"%excerpt%"},{text:a.post.categories,value:"%categories%"},{text:a.post.tags,value:"%tags%"},{text:a.post.link,value:"%permalink%"},{text:a.post.author_name,value:"%author%"},
  2. {text:a.post.unique_id,value:"%post_id%"},{text:a.post.image,value:"%image%"},{text:a.post.image_source,value:"%image-url%"},{text:a.post.year,value:"%year%"},{text:a.post.numeric_month,value:"%monthnum%"},{text:a.post.month_name,value:"%month%"},{text:a.post.day_of_month,value:"%daynum%"},{text:a.post.weekday_name,value:"%day%"},{text:a.post.hour_minutes,value:"%time%"},{text:a.post.publish_date,value:"%date-published%"},{text:a.post.last_modified_date,value:"%date-modified%"},{text:a.post.number_of_comments,
  3. value:"%commentnum%"}]});"woocommerce"===MPSL.Vars.slider.slider_type.value&&b.push({text:a.general.woo_content,menu:[{text:a.woo.add_to_cart,value:"%wc_add_to_cart%"},{text:a.woo.price,value:"%wc_price%"},{text:a.woo.currency,value:"%wc_currency%"},{text:a.woo.currency_price,value:"%wc_currency_price%"},{text:a.woo.regular_price,value:"%wc_regular_price%"},{text:a.woo.sale_price,value:"%wc_sale_price%"},{text:a.woo.in_stock_status,value:"%wc_stock_status%"},{text:a.woo.in_stock_quantity,value:"%wc_stock_quantity%"},
  4. {text:a.woo.weight,value:"%wc_weight%"},{text:a.woo.product_categories,value:"%wc_product_cats%"},{text:a.woo.product_tags,value:"%wc_product_tags%"},{text:a.woo.total_sales,value:"%wc_total_sales%"},{text:a.woo.average_rating,value:"%wc_average_rating%"},{text:a.woo.rating_count,value:"%wc_rating_count%"}]});return b};"4"===tinyMCE.majorVersion?tinyMCE.PluginManager.add("mpslTinymceMacrosList",function(b){var a=tinyMCE.activeEditor;b.addButton("mpsl_post_macros",{type:"menubutton",text:"- Insert Macros -",
  5. icon:!1,style:"background: #ffffff none repeat scroll 0 0; border: 1px solid #c5c5c5;",menu:getItems(),onselect:function(b){a.selection.setContent(b.control.settings.value);a.execCommand("mpsl_post_macros")}})}):(tinyMCE.create("tinymce.plugins.mpslTinymceMacrosList",{createControl:function(b,a){switch(b){case "mpsl_post_macros":var c=a.createListBox("mpsl_post_macros",{title:"- Insert Macros -",onselect:function(a){tinyMCE.execCommand("mceInsertContent",!1,a)}}),d=getItems();d[0].menu.forEach(function(a){c.add(a.text,
  6. a.value)});d[1]&&(c.title="woocommerce",d[1].menu.forEach(function(a){c.add(a.text,a.value)}));return c}return null}}),tinymce.PluginManager.add("mpslTinymceMacrosList",tinymce.plugins.mpslTinymceMacrosList))};

Raw Paste

Login or Register to edit or fork this paste. It's free.