@abtasty/widget-utils
Advanced tools
Comparing version 1.12.0 to 1.12.1
@@ -1,1 +0,1 @@ | ||
"use strict";var originalBodyScroll;function preventGlobalScroll(){var e=document.querySelector("body");originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"}function allowGlobalScroll(){originalBodyScroll&&(document.querySelector("body").style.overflowY=originalBodyScroll)}Object.defineProperty(exports,"__esModule",{value:!0});var loadImage=function(e){return new Promise(function(o,t){var n=new Image;n.onload=function(){o(n)},n.src=e,n.onerror=function(o){var n=new Error("Image "+e+" is not loaded.");t(n)}})},exitIntent=function(e){var o,t=0;document.addEventListener("mousemove",function(e){t=e.clientY}),document.body.addEventListener("mouseleave",function n(r){r.clientY<=50&&(t=0,clearInterval(o),o=setTimeout(function(){0===t&&(e(),document.removeEventListener("mouseleave",n))},0))},!1)},log=function(){for(var e=[],o=arguments.length;o--;)e[o]=arguments[o];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,o,t){var n,r=0;try{document.querySelector(e)}catch(o){var l='Selector "'+e+'" not valid.';return log(l),"function"==typeof t&&t(l)}n=setTimeout(function(){clearInterval(r);var o="Can't find element \""+e+'".';return log(o),"function"==typeof t&&t(o)},1e4),r=setInterval(function(){var t=document.querySelector(e);if(null!==t)return clearTimeout(n),clearInterval(r),"function"==typeof o&&o(t)},200)},getCookie=function(e){for(var o=e+"=",t=document.cookie.split(";"),n=0;n<t.length;n++){for(var r=t[n];" "==r.charAt(0);)r=r.substring(1);if(0===r.indexOf(o))return r.substring(o.length,r.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");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(""));return e},setCookie=function(e,o,t){var n="";if(t){var r=new Date;r.setTime(r.getTime()+24*t*60*60*1e3),n="expires="+r.toUTCString()}var l="domain="+getHostname();document.cookie=e+"="+o+"; "+n+";"+l+";path=/"};exports.preventGlobalScroll=preventGlobalScroll,exports.allowGlobalScroll=allowGlobalScroll,exports.loadImage=loadImage,exports.exitIntent=exitIntent,exports.log=log,exports.domReady=domReady,exports.waitForElement=waitForElement,exports.getCookie=getCookie,exports.getHostname=getHostname,exports.setCookie=setCookie; | ||
"use strict";var originalBodyScroll;function preventGlobalScroll(){var e=document.querySelector("body");originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"}function allowGlobalScroll(){originalBodyScroll&&(document.querySelector("body").style.overflowY=originalBodyScroll)}Object.defineProperty(exports,"__esModule",{value:!0});var loadImage=function(e){return new Promise(function(o,t){var n=new Image;n.onload=function(){o(n)},n.src=e,n.onerror=function(o){var n=new Error("Image "+e+" is not loaded.");t(n)}})},isTouch=function(){return void 0!==window.ontouchstart},exitIntent=function(e){var o,t=0;document.addEventListener("mousemove",function(e){t=e.clientY}),document.body.addEventListener("mouseleave",function n(r){r.clientY<=50&&(t=0,clearInterval(o),o=setTimeout(function(){0===t&&(e(),document.removeEventListener("mouseleave",n))},0))},!1)},log=function(){for(var e=[],o=arguments.length;o--;)e[o]=arguments[o];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,o,t){var n,r=0;try{document.querySelector(e)}catch(o){var l='Selector "'+e+'" not valid.';return log(l),"function"==typeof t&&t(l)}n=setTimeout(function(){clearInterval(r);var o="Can't find element \""+e+'".';return log(o),"function"==typeof t&&t(o)},1e4),r=setInterval(function(){var t=document.querySelector(e);if(null!==t)return clearTimeout(n),clearInterval(r),"function"==typeof o&&o(t)},200)},getCookie=function(e){for(var o=e+"=",t=document.cookie.split(";"),n=0;n<t.length;n++){for(var r=t[n];" "==r.charAt(0);)r=r.substring(1);if(0===r.indexOf(o))return r.substring(o.length,r.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");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(""));return e},setCookie=function(e,o,t){var n="";if(t){var r=new Date;r.setTime(r.getTime()+24*t*60*60*1e3),n="expires="+r.toUTCString()}var l="domain="+getHostname();document.cookie=e+"="+o+"; "+n+";"+l+";path=/"};exports.preventGlobalScroll=preventGlobalScroll,exports.allowGlobalScroll=allowGlobalScroll,exports.loadImage=loadImage,exports.isTouch=isTouch,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 originalBodyScroll;function preventGlobalScroll(){var e=document.querySelector("body");originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"}function allowGlobalScroll(){originalBodyScroll&&(document.querySelector("body").style.overflowY=originalBodyScroll)}var loadImage=function(e){return new Promise(function(o,t){var n=new Image;n.onload=function(){o(n)},n.src=e,n.onerror=function(o){var n=new Error("Image "+e+" is not loaded.");t(n)}})},exitIntent=function(e){var o,t=0;document.addEventListener("mousemove",function(e){t=e.clientY}),document.body.addEventListener("mouseleave",function n(r){r.clientY<=50&&(t=0,clearInterval(o),o=setTimeout(function(){0===t&&(e(),document.removeEventListener("mouseleave",n))},0))},!1)},log=function(){for(var e=[],o=arguments.length;o--;)e[o]=arguments[o];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,o,t){var n,r=0;try{document.querySelector(e)}catch(o){var l='Selector "'+e+'" not valid.';return log(l),"function"==typeof t&&t(l)}n=setTimeout(function(){clearInterval(r);var o="Can't find element \""+e+'".';return log(o),"function"==typeof t&&t(o)},1e4),r=setInterval(function(){var t=document.querySelector(e);if(null!==t)return clearTimeout(n),clearInterval(r),"function"==typeof o&&o(t)},200)},getCookie=function(e){for(var o=e+"=",t=document.cookie.split(";"),n=0;n<t.length;n++){for(var r=t[n];" "==r.charAt(0);)r=r.substring(1);if(0===r.indexOf(o))return r.substring(o.length,r.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");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(""));return e},setCookie=function(e,o,t){var n="";if(t){var r=new Date;r.setTime(r.getTime()+24*t*60*60*1e3),n="expires="+r.toUTCString()}var l="domain="+getHostname();document.cookie=e+"="+o+"; "+n+";"+l+";path=/"};export{preventGlobalScroll,allowGlobalScroll,loadImage,exitIntent,log,domReady,waitForElement,getCookie,getHostname,setCookie}; | ||
var originalBodyScroll;function preventGlobalScroll(){var e=document.querySelector("body");originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"}function allowGlobalScroll(){originalBodyScroll&&(document.querySelector("body").style.overflowY=originalBodyScroll)}var loadImage=function(e){return new Promise(function(o,t){var n=new Image;n.onload=function(){o(n)},n.src=e,n.onerror=function(o){var n=new Error("Image "+e+" is not loaded.");t(n)}})},isTouch=function(){return void 0!==window.ontouchstart},exitIntent=function(e){var o,t=0;document.addEventListener("mousemove",function(e){t=e.clientY}),document.body.addEventListener("mouseleave",function n(r){r.clientY<=50&&(t=0,clearInterval(o),o=setTimeout(function(){0===t&&(e(),document.removeEventListener("mouseleave",n))},0))},!1)},log=function(){for(var e=[],o=arguments.length;o--;)e[o]=arguments[o];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,o,t){var n,r=0;try{document.querySelector(e)}catch(o){var l='Selector "'+e+'" not valid.';return log(l),"function"==typeof t&&t(l)}n=setTimeout(function(){clearInterval(r);var o="Can't find element \""+e+'".';return log(o),"function"==typeof t&&t(o)},1e4),r=setInterval(function(){var t=document.querySelector(e);if(null!==t)return clearTimeout(n),clearInterval(r),"function"==typeof o&&o(t)},200)},getCookie=function(e){for(var o=e+"=",t=document.cookie.split(";"),n=0;n<t.length;n++){for(var r=t[n];" "==r.charAt(0);)r=r.substring(1);if(0===r.indexOf(o))return r.substring(o.length,r.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");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(""));return e},setCookie=function(e,o,t){var n="";if(t){var r=new Date;r.setTime(r.getTime()+24*t*60*60*1e3),n="expires="+r.toUTCString()}var l="domain="+getHostname();document.cookie=e+"="+o+"; "+n+";"+l+";path=/"};export{preventGlobalScroll,allowGlobalScroll,loadImage,isTouch,exitIntent,log,domReady,waitForElement,getCookie,getHostname,setCookie}; |
{ | ||
"name": "@abtasty/widget-utils", | ||
"version": "1.12.0", | ||
"version": "1.12.1", | ||
"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
7620