PluginProbe
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment / 1.0.4
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment v1.0.4
3.1.13 3.1.12 3.1.11 3.1.10 3.1.9 3.1.8 3.1.7 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 All 122 releases
firebox / media / admin / js / fb_tinymce_button.js

fb_tinymce_button.js in FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment 1.0.4, at media/admin/js/fb_tinymce_button.js

3 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var FBox_TinyMCE_Button=function(){function e(){if(!this.canRun())return!1;this.addButton()}var t=e.prototype;return t.canRun=function(){return!document.body.classList.contains("block-editor-page")},t.addButton=function(){var o=this,n=wp.i18n,a=null;wp.apiFetch({path:"/fireplugins/firebox/boxes"}).then(function(e){a=o.parse_boxes(e)}),tinymce.PluginManager.add("fireplugins_firebox",function(t,e){t.addButton("fireplugins_firebox",{title:n.__("Add a FireBox Button","firebox"),icon:"fpf-mce-icons dashicons dashicons-plus",onclick:function(){t.windowManager.open({title:n.__("Add a FireBox Button","firebox"),body:[{type:"label",label:n.__("Choose the FireBox you'd like to handle.","firebox")},{type:"listbox",name:"box_id",label:n.__("Select a FireBox","firebox"),values:a},{type:"listbox",name:"box_cmd",label:n.__("FireBox Action","firebox"),value:"close",values:[{text:n.__("Open","firebox"),value:"open"},{text:n.__("Close","firebox"),value:"close"},{text:n.__("Toggle","firebox"),value:"toggle"}]},{type:"textbox",name:"button_label",label:n.__("Button Label","firebox"),value:n.__("Close","firebox")},{type:"textbox",name:"button_classes",label:n.__("Button Classes","firebox"),value:"button"}],onsubmit:function(e){e=o.getBoxButton(e.data);e.error?alert(e.message):t.insertContent(e.message)}})}})})},t.parse_boxes=function(e){var t=[];return e.map(function(e){t.push({text:e.title,value:e.id})}),t},t.getBoxButton=function(e){if(!e.box_id||!e.box_cmd||!e.button_label)return{message:wp.i18n.__("Please select a box ID, Action and set a Link Label","firebox"),error:!0};return{message:'<a href="#" '+(e.box_id?' data-fbox="'+e.box_id+'"':"")+(e.box_cmd?' data-fbox-cmd="'+e.box_cmd+'"':"")+' data-fbox-prevent="1"'+(e.button_classes?' class="'+e.button_classes+'"':"")+">"+e.button_label+"</a>",error:!1}},e}();new FBox_TinyMCE_Button;
2
3