PluginProbe
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment / 1.1.0
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment v1.1.0
3.1.14 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 All 123 releases
firebox / media / admin / js / fb_blocks_extend.js

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

3 lines 5.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var __=wp.i18n.__,addFilter=wp.hooks.addFilter,Fragment=wp.element.Fragment,updateCategory=wp.blocks.updateCategory,InspectorControls=wp.blockEditor.InspectorControls,createHigherOrderComponent=wp.compose.createHigherOrderComponent,_wp$components=wp.components,TextControl=_wp$components.TextControl,SelectControl=_wp$components.SelectControl,ToggleControl=_wp$components.ToggleControl,PanelBody=_wp$components.PanelBody,SVG=_wp$components.SVG,fbox_allowedBlocks=["core/button","core/image","firebox/button"],boxesSelection=[];boxesSelection.push({value:"none",label:__("Select a box","firebox")}),boxesSelection.push({value:"current",label:__("Current box","firebox")}),wp.apiFetch({path:"/fireplugins/firebox/boxes"}).then(function(e){parse_boxes(e).forEach(function(e){boxesSelection.push({value:e.value,label:e.label})})});var FBox_Block_Add_Attributes=function(e){return fbox_allowedBlocks.includes(e.name)&&void 0!==e.attributes&&(e.attributes=Object.assign(e.attributes,{dataFBox:{type:"string"},dataFBoxCmd:{type:"string",default:"close"},dataFBoxEnabled:{type:"boolean",default:!1},dataFBoxPreventDefault:{type:"boolean",default:!0},dataFBoxClass:{type:"string",default:""}})),e},FBox_Block_Set_Advanced_Controls=createHigherOrderComponent(function(i){return function(e){var t=e.name,o=e.attributes,l=e.setAttributes,n=o.dataFBox,a=o.dataFBoxCmd,r=o.dataFBoxEnabled,c=o.dataFBoxPreventDefault,o=o.dataFBoxClass;return React.createElement(Fragment,null,React.createElement(i,e),fbox_allowedBlocks.includes(t)&&React.createElement(InspectorControls,null,React.createElement(PanelBody,{title:__("FireBox","firebox")},React.createElement(ToggleControl,{label:__("Enable FireBox Settings","firebox"),checked:!!r,onChange:function(){return l({dataFBoxEnabled:!r})},help:__("Enable to trigger a FireBox or define custom CSS Classes.","firebox")}),r&&React.createElement("div",null,React.createElement(SelectControl,{label:__("Select a FireBox","firebox"),value:n,options:boxesSelection,onChange:function(e){return l({dataFBox:e})},help:__("Select the box to trigger.","firebox")}),!n||"none"!=n&&React.createElement(Fragment,null,React.createElement(SelectControl,{label:__("FireBox Action","firebox"),value:a,options:[{label:"Open",value:"open"},{label:"Close",value:"close"},{label:"Toggle",value:"toggle"}],onChange:function(e){return l({dataFBoxCmd:e})},help:__("Set the action of the box. Open, Close or Toggle.","firebox")}),React.createElement(ToggleControl,{label:__("Prevent Default Action","firebox"),checked:!!c,onChange:function(){return l({dataFBoxPreventDefault:!c})},help:__("If enabled, stops the default action of the element from occuring. For example: Prevents a link from following the URL.","firebox")})),React.createElement(TextControl,{label:__("CSS Classes","firebox"),value:o,onChange:function(e){return l({dataFBoxClass:e})},help:__("Set custom CSS Classes to this block. Separate multiple classes with spaces.","firebox")})))))}},"FBox_Block_Set_Advanced_Controls");function parse_boxes(e){var t=[];return e.map(function(e){t.push({label:e.title,value:e.id})}),t}addFilter("blocks.registerBlockType","fbox/fbox-cpt-custom-attributes",FBox_Block_Add_Attributes),addFilter("editor.BlockEdit","fbox/fbox-cpt-custom-controls",FBox_Block_Set_Advanced_Controls);var FireBoxCategoryIcon=function(){return React.createElement(SVG,{xmlns:"http://www.w3.org/2000/svg",width:"25",viewBox:"0 0 40 40",style:{marginLeft:"5px"}},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.43049 0C3.77446 0 0 3.77446 0 8.43049V31.5695C0 36.2255 3.77446 40 8.43049 40H31.5695C36.2255 40 40 36.2255 40 31.5695V8.43049C40 3.77446 36.2255 0 31.5695 0H8.43049ZM11.1211 9.32735C10.1304 9.32735 9.32735 10.1304 9.32735 11.1211V28.8789C9.32735 29.8696 10.1304 30.6726 11.1211 30.6726H28.8789C29.8696 30.6726 30.6726 29.8696 30.6726 28.8789V11.1211C30.6726 10.1304 29.8696 9.32735 28.8789 9.32735H11.1211ZM16.8966 17.9728C16.8966 17.3785 17.3785 16.8966 17.9728 16.8966H22.0272C22.6215 16.8966 23.1034 17.3785 23.1034 17.9728V22.0272C23.1034 22.6215 22.6215 23.1034 22.0272 23.1034H17.9728C17.3785 23.1034 16.8966 22.6215 16.8966 22.0272V17.9728Z",fill:"#2438E9"}))};updateCategory("firebox",{icon:FireBoxCategoryIcon});var FirePluginsCategoryIcon=function(){return React.createElement(SVG,{xmlns:"http://www.w3.org/2000/svg",width:"25",viewBox:"0 0 40 40",style:{marginLeft:"5px"}},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.7589 0L20.7524 2.63971C29.0855 8.14791 34.1404 15.9983 33.3678 24.8262C32.5645 34.0043 24.4333 40.737 15.2662 39.9352C6.09897 39.1335 -0.739139 31.0916 0.0641224 21.9136C0.180255 20.5867 0.37899 19.1879 1.12266 17.3053C1.80271 15.5836 2.89509 13.5649 4.59658 10.8145L8.53268 13.2477L8.67938 13.0126C8.7833 12.8461 8.93413 12.6044 9.12162 12.3038C9.49663 11.7027 10.0182 10.8662 10.6046 9.92495C11.7784 8.04091 13.2083 5.74258 14.2418 4.07104L16.7589 0ZM12.4706 15.7359C10.8676 18.3298 10.1297 19.7788 9.76001 20.7147C9.45209 21.4942 9.38344 21.9423 9.31514 22.7227C8.964 26.7348 11.9588 30.3275 16.0755 30.6875C20.1922 31.0476 23.7656 28.0293 24.1168 24.0172C24.413 20.6323 23.0665 16.8868 19.4014 13.3644C19.0872 13.8692 18.7792 14.3639 18.4873 14.8323C17.8998 15.7755 17.3772 16.6135 17.0014 17.2158C16.8136 17.517 16.6624 17.7593 16.5582 17.9263L16.3967 18.185C16.3967 18.185 16.3965 18.1852 12.4706 15.7359Z",fill:"#2438E9"}))};updateCategory("fireplugins",{icon:FirePluginsCategoryIcon});
2
3