Prep Plugin for release on WordPress.org (#23)
* Update translation text domain * Escape everything that should be escaped. * Add nonce checks where needed. * Sanitize all inputs. * Apply Code style changes across the codebase. * Correct many deprecation notices. * Optimize load order of many filters. * Add Proper Build script * Use emojii flags * Fix i18n deprecation notice for translating too early * Put all scripts in footer and load async
This commit is contained in:
2
assets/js/checkout-forms-editor.min.js
vendored
2
assets/js/checkout-forms-editor.min.js
vendored
@ -1 +1 @@
|
||||
!function(e){e(document).ready((function(){const t={components:{vuedraggable:vuedraggable},template:"#wu-table",props:["list","headers","step_name"],name:"wu-draggable-table",data:()=>({delete_field_id:""}),methods:{remove_field(e){wu_checkout_forms_editor_app.remove_field(this.step_name,e),this.delete_field_id=""}}};wu_checkout_forms_editor_app=new Vue({el:"#wu-checkout-editor-app",name:"CheckoutEditor",data:()=>Object.assign({},{dragging:!1,search:"",delete_step_id:"",preview_error:!1,preview:!1,loading_preview:!1,preview_content:"",iframe_preview_url:""},wu_checkout_form),components:{vuedraggable:vuedraggable,"wu-draggable-table":t},computed:{field_count(){return _.reduce(this.steps,(function(e,t){return e+t.fields.length}),0)}},watch:{steps:{handler(){this.update_session()},deep:!0}},mounted(){this.update_session()},methods:{get_preview(t=null){if(null===t&&(this.preview=!this.preview),this.preview){this.loading_preview=!0;const i=this;i.iframe_preview_url=i.register_page+"?action=wu_generate_checkout_form_preview&form_id="+i.form_id+"&type="+t+"&uniq="+1e3*Math.random(),e("#wp-ultimo-checkout-preview").on("load",(function(){i.loading_preview=!1,setTimeout((()=>{const t=document.getElementById("wp-ultimo-checkout-preview").contentWindow.document.body.scrollHeight;e("#wp-ultimo-checkout-preview").animate({height:t})}),1e3)}))}console.log("no preview")},add_step(e,t=null){const i=e.original_id?this.find_step(e.original_id):this.find_step(e.id);if(delete e.original_id,void 0!==i){const t=_.indexOf(this.steps,i);(e=Object.assign({},i,e)).fields=i.fields,Vue.set(this.steps,t,e)}else this.steps.push(e);this.$nextTick((function(){"function"==typeof t&&(t(),this.scroll_to(`wp-ultimo-list-table-${e.id}`))}))},add_field(e,t=null){const i=_.findWhere(this.steps,{id:e.step});let s=this.find_field(e.step,e.id);if(void 0===s&&(s=this.find_field(e.step,e.original_id),delete e.original_id),void 0!==s){const t=_.indexOf(i.fields,s);Vue.set(i.fields,t,e)}else i.fields.push(e);this.$nextTick((function(){"function"==typeof t&&(t(),this.scroll_to(`wp-ultimo-field-${e.id}`))}))},scroll_to(e){this.$nextTick((function(){setTimeout((()=>{document.getElementById(e).scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}),500)}))},find_step(e){return _.findWhere(this.steps,{id:e})},find_field(e,t){const i=_.findWhere(this.steps,{id:e});return _.findWhere(i.fields,{id:t})},remove_step(e){this.steps=_.reject(this.steps,(function(t){return t.id===e})),this.delete_step_id=""},remove_field(e,t){const i=_.findWhere(this.steps,{id:e});i.fields=_.reject(i.fields,(function(e){return e.id===t}))},update_session(){wu_initialize_tooltip();e.ajax({method:"post",url:ajaxurl,data:{action:"wu_save_editor_session",settings:this.steps,form_id:this.form_id},success(){}})}}})}))}(jQuery);
|
||||
(t=>{t(document).ready(function(){var e={components:{vuedraggable:vuedraggable},template:"#wu-table",props:["list","headers","step_name"],name:"wu-draggable-table",data(){return{delete_field_id:""}},methods:{remove_field(e){wu_checkout_forms_editor_app.remove_field(this.step_name,e),this.delete_field_id=""}}};wu_checkout_forms_editor_app=new Vue({el:"#wu-checkout-editor-app",name:"CheckoutEditor",data(){return Object.assign({},{dragging:!1,search:"",delete_step_id:"",preview_error:!1,preview:!1,loading_preview:!1,preview_content:"",iframe_preview_url:""},wu_checkout_form)},components:{vuedraggable:vuedraggable,"wu-draggable-table":e},computed:{field_count(){return _.reduce(this.steps,function(e,i){return e+i.fields.length},0)}},watch:{steps:{handler(){this.update_session()},deep:!0}},mounted(){this.update_session()},methods:{get_preview(i=null){if(null===i&&(this.preview=!this.preview),this.preview){this.loading_preview=!0;let e=this;e.iframe_preview_url=e.register_page+"?action=wu_generate_checkout_form_preview&form_id="+e.form_id+"&type="+i+"&uniq="+1e3*Math.random(),t("#wp-ultimo-checkout-preview").on("load",function(){e.loading_preview=!1,setTimeout(()=>{var e=document.getElementById("wp-ultimo-checkout-preview").contentWindow.document.body.scrollHeight;t("#wp-ultimo-checkout-preview").animate({height:e})},1e3)})}console.log("no preview")},add_step(e,i=null){var t,s=e.original_id?this.find_step(e.original_id):this.find_step(e.id);delete e.original_id,void 0!==s?(t=_.indexOf(this.steps,s),(e=Object.assign({},s,e)).fields=s.fields,Vue.set(this.steps,t,e)):this.steps.push(e),this.$nextTick(function(){"function"==typeof i&&(i(),this.scroll_to("wp-ultimo-list-table-"+e.id))})},add_field(e,i=null){var t,s=_.findWhere(this.steps,{id:e.step});let d=this.find_field(e.step,e.id);void 0===d&&(d=this.find_field(e.step,e.original_id),delete e.original_id),void 0!==d?(t=_.indexOf(s.fields,d),Vue.set(s.fields,t,e)):s.fields.push(e),this.$nextTick(function(){"function"==typeof i&&(i(),this.scroll_to("wp-ultimo-field-"+e.id))})},scroll_to(e){this.$nextTick(function(){setTimeout(()=>{document.getElementById(e).scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},500)})},find_step(e){return _.findWhere(this.steps,{id:e})},find_field(e,i){e=_.findWhere(this.steps,{id:e});return _.findWhere(e.fields,{id:i})},remove_step(i){this.steps=_.reject(this.steps,function(e){return e.id===i}),this.delete_step_id=""},remove_field(e,i){e=_.findWhere(this.steps,{id:e});e.fields=_.reject(e.fields,function(e){return e.id===i})},update_session(){wu_initialize_tooltip();t.ajax({method:"post",url:ajaxurl,data:{action:"wu_save_editor_session",settings:this.steps,form_id:this.form_id},success(){}})}}})})})(jQuery);
|
||||
|
Reference in New Issue
Block a user