OwlCyberSecurity - MANAGER
Edit File: cleantalk-admin.min.js
function apbct_admin_sendAJAX(t,n,c){let o=n.callback||null,i=n.callback_context||null,a=n.callback_params||null;var e=n.async||!0;let d=n.notJson||null;var l=n.timeout||15e3,c=c||null;let r=n.button||null,s=n.spinner||null,u=n.progressbar||null;"string"==typeof t?t=t+"&_ajax_nonce="+ctAdminCommon._ajax_nonce+"&no_cache="+Math.random():(t._ajax_nonce=ctAdminCommon._ajax_nonce,t.no_cache=Math.random()),r&&(r.setAttribute("disabled","disabled"),r.style.cursor="not-allowed"),s&&jQuery(s).css("display","inline"),jQuery.ajax({type:"POST",url:ctAdminCommon._ajax_url,data:t,async:e,success:function(e){r&&(r.removeAttribute("disabled"),r.style.cursor="pointer"),s&&jQuery(s).css("display","none"),(e=d?e:JSON.parse(e)).error?(setTimeout(function(){u&&u.fadeOut("slow")},1e3),"undefined"!=typeof cleantalkModal?(cleantalkModal.loaded="Error:<br>"+e.error.toString(),cleantalkModal.open()):alert("Error happens: "+(e.error||"Unkown"))):o&&(a?o.apply(i,a.concat(e,t,n,c)):o(e,t,n,c))},error:function(e,t,n){r&&(r.removeAttribute("disabled"),r.style.cursor="pointer"),s&&jQuery(s).css("display","none"),console.log("APBCT_AJAX_ERROR"),console.log(e),console.log(t),console.log(n)},timeout:l})}function apbctSetEmailDecoderPopupAnimation(){var t=["apbct_dog_one","apbct_dog_two","apbct_dog_three"],n=document.createElement("div");n.classList="apbct-ee-animation-wrapper";for(let e=0;e<t.length;e++){var c=document.createElement("span");c.classList="apbct_dog "+t[e],c.innerText="@",n.append(c)}return n}function ctFillDecodedEmailHandler(e=!1){let t=!1,n="",c="";"undefined"!=typeof ctPublic?(this.removeEventListener("click",ctFillDecodedEmailHandler),t=this,ctPublic.encodedEmailNodesIsMixed=!1,n=ctPublic.wl_brandname,c=ctPublic.encodedEmailNodes):"undefined"!=typeof ctAdminCommon&&(n=ctAdminCommon.plugin_name,c=ctAdminCommon.encodedEmailNode),document.body.classList.add("apbct-popup-fade");var o,i,a,d,l=document.getElementById("apbct_popup");l?(l.setAttribute("style","display: inherit"),"undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_wait_for_decoding?document.getElementById("apbct_popup_text").innerHTML=ctPublicFunctions.text__ee_wait_for_decoding:document.getElementById("apbct_popup_text").innerHTML=ctAdminCommon.text__ee_wait_for_decoding):((l=document.createElement("div")).setAttribute("class","apbct-popup apbct-email-encoder-popup"),l.setAttribute("id","apbct_popup"),(o=document.createElement("span")).classList="apbct-email-encoder-elements_center",(i=document.createElement("p")).innerText=n,i.setAttribute("class","apbct-email-encoder--popup-header"),o.append(i),(i=document.createElement("div")).setAttribute("id","apbct_popup_text"),i.setAttribute("class","apbct-email-encoder-elements_center"),i.style.color="black",(a=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_first","undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_wait_for_decoding?a.innerText=ctPublicFunctions.text__ee_wait_for_decoding:a.innerText=ctAdminCommon.text__ee_wait_for_decoding,a.setAttribute("class","apbct-email-encoder-elements_center"),(d=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_second","undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_decoding_process?d.innerText=ctPublicFunctions.text__ee_decoding_process:d.innerText=ctAdminCommon.text__ee_decoding_process,i.append(a),i.append(d),l.append(o),l.append(i),l.append(apbctSetEmailDecoderPopupAnimation()),document.body.append(l)),apbctAjaxEmailDecodeBulk(e,c,t)}function apbctAjaxEmailDecodeBulk(t,n,c){if(t&&c){var e={event_javascript_data:getJavascriptClientData(),post_url:document.location.href,referrer:document.referrer,encodedEmails:""},o={};for(let e=0;e<n.length;e++){void 0!==n[e].href&&0===n[e].href.indexOf("mailto:")&&(t.preventDefault(),ctPublic.encodedEmailNodesIsMixed=!0);var i=document.createElement("div");i.setAttribute("class","apbct-tooltip"),apbct(n[e]).append(i),o[e]=n[e].dataset.originalString}e.encodedEmails=JSON.stringify(o),"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_decode_email",{data:e,method:"POST",callback:function(e){ctSetCookie("apbct_email_encoder_passed",ctPublic.emailEncoderPassKey,""),apbctEmailEncoderCallbackBulk(e,n,c)},onErrorCallback:function(e){resetEncodedNodes(),ctShowDecodeComment(e)}}):(e.action="apbct_decode_email",apbct_public_sendAJAX(e,{notJson:!1,callback:function(e){console.log("result"),console.log(e),ctSetCookie("apbct_email_encoder_passed",ctPublic.emailEncoderPassKey,""),apbctEmailEncoderCallbackBulk(e,n,c)},onErrorCallback:function(e){resetEncodedNodes(),ctShowDecodeComment(e)}}))}else{var e=n.dataset.originalString,e={encodedEmails:JSON.stringify({0:e})},a=document.createElement("div");a.setAttribute("class","apbct-tooltip"),n.appendChild(a),apbct_admin_sendAJAX({action:"apbct_decode_email",encodedEmails:e.encodedEmails},{callback:function(e){apbctEmailEncoderCallbackBulk(e,n,!1)},notJson:!0})}}function apbctEmailEncoderCallbackBulk(o,i,a=!1){o.success&&!0===o.data[0].is_allowed?setTimeout(function(){let t=document.getElementById("apbct_popup");if(null!==t){let e="";if(a){let t;o.data.forEach(e=>{e.encoded_email===a.dataset.originalString&&(t=e)}),e=t.decoded_email.split(/[&?]/)[0]}else e=o.data[0].decoded_email;var n=t.querySelector("#apbct_email_ecoder__popup_text_node_first"),c=document.createElement("b"),c=(c.setAttribute("class","apbct-email-encoder-select-whole-email"),c.innerText=e,"undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_click_to_select?c.title=ctPublicFunctions.text__ee_click_to_select:c.title=ctAdminCommon.text__ee_click_to_select,n&&("undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_original_email?n.innerHTML=ctPublicFunctions.text__ee_original_email+" "+c.outerHTML:n.innerHTML=ctAdminCommon.text__ee_original_email+" "+c.outerHTML,n.setAttribute("style","flex-direction: row;")),t.querySelector(".apbct-ee-animation-wrapper")),n=(c&&c.remove(),t.querySelector("#apbct_email_ecoder__popup_text_node_second")),c=(n&&n.remove(),document.createElement("span"));c.classList="apbct-email-encoder-elements_center top-margin-long",document.querySelector(".apbct-email-encoder-got-it-button")||(n=document.createElement("button"),"undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_got_it?n.innerText=ctPublicFunctions.text__ee_got_it:n.innerText=ctAdminCommon.text__ee_got_it,n.classList="apbct-email-encoder-got-it-button",n.addEventListener("click",function(){document.body.classList.remove("apbct-popup-fade"),t.setAttribute("style","display:none"),fillDecodedNodes(i,o),"undefined"!=typeof ctPublic&&ctPublic.encodedEmailNodesIsMixed&&a&&a.click()}),c.append(n),t.append(c))}},3e3):a?o.success?(resetEncodedNodes(),"undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_blocked?ctShowDecodeComment(ctPublicFunctions.text__ee_blocked+": "+o.data[0].comment):ctShowDecodeComment(ctAdminCommon.text__ee_blocked+": "+o.data[0].comment)):(resetEncodedNodes(),"undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_cannot_connect?ctShowDecodeComment(ctPublicFunctions.text__ee_cannot_connect+": "+o.apbct.comment):ctShowDecodeComment(ctAdminCommon.text__ee_cannot_connect+": "+o.data[0].comment)):console.log("result",o)}function resetEncodedNodes(){void 0!==ctPublic.encodedEmailNodes&&ctPublic.encodedEmailNodes.forEach(function(e){e.addEventListener("click",ctFillDecodedEmailHandler)})}function ctShowDecodeComment(e){e=e||("undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_cannot_decode?ctPublicFunctions:ctAdminCommon).text__ee_cannot_decode;let t=document.getElementById("apbct_popup");var n=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),"undefined"!=typeof ctPublicFunctions&&ctPublicFunctions.text__ee_email_decoder?n.innerText=ctPublicFunctions.text__ee_email_decoder+": "+e:n.innerText=ctAdminCommon.text__ee_email_decoder+": "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function fillDecodedNodes(c,o){if(0<c.length)for(let n=0;n<c.length;n++){let t;if(o.data.forEach(e=>{e.encoded_email===c[n].dataset.originalString&&(t=e)}),!1===t.is_allowed)return;if(void 0===c[n].href||0!==c[n].href.indexOf("mailto:")&&0!==c[n].href.indexOf("tel:"))c[n].classList.add("no-blur"),setTimeout(()=>{ctProcessDecodedDataResult(t,c[n])},2e3);else{let e;if(0===c[n].href.indexOf("mailto:"))e="mailto:";else{if(0!==c[n].href.indexOf("tel:"))continue;e="tel:"}var i=c[n].href.replace(e,""),a=c[n].innerHTML;c[n].innerHTML=a.replace(i,t.decoded_email),c[n].href=e+t.decoded_email,c[n].querySelectorAll("span.apbct-email-encoder").forEach(t=>{let n="";o.data.forEach(e=>{e.encoded_email===t.dataset.originalString&&(n=e.decoded_email)}),t.innerHTML=n})}c[n].removeEventListener("click",ctFillDecodedEmailHandler)}else{let e=o.data[0];c.classList.add("no-blur"),setTimeout(()=>{ctProcessDecodedDataResult(e,c)},2e3),c.removeEventListener("click",ctFillDecodedEmailHandler)}}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),ctFillDecodedEmail(t,e.decoded_email)}function ctFillDecodedEmail(e,t){e.innerHTML=e.innerHTML.replace(/.+?(<div class=["']apbct-tooltip["'].+?<\/div>)/,t+"$1")}jQuery(document).ready(function(t){jQuery(".apbct_update_notice").on("click","button",function(){var e=new Date((new Date).getTime()+2592e6),t="https:"===location.protocol?"; secure":"";document.cookie="apbct_update_banner_closed=1; path=/; expires="+e.toUTCString()+"; samesite=lax"+t}),jQuery('li a[href="options-general.php?page=cleantalk"]').css("white-space","nowrap").css("display","inline-block"),jQuery("body").on("click",".apbct-notice .notice-dismiss-link",function(e){jQuery(e.target).parent().parent(".notice").after('<div id="apbct-notice-dismiss-success" class="notice notice-success is-dismissible"><p>'+ctAdminCommon.apbctNoticeDismissSuccess+"</p></div>"),setTimeout(function(){jQuery("#apbct-notice-dismiss-success").fadeOut()},2e3),jQuery(e.target).parent().siblings(".apbct-notice .notice-dismiss").click()}),jQuery("body").on("click",".apbct-notice .notice-dismiss",function(e){e=jQuery(e.target).parent().attr("id");e&&apbct_admin_sendAJAX({action:"cleantalk_dismiss_notice",notice_id:e},{callback:null,notJson:!0})}),jQuery(".ct_username .row-actions .delete a").on("click",function(e){e.preventDefault(),confirm(ctAdminCommon.notice_when_deleting_user_text)&&(window.location=this.href)});let n=document.querySelector("#apbct_setting_forms__force_protection__On");var e;n&&n.addEventListener("click",function(e){n.checked&&!confirm(ctAdminCommon.apbctNoticeForceProtectionOn)&&e.preventDefault()}),t(".apbct-restore-spam-order-button").click(function(){var e=t(this).data("spam-order-id"),e={action:"apbct_restore_spam_order",_ajax_nonce:ctAdminCommon._ajax_nonce,order_id:e};t.ajax({type:"POST",url:ctAdminCommon._ajax_url,data:e,success:function(e){e.success?window.location.reload():alert(e.data.message)}})}),window.location.href.includes("options-general.php?page=cleantalk")&&(e=document.querySelector("[data-original-string]"))&&((ctAdminCommon.encodedEmailNode=e).style.cursor="pointer",e.addEventListener("click",ctFillDecodedEmailHandler))}); //# sourceMappingURL=cleantalk-admin.min.js.map