|
1
|
|
-window.Patchstack=window.Patchstack||{},function(t,a,c,e){var n={},i=null,o=!1,s=0;e.init=function(){e.cache(),e.bindEvents()},e.cache=function(){n.window=c(t),n.body=c(a.body)},e.poller=function(){i=setInterval(()=>{o||0!=s||(e.autoActivate(),s=5),s--},1e3)},e.autoActivate=function(){o=!0;var a={action:"patchstack_activate_auto",PatchstackNonce:PatchstackVars.nonce};c.post(PatchstackVars.ajaxurl,a,function(a){var e={action:"patchstack_activation_status",PatchstackNonce:PatchstackVars.nonce};c.post(PatchstackVars.ajaxurl,e,function(a){a.activated&&(t.location=t.location.href.replace("&ps_autoa=1","")+"&resync=1"),o=!1})})},e.bindEvents=function(){c("input#patchstack-activate").on("click",function(a){a.preventDefault();var e={action:"patchstack_activate_license",key:""==c(".patchstack-auto-activate").attr("style")?c("#patchstack_api_key2").val():c("#patchstack_api_key").val(),PatchstackNonce:PatchstackVars.nonce};if(0==c.trim(e.key).length)return alert("Please enter the API key."),!1;c(".patchstack-resync").hide(),c("#patchstack-activate").hide(),c(".patchstack-loading").show(),c(".is-polling-section").hide(),o=!0,c.post(PatchstackVars.ajaxurl,e,function(a){o=!1,s=5,"error"==a.result?(c("#patchstack-activate, .is-polling-section").show(),c(".patchstack-loading").hide(),a.error_message?alert(a.error_message):alert(PatchstackVars.error_message)):t.location=t.location.href+"&resync=1"})}),c(".patchstack-retry-link").on("click",function(a){a.preventDefault();var t=c(this);if(t.hasClass("is-loading"))return;t.addClass("is-loading");c.post(PatchstackVars.ajaxurl,{action:"patchstack_check_connection",PatchstackNonce:PatchstackVars.nonce},function(a){if(!a)return;var e=c(".patchstack-connection-status");e.toggleClass("is-connected",!!a.connected);e.toggleClass("is-disconnected",!a.connected);if(typeof a.label==="string")c(".patchstack-last-sync").text(a.label)}).always(function(){t.removeClass("is-loading")})})},c(e.init)}(window,document,jQuery,window.Patchstack); |
|
1
|
+window.Patchstack=window.Patchstack||{},function(a,c,t,e){var p={},h=null,i=!1,s=0;e.init=function(){e.cache(),e.bindEvents()},e.cache=function(){p.window=t(a),p.body=t(c.body)},e.poller=function(){h=setInterval(()=>{i||0!=s||(e.autoActivate(),s=5),s--},1e3)},e.autoActivate=function(){i=!0;var c={action:"patchstack_activate_auto",PatchstackNonce:PatchstackVars.nonce};t.post(PatchstackVars.ajaxurl,c,function(c){var e={action:"patchstack_activation_status",PatchstackNonce:PatchstackVars.nonce};t.post(PatchstackVars.ajaxurl,e,function(c){c.activated&&(a.location=a.location.href.replace("&ps_autoa=1","")+"&resync=1"),i=!1})})},e.bindEvents=function(){if(t("input#patchstack-activate").on("click",function(c){c.preventDefault();var e={action:"patchstack_activate_license",key:""==t(".patchstack-auto-activate").attr("style")?t("#patchstack_api_key2").val():t("#patchstack_api_key").val(),PatchstackNonce:PatchstackVars.nonce};if(0==t.trim(e.key).length)return alert("Please enter the API key."),!1;t(".patchstack-resync").hide(),t("#patchstack-activate").hide(),t(".patchstack-loading").show(),t(".is-polling-section").hide(),i=!0,t.post(PatchstackVars.ajaxurl,e,function(c){i=!1,s=5,"error"==c.result?(t("#patchstack-activate, .is-polling-section").show(),t(".patchstack-loading").hide(),c.error_message?alert(c.error_message):alert(PatchstackVars.error_message)):a.location=a.location.href+"&resync=1"})}),"v2"==t("#patchstack_captcha_type").val()?(t("#patchstack_captcha_public_key_v3, #patchstack_captcha_private_key_v3, #patchstack_captcha_public_key_v3_new, #patchstack_captcha_private_key_v3_new").hide(),t("#patchstack_captcha_public_key, #patchstack_captcha_private_key").show()):"invisible"==t("#patchstack_captcha_type").val()?(t("#patchstack_captcha_public_key, #patchstack_captcha_private_key, #patchstack_captcha_public_key_v3_new, #patchstack_captcha_private_key_v3_new").hide(),t("#patchstack_captcha_public_key_v3, #patchstack_captcha_private_key_v3").show()):(t("#patchstack_captcha_public_key, #patchstack_captcha_private_key, #patchstack_captcha_public_key_v3, #patchstack_captcha_private_key_v3").hide(),t("#patchstack_captcha_public_key_v3_new, #patchstack_captcha_private_key_v3_new").show()),t("#patchstack_captcha_type").change(function(){"v2"==t("#patchstack_captcha_type").val()?(t("#patchstack_captcha_public_key_v3, #patchstack_captcha_private_key_v3, #patchstack_captcha_public_key_v3_new, #patchstack_captcha_private_key_v3_new").hide(),t("#patchstack_captcha_public_key, #patchstack_captcha_private_key").show()):"invisible"==t("#patchstack_captcha_type").val()?(t("#patchstack_captcha_public_key, #patchstack_captcha_private_key, #patchstack_captcha_public_key_v3_new, #patchstack_captcha_private_key_v3_new").hide(),t("#patchstack_captcha_public_key_v3, #patchstack_captcha_private_key_v3").show()):(t("#patchstack_captcha_public_key, #patchstack_captcha_private_key, #patchstack_captcha_public_key_v3, #patchstack_captcha_private_key_v3").hide(),t("#patchstack_captcha_public_key_v3_new, #patchstack_captcha_private_key_v3_new").show())}),t("#geo-countries").length>0){var c=[];""!=t("#geo-countries").data("selected")&&(c=t("#geo-countries").data("selected").split(",")),t("#geo-countries").selectize({maxItems:null,delimiter:",",plugins:["remove_button"],items:c})}},t(e.init)}(window,document,jQuery,window.Patchstack); |