← Back
Editing: admin-settings-page.js
(()=>{var e={9830(){!function(e){"use strict";function t(){const t=e("#popup_maker_pro_license_key");if(!t.length)return;const n=t.closest(".pum-license-input-wrapper").find(".pum-license-activate, .button-primary");function o(){const e=32===t.val().trim().length,o=!0===n.data("processing");n.length&&n.prop("disabled",!e||o)}t.on("paste",function(){setTimeout(function(){32===t.val().trim().length&&n.length&&!n.prop("disabled")&&n.trigger("click")},100)}),t.on("keypress",function(e){13!==e.which&&13!==e.keyCode||(e.preventDefault(),32===t.val().trim().length&&n.length&&!n.prop("disabled")&&n.trigger("click"))}),t.on("input keyup",o),n.on("click",function(){const t=e(this);setTimeout(function(){t.data("processing",!0);const e=t.val()||t.text();t.data("original-text",e),t.val(e+"...").prop("disabled",!0)},50)}),o()}window.PUM_Admin=window.PUM_Admin||{},e(function(){t()}),e(document).on("pum_init",function(){t()})}(jQuery)}};const t={};function n(o){const i=t[o];if(void 0!==i)return i.exports;const a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}(()=>{"use strict";var e;n(9830),e=window.jQuery,window.PUM_Admin=window.PUM_Admin||{},e(function(){function t(){const t=window.location.hash.replace("#","");if(t){let n=e(`a[href="#${t}"]`);n.length||(n=e(`a[href="#pum-settings_${t}"]`)),n.length&&setTimeout(()=>n.trigger("click"),100)}}const n=e("#pum-settings-container"),o=window.pum_settings_editor||{},i=o.form_args||{},a=o.current_values||{},r=window.pum_css_viewer||{},s=r.i18n||{},d={loading:s.loading||"Loading Popup Maker CSS…",load_error:s.load_error||"Popup Maker CSS could not be loaded. Please try again.",readable_unavailable:s.readable_unavailable||"Readable CSS is unavailable. Rebuild the plugin assets and try again.",show:s.show||"Show Popup Maker CSS"};let l=null;function c(e,t){const n=e.find("#pum_style_output"),o=e.find('[data-pum-css-format="readable"]');e.find("#pum_core_styles").val(t.core.minified),e.find("#pum_generated_styles").val(t.generated),t.readable_available||o.prop("disabled",!0).attr("title",d.readable_unavailable),e.find("#show_pum_styles").attr("aria-expanded","true").hide(),n.removeAttr("hidden").hide().slideDown()}function u(){const t=n.children(".pum-tabs-container").first().children(".tab-content.active"),o="pum-settings_go-pro"===t.attr("id")&&0===t.find(".pum-field").not(".pum-go-pro-placeholder").length;e("#pum-settings-save").toggle(!o)}n.length&&(n.find(".pum-no-js").hide(),window.PUM_Admin.forms.render(i,a,n),u(),n.on("click","#show_pum_styles",function(){!function(t){if(l)return void c(t,l);const n=t.find("#show_pum_styles"),o=t.find(".pum-css-viewer__status");n.prop("disabled",!0).text(d.loading),o.attr("hidden",!0).removeClass("notice notice-error"),e.ajax({url:r.ajax_url,method:"POST",data:{action:"pum_get_css_styles",nonce:r.nonce}}).done(e=>{if(!e.success||!e.data)return o.text(d.load_error).addClass("notice notice-error").removeAttr("hidden"),void n.prop("disabled",!1).text(d.show);l=e.data,c(t,l)}).fail(e=>{o.text(function(e){return e&&e.responseJSON&&e.responseJSON.data?e.responseJSON.data.message:d.load_error}(e)).addClass("notice notice-error").removeAttr("hidden"),n.prop("disabled",!1).text(d.show)})}(e(this).closest(".pum-css-viewer"))}),n.on("click","[data-pum-css-format]",function(){if(!l)return;const t=e(this),n=t.data("pum-css-format"),o=t.closest(".pum-css-viewer");o.find("#pum_core_styles").val(l.core[n]),o.find("[data-pum-css-format]").removeClass("button-primary").attr("aria-pressed","false"),t.addClass("button-primary").attr("aria-pressed","true")}),t(),e(window).on("hashchange",t),n.on("click",'.pum-tabs-container a[href^="#"]',function(){setTimeout(()=>{window.location.hash&&window.history.replaceState(null,null,window.location.pathname+window.location.search),u()},50)}))})})()})();
Save File
Cancel