PageSourceSearch

https://www.vapor.io/wp-content/cache/min/1/wp-content/plugins/cookie-notice/js/front.js?ver=1770771393

js vapor.io collected 2026-09-24 11:45:23 UTC 10,368 bytes, 34 lines download raw bytes

1(function(){if(typeof window.CustomEvent==="function")
2return!1;function CustomEvent(event,params){params=params||{bubbles:!1,cancelable:!1,detail:undefined};var evt=document.createEvent('CustomEvent');evt.initCustomEvent(event,params.bubbles,params.cancelable,params.detail);return evt}
3CustomEvent.prototype=window.Event.prototype;window.CustomEvent=CustomEvent})();(function(){var regExp=function(name){return new RegExp('(^| )'+name+'( |$)')};var forEach=function(list,fn,scope){for(var i=0;i<list.length;i++){fn.call(scope,list[i])}};function ClassList(element){this.element=element}
4ClassList.prototype={add:function(){forEach(arguments,function(name){if(!this.contains(name)){this.element.className+=this.element.className.length>0?' '+name:name}},this)},remove:function(){forEach(arguments,function(name){this.element.className=this.element.className.replace(regExp(name),'')},this)},toggle:function(name){return this.contains(name)?(this.remove(name),!1):(this.add(name),!0)},contains:function(name){return regExp(name).test(this.element.className)},replace:function(oldName,newName){this.remove(oldName),this.add(newName)}};if(!('classList' in Element.prototype)){Object.defineProperty(Element.prototype,'classList',{get:function(){return new ClassList(this)}})}
5if(window.DOMTokenList&&DOMTokenList.prototype.replace==null)
6DOMTokenList.prototype.replace=ClassList.prototype.replace})();(function(window,document,undefined){var cookieNotice=new function(){this.cookiesAccepted=null;this.noticeContainer=null;this.setStatus=function(cookieValue){var _this=this;var cookieDomain='';var cookiePath='';var date=new Date();var laterDate=new Date();if(cnArgs.onScroll)
7window.removeEventListener('scroll',this.handleScroll);if(cookieValue==='accept'){cookieValue='true';laterDate.setTime(parseInt(date.getTime())+parseInt(cnArgs.cookieTime)*1000)}else{cookieValue='false';laterDate.setTime(parseInt(date.getTime())+parseInt(cnArgs.cookieTimeRejected)*1000)}
8if(cnArgs.globalCookie)
9cookieDomain=this.getDomain(document.location.hostname);if(document.location.hostname==='localhost')
10cookiePath=document.location.pathname.split('/')[1];var secureValue='';if(document.location.protocol==='https:')
11secureValue=';secure';document.cookie=cnArgs.cookieName+'='+cookieValue+';expires='+laterDate.toUTCString()+';path=/'+cookiePath+';domain='+cookieDomain+secureValue;this.cookiesAccepted=cookieValue==='true';var event=new CustomEvent('setCookieNotice',{detail:{value:cookieValue,time:date,expires:laterDate,data:cnArgs}});document.dispatchEvent(event);this.setBodyClass(['cookies-set',cookieValue==='true'?'cookies-accepted':'cookies-refused']);this.hideCookieNotice();if(cnArgs.revokeCookiesOpt==='automatic'){this.noticeContainer.addEventListener('animationend',function handler(){_this.noticeContainer.removeEventListener('animationend',handler);_this.showRevokeNotice()});this.noticeContainer.addEventListener('webkitAnimationEnd',function handler(){_this.noticeContainer.removeEventListener('webkitAnimationEnd',handler);_this.showRevokeNotice()})}
12if(cnArgs.redirection&&((cookieValue==='true'&&this.cookiesAccepted===null)||(cookieValue!==this.cookiesAccepted&&this.cookiesAccepted!==null))){var url=window.location.protocol+'//',hostname=window.location.host+'/'+window.location.pathname;if(cnArgs.cache){url=url+hostname.replace('//','/')+(window.location.search===''?'?':window.location.search+'&')+'cn-reloaded=1'+window.location.hash;window.location.href=url}else{url=url+hostname.replace('//','/')+window.location.search+window.location.hash;window.location.reload(!0)}
13return}};this.getDomain=function(url){var regex=new RegExp(/https?:\/\//);if(!regex.test(url))
14url='http://'+url;var parts=new URL(url).hostname.split('.');return parts.slice(0).slice(-(parts.length===4?3:2)).join('.')}
15this.getStatus=function(bool){var value="; "+document.cookie,parts=value.split('; cookie_notice_accepted=');if(parts.length===2){var val=parts.pop().split(';').shift();if(bool)
16return val==='true';else return val}else return null};this.showCookieNotice=function(){var _this=this;var event=new CustomEvent('showCookieNotice',{detail:{data:cnArgs}});document.dispatchEvent(event);this.noticeContainer.classList.remove('cookie-notice-hidden');this.noticeContainer.classList.add('cn-animated');this.noticeContainer.classList.add('cookie-notice-visible');this.noticeContainer.addEventListener('animationend',function handler(){_this.noticeContainer.removeEventListener('animationend',handler);_this.noticeContainer.classList.remove('cn-animated')});this.noticeContainer.addEventListener('webkitAnimationEnd',function handler(){_this.noticeContainer.removeEventListener('webkitAnimationEnd',handler);_this.noticeContainer.classList.remove('cn-animated')})};this.hideCookieNotice=function(){var _this=this;var event=new CustomEvent('hideCookieNotice',{detail:{data:cnArgs}});document.dispatchEvent(event);this.noticeContainer.classList.add('cn-animated');this.noticeContainer.classList.remove('cookie-notice-visible');this.noticeContainer.addEventListener('animationend',function handler(){_this.noticeContainer.removeEventListener('animationend',handler);_this.noticeContainer.classList.remove('cn-animated');_this.noticeContainer.classList.add('cookie-notice-hidden')});this.noticeContainer.addEventListener('webkitAnimationEnd',function handler(){_this.noticeContainer.removeEventListener('webkitAnimationEnd',handler);_this.noticeContainer.classList.remove('cn-animated');_this.noticeContainer.classList.add('cookie-notice-hidden')})};this.showRevokeNotice=function(){var _this=this;var event=new CustomEvent('showRevokeNotice',{detail:{data:cnArgs}});document.dispatchEvent(event);this.noticeContainer.classList.remove('cookie-revoke-hidden');this.noticeContainer.classList.add('cn-animated');this.noticeContainer.classList.add('cookie-revoke-visible');this.noticeContainer.addEventListener('animationend',function handler(){_this.noticeContainer.removeEventListener('animationend',handler);_this.noticeContainer.classList.remove('cn-animated')});this.noticeContainer.addEventListener('webkitAnimationEnd',function handler(){_this.noticeContainer.removeEventListener('webkitAnimationEnd',handler);_this.noticeContainer.classList.remove('cn-animated')})};this.hideRevokeNotice=function(){var _this=this;var event=new CustomEvent('hideRevokeNotice',{detail:{data:cnArgs}});document.dispatchEvent(event);this.noticeContainer.classList.add('cn-animated');this.noticeContainer.classList.remove('cookie-revoke-visible');this.noticeContainer.addEventListener('animationend',function handler(){_this.noticeContainer.removeEventListener('animationend',handler);_this.noticeContainer.classList.remove('cn-animated');_this.noticeContainer.classList.add('cookie-revoke-hidden')});this.noticeContainer.addEventListener('webkitAnimationEnd',function handler(){_this.noticeContainer.removeEventListener('webkitAnimationEnd',handler);_this.noticeContainer.classList.remove('cn-animated');_this.noticeContainer.classList.add('cookie-revoke-hidden')})};
16this.setBodyClass=function(classes){document.body.classList.remove('cookies-revoke');document.body.classList.remove('cookies-accepted');document.body.classList.remove('cookies-refused');document.body.classList.remove('cookies-set');document.body.classList.remove('cookies-not-set');for(var i=0;i<classes.length;i++){document.body.classList.add(classes[i])}};this.handleScroll=function(){var scrollTop=window.pageYOffset||(document.documentElement||document.body.parentNode||document.body).scrollTop
17if(scrollTop>parseInt(cnArgs.onScrollOffset))
18this.setStatus('accept')};this.getClosest=function(elem,selector){if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(s){var matches=(this.document||this.ownerDocument).querySelectorAll(s),i=matches.length;while(--i>=0&&matches.item(i)!==this){}
19return i>-1}}
20for(;elem&&elem!==document;elem=elem.parentNode){if(elem.matches(selector))
21return elem}
22return null};this.inIframe=function(){try{return window.self!==window.top}catch(e){return!0}}
23this.init=function(){var _this=this;if(this.inIframe()===!0)
24return;this.cookiesAccepted=this.getStatus(!0);this.noticeContainer=document.getElementById('cookie-notice');if(!this.noticeContainer)
25return;var cookieButtons=document.getElementsByClassName('cn-set-cookie'),revokeButtons=document.getElementsByClassName('cn-revoke-cookie'),closeIcon=document.getElementById('cn-close-notice');this.noticeContainer.classList.add('cn-effect-'+cnArgs.hideEffect);if(this.cookiesAccepted===null){if(cnArgs.onScroll)
26window.addEventListener('scroll',function(e){_this.handleScroll()});if(cnArgs.onClick)
27window.addEventListener('click',function(e){var outerContainer=_this.getClosest(e.target,'#cookie-notice');if(outerContainer===null)
28_this.setStatus('accept')},!0);this.setBodyClass(['cookies-not-set']);this.showCookieNotice()}else{this.setBodyClass(['cookies-set',this.cookiesAccepted===!0?'cookies-accepted':'cookies-refused']);if(cnArgs.revokeCookies&&cnArgs.revokeCookiesOpt==='automatic')
29this.showRevokeNotice()}
30for(var i=0;i<cookieButtons.length;i++){cookieButtons[i].addEventListener('click',function(e){e.preventDefault();e.stopPropagation();_this.setStatus(this.dataset.cookieSet)})}
31if(closeIcon!==null){closeIcon.addEventListener('click',function(e){e.preventDefault();e.stopPropagation();_this.setStatus('reject')})}
32for(var i=0;i<revokeButtons.length;i++){revokeButtons[i].addEventListener('click',function(e){e.preventDefault();if(_this.noticeContainer.classList.contains('cookie-revoke-visible')){_this.hideRevokeNotice();_this.noticeContainer.addEventListener('animationend',function handler(){_this.noticeContainer.removeEventListener('animationend',handler);_this.showCookieNotice()});_this.noticeContainer.addEventListener('webkitAnimationEnd',function handler(){_this.noticeContainer.removeEventListener('webkitAnimationEnd',handler);_this.showCookieNotice()})}else if(_this.noticeContainer.classList.contains('cookie-notice-hidden')&&_this.noticeContainer.classList.contains('cookie-revoke-hidden'))
33_this.showCookieNotice()})}}}
34window.addEventListener('load',function(){cookieNotice.init()},!1)})(window,document,undefined)

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.