b0y-101 Mini Shell


Current Path : E:/www3/chiangrai/wp-content/plugins/popup-maker/assets/js/
File Upload :
Current File : E:/www3/chiangrai/wp-content/plugins/popup-maker/assets/js/admin-shortcode-ui.min.js

(n=>{var r,t,o;void 0!==window.pum_shortcode_ui_vars&&(r=pum_shortcode_ui_vars.I10n||{error_loading_shortcode_preview:"",shortcode_ui_button_tooltip:"",insert:"",update:""},t=pum_shortcode_ui_vars.shortcodes||{},o={version:1,shortcode_args:{},shortcode_data:{},initialize:function(t){},cleanAttrs:function(o){return _.each(o,function(t,e){null!==t&&""!==t||delete o[e],"object"==typeof t&&(o[e]=Object.keys(t))}),o},template:function(t){var e="pum-shortcode-view-"+this.type,o={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"attrs"};return 1===this.version&&(o.variable="attr"),n("#tmpl-"+e).length?(e=_.template(n("#tmpl-"+e).html(),o),t.class&&(t.classes=t.class,delete t.class),e(t=this.cleanAttrs(t))):this.text},getShortcodeValues:function(){if(void 0===this.shortcode||void 0===this.shortcode.attrs)return{};var t={};if(void 0!==this.shortcode.attrs.named&&(t=_.extend(t,this.shortcode.attrs.named||{})),void 0!==this.shortcode.attrs.numeric)for(var e=0;e<this.shortcode.attrs.numeric.length;e++)t[this.shortcode.attrs.numeric[e]]=!0;return t},getShortcodeContent:function(){return void 0!==this.shortcode&&this.shortcode.content||""},getContent:function(){return this.content||this.fetch(),this.content},formatShortcode:function(t){var e=this.shortcode_args.has_content,o=this.getShortcodeContent();return t=t||this.getShortcodeValues(),e&&void 0!==t._inner_content&&(o=t._inner_content,delete t._inner_content),t=this.cleanAttrs(t),PUM_Admin.templates.shortcode({tag:this.type,meta:t,has_content:e,content:o})},fetch:function(){var e=this,t=e.getShortcodeValues(),o={action:"pum_do_shortcode",post_id:n("#post_ID").val(),tag:e.type,shortcode:e.formatShortcode(),nonce:pum_shortcode_ui_vars.nonce};e.fetching||(e.fetching=!0,e.shortcode_args.has_content&&(t._inner_content=e.getShortcodeContent()),e.shortcode_args.ajax_rendering?n.post(ajaxurl,o).done(function(t){e.content=t.data}).fail(function(){e.content='<span class="pum_shortcode_ui_vars_error">'+r.error_loading_shortcode_preview+"</span>"}).always(function(){delete e.fetching,e.render()}):(e.content=e.template(t),delete e.fetching,e.render()))},edit:function(t,e){var o=_.extend({},this.getShortcodeValues());this.shortcode_args.has_content&&(o._inner_content=this.getShortcodeContent()),this.renderForm(o,e)},setLoader:function(){this.setContent('<div class="loading-placeholder"><div class="dashicons dashicons-admin-generic"></div><div class="wpview-loading"><ins></ins></div></div>')},renderForm:function(t,e){var o=this,i=n.extend(!0,{},{tag:this.type,id:"pum-shortcode-editor-"+this.type,label:"",tabs:{},sections:{},fields:{}},o.shortcode_args);t=t||{},PUM_Admin.modals.reload("#"+i.id,PUM_Admin.templates.modal({id:i.id,title:i.label,description:i.description,classes:"tabbed-content pum-shortcode-editor",save_button:void 0===t?r.insert:r.update,content:PUM_Admin.forms.render({id:"pum-shortcode-editor-"+this.type,tabs:i.tabs||{},sections:i.sections||{},fields:i.fields||{}},t||{}),meta:{"data-shortcode_tag":this.type}})),n("#"+i.id+" form").on("submit",function(t){t.preventDefault();t=n(this),t.pumSerializeObject(),t=PUM_Admin.forms.parseValues(t.pumSerializeObject().attrs,PUM_Admin.forms.flattenFields(i)),t=o.formatShortcode(t);"function"==typeof e&&e(t),PUM_Admin.modals.closeAll()})}},n(document).on("pumFormDependencyMet pumFormDependencyUnmet",".pum-shortcode-editor .pum-field",function(t){var e=n(this).find(":input");"pumFormDependencyUnmet"===t.type.toString()?e.prop("disabled",!0):e.prop("disabled",!1)}),n(function(){window.wp=window.wp||{},window.wp.mce=window.wp.mce||{},window.wp.mce.pum_shortcodes=window.wp.mce.pum_shortcodes||{},_.each(t,function(t,e){wp.mce.pum_shortcodes[e]=_.extend({},o,{version:t.version||1,shortcode_args:t,View:{type:e,template:function(t){return wp.mce.pum_shortcodes[this.type].template(t)},postID:n("#post_ID").val(),initialize:function(t){this.shortcode=t.shortcode,wp.mce.pum_shortcodes[this.type].shortcode_data=this.shortcode},getHtml:function(){var t=this.shortcode.attrs.named;return this.shortcode_args.has_content&&(t._inner_content=this.shortcode.content),this.template(t)}}}),void 0!==wp.mce.views&&"function"==typeof wp.mce.views.register&&wp.mce.views.register(e,wp.mce.pum_shortcodes[e])})}))})(jQuery),(n=>{function t(){var t=n("#pum-shortcode-editor-pum_sub_form #provider"),t=""!==t.val()&&"none"!==t.val()?t.val():pum_admin_vars.default_provider,e=n('.pum-modal-content .tabs .tab a[href^="#pum-shortcode-editor-pum_sub_form_provider_"]'),o=n('[id^="pum-shortcode-editor-pum_sub_form_provider_"]'),i=e.filter('[href="#pum-shortcode-editor-pum_sub_form_provider_'+t+'"]'),t=o.filter('[id="pum-shortcode-editor-pum_sub_form_provider_'+t+'"]');e.each(function(){n(this).parent().hide()}),o.find(":input").attr("disable",!0),i.length&&(i.parent().show(),t.find(":input").attr("disable",!1))}function e(){var t=n("#pum-shortcode-editor-pum_sub_form_provider_mailchimp #list_id").val(),t=n("#pum-mci-list-"+t+",.pum-mci-list-"+t),e=n(".pum-mci-list-options");e.hide(),e.find('input[type="checkbox"]').attr("disabled",!0),t.length&&(t.show(),t.find('input[type="checkbox"]').attr("disabled",!1))}void 0===window.pum_newsletter_initialized&&(window.pum_newsletter_initialized=!0,n(document).on("pum_init","#pum-shortcode-editor-pum_sub_form",t).on("change","#pum-shortcode-editor-pum_sub_form #provider",t),n(document).on("pumInit pum_init","#pum-shortcode-editor-pum_sub_form",e).on("change","#pum-shortcode-editor-pum_sub_form_provider_mailchimp #list_id",e))})(jQuery);

Copyright © 2019 by b0y-101