@abtasty/widget-utils
Advanced tools
Comparing version 1.11.2 to 1.11.3
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var log=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];e.unshift("[AB Tasty Widget] "+PACKAGE+":"),console.log.apply(console,e)},domReady=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},waitForElement=function(e,t,o){var n=0,r=0;try{document.querySelector(e)}catch(t){var a='Selector "'+e+'" not valid.';return log(a),"function"==typeof o&&o(a)}n=setTimeout(function(){clearInterval(r);var t="Can't find element \""+e+'".';return log(t),"function"==typeof o&&o(t)},1e4),r=setInterval(function(){var o=document.querySelector(e);if(null!==o)return clearTimeout(n),clearInterval(r),"function"==typeof t&&t(o)},200)},getCookie=function(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var r=o[n];" "==r.charAt(0);)r=r.substring(1);if(0===r.indexOf(t))return r.substring(t.length,r.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");return null===(e=e.match(/(?:[a-z]{2,4}\.[a-z]{2,3}|[a-z]{2,5})\.[a-z0-9\-]+(?:\.|$)/i))?e=document.location.hostname:("."!=e[0].substr(e[0].length-1)&&(e[0]+="."),e=e[0].split("").reverse().join("")),e},setCookie=function(e,t,o){var n="";if(o){var r=new Date;r.setTime(r.getTime()+24*o*60*60*1e3),n="expires="+r.toUTCString()}var a="domain="+getHostname();document.cookie=e+"="+t+"; "+n+";"+a+";path=/"};exports.log=log,exports.domReady=domReady,exports.waitForElement=waitForElement,exports.getCookie=getCookie,exports.getHostname=getHostname,exports.setCookie=setCookie; | ||
"use strict";function preventGlobalScroll(){var e=document.querySelector("body");originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"}function allowGlobalScroll(){if(originalBodyScroll){document.querySelector("body").style.overflowY=originalBodyScroll}}Object.defineProperty(exports,"__esModule",{value:!0});var originalBodyScroll,exitIntent=function(e){var t,o=0;document.addEventListener("mousemove",function(e){o=e.clientY}),document.body.addEventListener("mouseleave",function n(r){r.clientY<=50&&(o=0,clearInterval(t),t=setTimeout(function(){0===o&&(e(),document.removeEventListener("mouseleave",n))},0))},!1)},log=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];e.unshift("[AB Tasty Widget] "+PACKAGE+":"),console.log.apply(console,e)},domReady=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},waitForElement=function(e,t,o){var n=0,r=0;try{document.querySelector(e)}catch(t){var l='Selector "'+e+'" not valid.';return log(l),"function"==typeof o&&o(l)}n=setTimeout(function(){clearInterval(r);var t="Can't find element \""+e+'".';return log(t),"function"==typeof o&&o(t)},1e4),r=setInterval(function(){var o=document.querySelector(e);if(null!==o)return clearTimeout(n),clearInterval(r),"function"==typeof t&&t(o)},200)},getCookie=function(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var r=o[n];" "==r.charAt(0);)r=r.substring(1);if(0===r.indexOf(t))return r.substring(t.length,r.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");if(null===(e=e.match(/(?:[a-z]{2,4}\.[a-z]{2,3}|[a-z]{2,5})\.[a-z0-9\-]+(?:\.|$)/i)))e=document.location.hostname;else{"."!=e[0].substr(e[0].length-1)&&(e[0]+="."),e=e[0].split("").reverse().join("")}return e},setCookie=function(e,t,o){var n="";if(o){var r=new Date;r.setTime(r.getTime()+24*o*60*60*1e3),n="expires="+r.toUTCString()}var l="domain="+getHostname();document.cookie=e+"="+t+"; "+n+";"+l+";path=/"};exports.preventGlobalScroll=preventGlobalScroll,exports.allowGlobalScroll=allowGlobalScroll,exports.exitIntent=exitIntent,exports.log=log,exports.domReady=domReady,exports.waitForElement=waitForElement,exports.getCookie=getCookie,exports.getHostname=getHostname,exports.setCookie=setCookie; |
@@ -1,1 +0,1 @@ | ||
var log=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];e.unshift("[AB Tasty Widget] "+PACKAGE+":"),console.log.apply(console,e)},domReady=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},waitForElement=function(e,t,n){var o=0,r=0;try{document.querySelector(e)}catch(t){var a='Selector "'+e+'" not valid.';return log(a),"function"==typeof n&&n(a)}o=setTimeout(function(){clearInterval(r);var t="Can't find element \""+e+'".';return log(t),"function"==typeof n&&n(t)},1e4),r=setInterval(function(){var n=document.querySelector(e);if(null!==n)return clearTimeout(o),clearInterval(r),"function"==typeof t&&t(n)},200)},getCookie=function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var r=n[o];" "==r.charAt(0);)r=r.substring(1);if(0===r.indexOf(t))return r.substring(t.length,r.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");return null===(e=e.match(/(?:[a-z]{2,4}\.[a-z]{2,3}|[a-z]{2,5})\.[a-z0-9\-]+(?:\.|$)/i))?e=document.location.hostname:("."!=e[0].substr(e[0].length-1)&&(e[0]+="."),e=e[0].split("").reverse().join("")),e},setCookie=function(e,t,n){var o="";if(n){var r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3),o="expires="+r.toUTCString()}var a="domain="+getHostname();document.cookie=e+"="+t+"; "+o+";"+a+";path=/"};export{log,domReady,waitForElement,getCookie,getHostname,setCookie}; | ||
function preventGlobalScroll(){var e=document.querySelector("body");originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"}function allowGlobalScroll(){if(originalBodyScroll){document.querySelector("body").style.overflowY=originalBodyScroll}}var originalBodyScroll,exitIntent=function(e){var t,o=0;document.addEventListener("mousemove",function(e){o=e.clientY}),document.body.addEventListener("mouseleave",function n(l){l.clientY<=50&&(o=0,clearInterval(t),t=setTimeout(function(){0===o&&(e(),document.removeEventListener("mouseleave",n))},0))},!1)},log=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];e.unshift("[AB Tasty Widget] "+PACKAGE+":"),console.log.apply(console,e)},domReady=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},waitForElement=function(e,t,o){var n=0,l=0;try{document.querySelector(e)}catch(t){var r='Selector "'+e+'" not valid.';return log(r),"function"==typeof o&&o(r)}n=setTimeout(function(){clearInterval(l);var t="Can't find element \""+e+'".';return log(t),"function"==typeof o&&o(t)},1e4),l=setInterval(function(){var o=document.querySelector(e);if(null!==o)return clearTimeout(n),clearInterval(l),"function"==typeof t&&t(o)},200)},getCookie=function(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var l=o[n];" "==l.charAt(0);)l=l.substring(1);if(0===l.indexOf(t))return l.substring(t.length,l.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");if(null===(e=e.match(/(?:[a-z]{2,4}\.[a-z]{2,3}|[a-z]{2,5})\.[a-z0-9\-]+(?:\.|$)/i)))e=document.location.hostname;else{"."!=e[0].substr(e[0].length-1)&&(e[0]+="."),e=e[0].split("").reverse().join("")}return e},setCookie=function(e,t,o){var n="";if(o){var l=new Date;l.setTime(l.getTime()+24*o*60*60*1e3),n="expires="+l.toUTCString()}var r="domain="+getHostname();document.cookie=e+"="+t+"; "+n+";"+r+";path=/"};export{preventGlobalScroll,allowGlobalScroll,exitIntent,log,domReady,waitForElement,getCookie,getHostname,setCookie}; |
{ | ||
"name": "@abtasty/widget-utils", | ||
"version": "1.11.2", | ||
"version": "1.11.3", | ||
"main": "dist/widget-utils.cjs.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/widget-utils.esm.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7086
17