diff --git a/build/ouibounce.js b/build/ouibounce.js index 43985d5..769ee66 100644 --- a/build/ouibounce.js +++ b/build/ouibounce.js @@ -34,7 +34,7 @@ return function ouibounce(el, config) { var date = new Date(); date.setTime(date.getTime() + ms); - return "; expires=" + date.toGMTString(); + return "; expires=" + date.toUTCString(); } setTimeout(attachOuiBounce, timer); @@ -60,7 +60,7 @@ return function ouibounce(el, config) { var disableKeydown = false; function handleKeydown(e) { if (disableKeydown || checkCookieValue('viewedOuibounceModal', 'true') && !aggressive) return; - else if(!e.metaKey || e.keyCode != 76) return; + else if(!e.metaKey || e.keyCode !== 76) return; disableKeydown = true; _delayTimer = setTimeout(_fireAndCallback, delay); diff --git a/build/ouibounce.min.js b/build/ouibounce.min.js index e3bb210..83001ea 100644 --- a/build/ouibounce.min.js +++ b/build/ouibounce.min.js @@ -1 +1 @@ -!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n(require,exports,module):e.ouibounce=n()}(this,function(){return function(e,n){function o(e,n){return"undefined"==typeof e?n:e}function t(e){var n=24*e*60*60*1e3,o=new Date;return o.setTime(o.getTime()+n),"; expires="+o.toGMTString()}function i(){T.addEventListener("mouseleave",u),T.addEventListener("mouseenter",r),T.addEventListener("keydown",c)}function u(e){e.clientY>v||d("viewedOuibounceModal","true")&&!l||(x=setTimeout(s,k))}function r(){x&&(clearTimeout(x),x=null)}function c(e){L||d("viewedOuibounceModal","true")&&!l||e.metaKey&&76==e.keyCode&&(L=!0,x=setTimeout(s,k))}function d(e,n){return a()[e]===n}function a(){for(var e=document.cookie.split("; "),n={},o=e.length-1;o>=0;o--){var t=e[o].split("=");n[t[0]]=t[1]}return n}function s(){f(),y()}function f(){e&&(e.style.display="block"),m()}function m(e){var e=e||{};"undefined"!=typeof e.cookieExpire&&(E=t(e.cookieExpire)),e.sitewide===!0&&(w=";path=/"),"undefined"!=typeof e.cookieDomain&&(b=";domain="+e.cookieDomain),document.cookie="viewedOuibounceModal=true"+E+b+w,T.removeEventListener("mouseleave",u),T.removeEventListener("mouseenter",r),T.removeEventListener("keydown",c)}var n=n||{},l=n.aggressive||!1,v=o(n.sensitivity,20),p=o(n.timer,1e3),k=o(n.delay,0),y=n.callback||function(){},E=t(n.cookieExpire)||"",b=n.cookieDomain?";domain="+n.cookieDomain:"",w=n.sitewide===!0?";path=/":"",x=null,T=document.documentElement;setTimeout(i,p);var L=!1;return{fire:f,disable:m}}}); \ No newline at end of file +!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n(require,exports,module):e.ouibounce=n()}(this,function(){return function(e,n){function o(e,n){return"undefined"==typeof e?n:e}function t(e){var n=24*e*60*60*1e3,o=new Date;return o.setTime(o.getTime()+n),"; expires="+o.toUTCString()}function i(){T.addEventListener("mouseleave",u),T.addEventListener("mouseenter",r),T.addEventListener("keydown",c)}function u(e){e.clientY>v||d("viewedOuibounceModal","true")&&!l||(x=setTimeout(s,k))}function r(){x&&(clearTimeout(x),x=null)}function c(e){L||d("viewedOuibounceModal","true")&&!l||e.metaKey&&76===e.keyCode&&(L=!0,x=setTimeout(s,k))}function d(e,n){return a()[e]===n}function a(){for(var e=document.cookie.split("; "),n={},o=e.length-1;o>=0;o--){var t=e[o].split("=");n[t[0]]=t[1]}return n}function s(){f(),y()}function f(){e&&(e.style.display="block"),m()}function m(e){var e=e||{};"undefined"!=typeof e.cookieExpire&&(E=t(e.cookieExpire)),e.sitewide===!0&&(w=";path=/"),"undefined"!=typeof e.cookieDomain&&(b=";domain="+e.cookieDomain),document.cookie="viewedOuibounceModal=true"+E+b+w,T.removeEventListener("mouseleave",u),T.removeEventListener("mouseenter",r),T.removeEventListener("keydown",c)}var n=n||{},l=n.aggressive||!1,v=o(n.sensitivity,20),p=o(n.timer,1e3),k=o(n.delay,0),y=n.callback||function(){},E=t(n.cookieExpire)||"",b=n.cookieDomain?";domain="+n.cookieDomain:"",w=n.sitewide===!0?";path=/":"",x=null,T=document.documentElement;setTimeout(i,p);var L=!1;return{fire:f,disable:m}}}); \ No newline at end of file diff --git a/source/ouibounce.js b/source/ouibounce.js index 8a12d96..318d35c 100644 --- a/source/ouibounce.js +++ b/source/ouibounce.js @@ -22,7 +22,7 @@ function ouibounce(el, config) { var date = new Date(); date.setTime(date.getTime() + ms); - return "; expires=" + date.toGMTString(); + return "; expires=" + date.toUTCString(); } setTimeout(attachOuiBounce, timer);