@abtasty/widget-utils
Advanced tools
Comparing version 1.11.1 to 1.11.2
@@ -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("");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 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";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; |
@@ -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("");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,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}; | ||
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}; |
{ | ||
"name": "@abtasty/widget-utils", | ||
"version": "1.11.1", | ||
"version": "1.11.2", | ||
"main": "dist/widget-utils.cjs.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/widget-utils.esm.js", |
@@ -45,6 +45,6 @@ # Widgets Utils | ||
```javascript | ||
waitForElement('.footer', () => { | ||
waitForElement('.footer', (footer) => { | ||
// Footer is found and ready to be manipulated. | ||
}, () => { | ||
}, (error) => { | ||
// Footer not found :( | ||
@@ -51,0 +51,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
5755