File Editor
Directories:
.. (Back)
Files:
adflow-loader.min.asset.php
adflow-loader.min.js
cmp-loader.min.asset.php
cmp-loader.min.js
wordads-ccpa.min.asset.php
wordads-ccpa.min.js
Create New File
Create
Edit File: wordads-ccpa.min.js
!function(){var e=function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},t=function(e,t,n,a,o,c){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var s="";if(n)switch(n.constructor){case Number:s=n===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+n;break;case String:s="; expires="+n;break;case Date:s="; expires="+n.toUTCString()}return"rootDomain"!==o&&".rootDomain"!==o||(o=(".rootDomain"===o?".":"")+document.location.hostname.split(".").slice(-2).join(".")),document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+s+(o?"; domain="+o:"")+(a?"; path="+a:"")+(c?"; secure":""),!0};window.__uspapi=function(t,n,a){if("function"==typeof a)if("getUSPData"===t&&1===n)if(navigator.globalPrivacyControl)a({version:1,uspString:"1YYN"},!0);else{var o=e("usprivacy");null!==o?a({version:1,uspString:o},!0):a(null,!1)}else a(null,!1)};var n=function(e){var n=".wordpress.com"===location.hostname.slice(-14)?".rootDomain":location.hostname;t("ccpa_applies",e,86400,"/",n)},a=function(){var e=document.querySelector("#ccpa-modal");e&&e.parentElement.removeChild(e)},o=function(){var t;a(),t=document.createElement("div"),document.body.insertBefore(t,document.body.firstElementChild),t.outerHTML='<div id="ccpa-loading" class="cleanslate ccpa__loading-wrapper"><div class="ccpa__loading-overlay"><span class="ccpa__loading-message">'+ccpaSettings.strings.pleaseWait+"...</span></div></div>";var n=new XMLHttpRequest;n.open("GET",ccpaSettings.ajaxUrl+"?action=privacy_optout_markup&security="+ccpaSettings.ajaxNonce,!0),n.onreadystatechange=function(){if(4===this.readyState&&200===this.status){document.getElementById("ccpa-loading").remove();var t=document.createElement("div");document.body.insertBefore(t,document.body.firstElementChild),t.outerHTML=this.response,document.getElementById("ccpa-opt-out").focus(),document.querySelector("#ccpa-modal .opt-out").addEventListener("click",(function(e){var t=new XMLHttpRequest;t.open("POST",ccpaSettings.ajaxUrl,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.onreadystatechange=function(){if(4===this.readyState&&200===this.status){var t=JSON.parse(this.response);t&&t.success&&(t.data?(e.target.parentNode.classList.add("is-checked"),e.target.parentNode.parentNode.classList.add("is-checked")):(e.target.parentNode.classList.remove("is-checked"),e.target.parentNode.parentNode.classList.remove("is-checked")))}},t.send("action=privacy_optout&optout="+e.target.checked+"&security="+ccpaSettings.ajaxNonce)}));var n=e("usprivacy"),o=n&&"Y"===n[2],c=document.querySelector("#ccpa-modal .opt-out");c.checked=o,o&&(c.parentNode.classList.add("is-checked"),c.parentNode.parentNode.classList.add("is-checked"));var s=document.querySelectorAll("#ccpa-modal .components-button");Array.prototype.forEach.call(s,(function(e){e.addEventListener("click",(function(){a()}))}))}},n.send()},c=function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("wordads-ccpa-initialized",!0,!1,{ccpaApplies:e}),document.dispatchEvent(t)},s=function(e,n){var a,s,i=document.querySelectorAll(".ccpa-do-not-sell");null===n&&(e?0===i.length?(a=ccpaSettings.defaultOptOutCookieString,s=".wordpress.com"===location.hostname.slice(-14)?".rootDomain":location.hostname,t("usprivacy",a,86400,"/",s)):function(){var e=ccpaSettings.defaultOptInCookieString,n=".wordpress.com"===location.hostname.slice(-14)?".rootDomain":location.hostname;t("usprivacy",e,31536e3,"/",n)}():function(){var e=".wordpress.com"===location.hostname.slice(-14)?".rootDomain":location.hostname;t("usprivacy","1---",86400,"/",e)}()),e||"false"!==ccpaSettings.forceApplies?(Array.prototype.forEach.call(i,(function(e){e.addEventListener("click",(function(e){if(e.preventDefault(),!ccpaSettings.stylesLoaded){var t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href=ccpaSettings.ccpaCssUrl,document.getElementsByTagName("HEAD")[0].appendChild(t),ccpaSettings.stylesLoaded=!0}o()})),e.style.display=""})),c(!0)):c(!1)};document.addEventListener("DOMContentLoaded",(function(){var t=e("usprivacy");if(null===t){var a=e("ccpa_applies");if(null===a){var o=new XMLHttpRequest;o.open("GET","https://public-api.wordpress.com/geo/",!0),o.onreadystatechange=function(){if(4===this.readyState)if(200===this.status){var e=JSON.parse(this.response),t=e.region?e.region.toLowerCase():"",a=["california","colorado","connecticut","delaware","indiana","iowa","montana","new jersey","oregon","tennessee","texas","utah","virginia"].indexOf(t)>-1;n(a),s(a,null)}else n(!0),s(!0,null)},o.send()}else s("true"===a,null)}else s("1---"!==t,t)}))}();
Save Changes
Rename File
Rename