diff --git a/assets/css/cookieconsent.min.css b/assets/css/cookieconsent.min.css deleted file mode 100644 index d4d4390..0000000 --- a/assets/css/cookieconsent.min.css +++ /dev/null @@ -1,6 +0,0 @@ -.cc-window{opacity:1;-webkit-transition:opacity 1s ease;transition:opacity 1s ease}.cc-window.cc-invisible{opacity:0}.cc-animate.cc-revoke{-webkit-transition:transform 1s ease;-webkit-transition:-webkit-transform 1s ease;transition:-webkit-transform 1s ease;transition:transform 1s ease;transition:transform 1s ease,-webkit-transform 1s ease}.cc-animate.cc-revoke.cc-top{-webkit-transform:translateY(-2em);transform:translateY(-2em)}.cc-animate.cc-revoke.cc-bottom{-webkit-transform:translateY(2em);transform:translateY(2em)}.cc-animate.cc-revoke.cc-active.cc-top{-webkit-transform:translateY(0);transform:translateY(0)}.cc-animate.cc-revoke.cc-active.cc-bottom{-webkit-transform:translateY(0);transform:translateY(0)}.cc-revoke:hover{-webkit-transform:translateY(0);transform:translateY(0)}.cc-grower{max-height:0;overflow:hidden;-webkit-transition:max-height 1s;transition:max-height 1s} -.cc-revoke,.cc-window{position:fixed;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:Helvetica,Calibri,Arial,sans-serif;font-size:16px;line-height:1.5em;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;z-index:9999}.cc-window.cc-static{position:static}.cc-window.cc-floating{padding:2em;max-width:24em;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner{padding:1em 1.8em;width:100%;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.cc-revoke{padding:.5em}.cc-revoke:hover{text-decoration:underline}.cc-header{font-size:18px;font-weight:700}.cc-btn,.cc-close,.cc-link,.cc-revoke{cursor:pointer}.cc-link{opacity:.8;display:inline-block;padding:.2em;text-decoration:underline}.cc-link:hover{opacity:1}.cc-link:active,.cc-link:visited{color:initial}.cc-btn{display:block;padding:.4em .8em;font-size:.9em;font-weight:700;border-width:2px;border-style:solid;text-align:center;white-space:nowrap}.cc-highlight .cc-btn:first-child{background-color:transparent;border-color:transparent}.cc-highlight .cc-btn:first-child:focus,.cc-highlight .cc-btn:first-child:hover{background-color:transparent;text-decoration:underline}.cc-close{display:block;position:absolute;top:.5em;right:.5em;font-size:1.6em;opacity:.9;line-height:.75}.cc-close:focus,.cc-close:hover{opacity:1} -.cc-revoke.cc-top{top:0;left:3em;border-bottom-left-radius:.5em;border-bottom-right-radius:.5em}.cc-revoke.cc-bottom{bottom:0;left:3em;border-top-left-radius:.5em;border-top-right-radius:.5em}.cc-revoke.cc-left{left:3em;right:unset}.cc-revoke.cc-right{right:3em;left:unset}.cc-top{top:1em}.cc-left{left:1em}.cc-right{right:1em}.cc-bottom{bottom:1em}.cc-floating>.cc-link{margin-bottom:1em}.cc-floating .cc-message{display:block;margin-bottom:1em}.cc-window.cc-floating .cc-compliance{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto}.cc-window.cc-banner{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.cc-banner.cc-top{left:0;right:0;top:0}.cc-banner.cc-bottom{left:0;right:0;bottom:0}.cc-banner .cc-message{display:block;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;max-width:100%;margin-right:1em}.cc-compliance{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:justify;align-content:space-between}.cc-floating .cc-compliance>.cc-btn{-webkit-box-flex:1;-ms-flex:1;flex:1}.cc-btn+.cc-btn{margin-left:.5em} -@media print{.cc-revoke,.cc-window{display:none}}@media screen and (max-width:900px){.cc-btn{white-space:normal}}@media screen and (max-width:414px) and (orientation:portrait),screen and (max-width:736px) and (orientation:landscape){.cc-window.cc-top{top:0}.cc-window.cc-bottom{bottom:0}.cc-window.cc-banner,.cc-window.cc-floating,.cc-window.cc-left,.cc-window.cc-right{left:0;right:0}.cc-window.cc-banner{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner .cc-compliance{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto}.cc-window.cc-floating{max-width:none}.cc-window .cc-message{margin-bottom:1em}.cc-window.cc-banner{-webkit-box-align:unset;-ms-flex-align:unset;align-items:unset}.cc-window.cc-banner .cc-message{margin-right:0}} -.cc-floating.cc-theme-classic{padding:1.2em;border-radius:5px}.cc-floating.cc-type-info.cc-theme-classic .cc-compliance{text-align:center;display:inline;-webkit-box-flex:0;-ms-flex:none;flex:none}.cc-theme-classic .cc-btn{border-radius:5px}.cc-theme-classic .cc-btn:last-child{min-width:140px}.cc-floating.cc-type-info.cc-theme-classic .cc-btn{display:inline-block} -.cc-theme-edgeless.cc-window{padding:0}.cc-floating.cc-theme-edgeless .cc-message{margin:2em;margin-bottom:1.5em}.cc-banner.cc-theme-edgeless .cc-btn{margin:0;padding:.8em 1.8em;height:100%}.cc-banner.cc-theme-edgeless .cc-message{margin-left:1em}.cc-floating.cc-theme-edgeless .cc-btn+.cc-btn{margin-left:0} \ No newline at end of file diff --git a/assets/js/cookieconsent.min.js b/assets/js/cookieconsent.min.js deleted file mode 100644 index 1e3dccf..0000000 --- a/assets/js/cookieconsent.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){if(!e.hasInitialised){var t={escapeRegExp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},hasClass:function(e,t){var i=" ";return 1===e.nodeType&&(i+e.className+i).replace(/[\n\t]/g,i).indexOf(i+t+i)>=0},addClass:function(e,t){e.className+=" "+t},removeClass:function(e,t){var i=new RegExp("\\b"+this.escapeRegExp(t)+"\\b");e.className=e.className.replace(i,"")},interpolateString:function(e,t){return e.replace(/{{([a-z][a-z0-9\-_]*)}}/gi,function(e){return t(arguments[1])||""})},getCookie:function(e){var t=("; "+document.cookie).split("; "+e+"=");return t.length<2?void 0:t.pop().split(";").shift()},setCookie:function(e,t,i,n,o,s){var r=new Date;r.setHours(r.getHours()+24*(i||365));var a=[e+"="+t,"expires="+r.toUTCString(),"path="+(o||"/")];n&&a.push("domain="+n),s&&a.push("secure"),document.cookie=a.join(";")},deepExtend:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(i in e&&this.isPlainObject(e[i])&&this.isPlainObject(t[i])?this.deepExtend(e[i],t[i]):e[i]=t[i]);return e},throttle:function(e,t){var i=!1;return function(){i||(e.apply(this,arguments),i=!0,setTimeout(function(){i=!1},t))}},hash:function(e){var t,i,n=0;if(0===e.length)return n;for(t=0,i=e.length;t=128?"#000":"#fff"},getLuminance:function(e){var t=parseInt(this.normaliseHex(e),16),i=38+(t>>16),n=38+(t>>8&255),o=38+(255&t);return"#"+(16777216+65536*(i<255?i<1?0:i:255)+256*(n<255?n<1?0:n:255)+(o<255?o<1?0:o:255)).toString(16).slice(1)},isMobile:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},isPlainObject:function(e){return"object"==typeof e&&null!==e&&e.constructor==Object},traverseDOMPath:function(e,i){return e&&e.parentNode?t.hasClass(e,i)?e:this.traverseDOMPath(e.parentNode,i):null}};e.status={deny:"deny",allow:"allow",dismiss:"dismiss"},e.transitionEnd=function(){var e=document.createElement("div"),t={t:"transitionend",OT:"oTransitionEnd",msT:"MSTransitionEnd",MozT:"transitionend",WebkitT:"webkitTransitionEnd"};for(var i in t)if(t.hasOwnProperty(i)&&void 0!==e.style[i+"ransition"])return t[i];return""}(),e.hasTransition=!!e.transitionEnd;var i=Object.keys(e.status).map(t.escapeRegExp);e.customStyles={},e.Popup=function(){var n={enabled:!0,container:null,cookie:{name:"cookieconsent_status",path:"/",domain:"",expiryDays:365,secure:!1},onPopupOpen:function(){},onPopupClose:function(){},onInitialise:function(e){},onStatusChange:function(e,t){},onRevokeChoice:function(){},onNoCookieLaw:function(e,t){},content:{header:"Cookies used on the website!",message:"This website uses cookies to ensure you get the best experience on our website.",dismiss:"Got it!",allow:"Allow cookies",deny:"Decline",link:"Learn more",href:"https://www.cookiesandyou.com",close:"❌",target:"_blank",policy:"Cookie Policy"},elements:{header:'{{header}} ',message:'{{message}}',messagelink:'{{message}} {{link}}',dismiss:'{{dismiss}}',allow:'{{allow}}',deny:'{{deny}}',link:'{{link}}',close:'{{close}}'},window:'',revokeBtn:'
{{policy}}
',compliance:{info:'
{{dismiss}}
',"opt-in":'
{{deny}}{{allow}}
',"opt-out":'
{{deny}}{{allow}}
'},type:"info",layouts:{basic:"{{messagelink}}{{compliance}}","basic-close":"{{messagelink}}{{compliance}}{{close}}","basic-header":"{{header}}{{message}}{{link}}{{compliance}}"},layout:"basic",position:"bottom",theme:"block",static:!1,palette:null,revokable:!1,animateRevokable:!0,showLink:!0,dismissOnScroll:!1,dismissOnTimeout:!1,dismissOnWindowClick:!1,ignoreClicksFrom:["cc-revoke","cc-btn"],autoOpen:!0,autoAttach:!0,whitelistPage:[],blacklistPage:[],overrideHTML:null};function o(){this.initialise.apply(this,arguments)}function s(e){this.openingTimeout=null,t.removeClass(e,"cc-invisible")}function r(t){t.style.display="none",t.removeEventListener(e.transitionEnd,this.afterTransition),this.afterTransition=null}function a(){var e=this.options.position.split("-"),t=[];return e.forEach(function(e){t.push("cc-"+e)}),t}function c(n){var o=this.options,s=document.createElement("div"),r=o.container&&1===o.container.nodeType?o.container:document.body;s.innerHTML=n;var a=s.children[0];return a.style.display="none",t.hasClass(a,"cc-window")&&e.hasTransition&&t.addClass(a,"cc-invisible"),this.onButtonClick=function(n){var o=t.traverseDOMPath(n.target,"cc-btn")||n.target;if(t.hasClass(o,"cc-btn")){var s=o.className.match(new RegExp("\\bcc-("+i.join("|")+")\\b")),r=s&&s[1]||!1;r&&(this.setStatus(r),this.close(!0))}t.hasClass(o,"cc-close")&&(this.setStatus(e.status.dismiss),this.close(!0));t.hasClass(o,"cc-revoke")&&this.revokeChoice()}.bind(this),a.addEventListener("click",this.onButtonClick),o.autoAttach&&(r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a)),a}function l(e){return"000000"==(e=t.normaliseHex(e))?"#222":t.getLuminance(e)}function u(e,t){for(var i=0,n=e.length;i=0;o&&t(n);return o}.call(this)&&(this.options.enabled=!1),u(this.options.blacklistPage,location.pathname)&&(this.options.enabled=!1),u(this.options.whitelistPage,location.pathname)&&(this.options.enabled=!0);var o=this.options.window.replace("{{classes}}",function(){var i=this.options,n="top"==i.position||"bottom"==i.position?"banner":"floating";t.isMobile()&&(n="floating");var o=["cc-"+n,"cc-type-"+i.type,"cc-theme-"+i.theme];i.static&&o.push("cc-static");o.push.apply(o,a.call(this));(function(i){var n=t.hash(JSON.stringify(i)),o="cc-color-override-"+n,s=t.isPlainObject(i);this.customStyleSelector=s?o:null,s&&function(i,n,o){if(e.customStyles[i])return void++e.customStyles[i].references;var s={},r=n.popup,a=n.button,c=n.highlight;r&&(r.text=r.text?r.text:t.getContrast(r.background),r.link=r.link?r.link:r.text,s[o+".cc-window"]=["color: "+r.text,"background-color: "+r.background],s[o+".cc-revoke"]=["color: "+r.text,"background-color: "+r.background],s[o+" .cc-link,"+o+" .cc-link:active,"+o+" .cc-link:visited"]=["color: "+r.link],a&&(a.text=a.text?a.text:t.getContrast(a.background),a.border=a.border?a.border:"transparent",s[o+" .cc-btn"]=["color: "+a.text,"border-color: "+a.border,"background-color: "+a.background],a.padding&&s[o+" .cc-btn"].push("padding: "+a.padding),"transparent"!=a.background&&(s[o+" .cc-btn:hover, "+o+" .cc-btn:focus"]=["background-color: "+(a.hover||l(a.background))]),c?(c.text=c.text?c.text:t.getContrast(c.background),c.border=c.border?c.border:"transparent",s[o+" .cc-highlight .cc-btn:first-child"]=["color: "+c.text,"border-color: "+c.border,"background-color: "+c.background]):s[o+" .cc-highlight .cc-btn:first-child"]=["color: "+r.text]));var u=document.createElement("style");document.head.appendChild(u),e.customStyles[i]={references:1,element:u.sheet};var h=-1;for(var p in s)s.hasOwnProperty(p)&&u.sheet.insertRule(p+"{"+s[p].join(";")+"}",++h)}(n,i,"."+o);return s}).call(this,this.options.palette);this.customStyleSelector&&o.push(this.customStyleSelector);return o}.call(this).join(" ")).replace("{{children}}",function(){var e={},i=this.options;i.showLink||(i.elements.link="",i.elements.messagelink=i.elements.message);Object.keys(i.elements).forEach(function(n){e[n]=t.interpolateString(i.elements[n],function(e){var t=i.content[e];return e&&"string"==typeof t&&t.length?t:""})});var n=i.compliance[i.type];n||(n=i.compliance.info);e.compliance=t.interpolateString(n,function(t){return e[t]});var o=i.layouts[i.layout];o||(o=i.layouts.basic);return t.interpolateString(o,function(t){return e[t]})}.call(this)),s=this.options.overrideHTML;if("string"==typeof s&&s.length&&(o=s),this.options.static){var r=c.call(this,'
'+o+"
");r.style.display="",this.element=r.firstChild,this.element.style.display="none",t.addClass(this.element,"cc-invisible")}else this.element=c.call(this,o);(function(){var i=this.setStatus.bind(this),n=this.close.bind(this),o=this.options.dismissOnTimeout;"number"==typeof o&&o>=0&&(this.dismissTimeout=window.setTimeout(function(){i(e.status.dismiss),n(!0)},Math.floor(o)));var s=this.options.dismissOnScroll;if("number"==typeof s&&s>=0){var r=function(t){window.pageYOffset>Math.floor(s)&&(i(e.status.dismiss),n(!0),window.removeEventListener("scroll",r),this.onWindowScroll=null)};this.options.enabled&&(this.onWindowScroll=r,window.addEventListener("scroll",r))}var a=this.options.dismissOnWindowClick,c=this.options.ignoreClicksFrom;if(a){var l=function(o){for(var s=!1,r=o.path.length,a=c.length,u=0;uo&&(i=!0),i?t.hasClass(n,"cc-active")||t.addClass(n,"cc-active"):t.hasClass(n,"cc-active")&&t.removeClass(n,"cc-active")},200);this.onMouseMove=o,window.addEventListener("mousemove",o)}}}.call(this),this.options.autoOpen&&this.autoOpen()},o.prototype.destroy=function(){this.onButtonClick&&this.element&&(this.element.removeEventListener("click",this.onButtonClick),this.onButtonClick=null),this.dismissTimeout&&(clearTimeout(this.dismissTimeout),this.dismissTimeout=null),this.onWindowScroll&&(window.removeEventListener("scroll",this.onWindowScroll),this.onWindowScroll=null),this.onWindowClick&&(window.removeEventListener("click",this.onWindowClick),this.onWindowClick=null),this.onMouseMove&&(window.removeEventListener("mousemove",this.onMouseMove),this.onMouseMove=null),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.revokeBtn&&this.revokeBtn.parentNode&&this.revokeBtn.parentNode.removeChild(this.revokeBtn),this.revokeBtn=null,function(i){if(t.isPlainObject(i)){var n=t.hash(JSON.stringify(i)),o=e.customStyles[n];if(o&&!--o.references){var s=o.element.ownerNode;s&&s.parentNode&&s.parentNode.removeChild(s),e.customStyles[n]=null}}}(this.options.palette),this.options=null},o.prototype.open=function(t){if(this.element)return this.isOpen()||(e.hasTransition?this.fadeIn():this.element.style.display="",this.options.revokable&&this.toggleRevokeButton(),this.options.onPopupOpen.call(this)),this},o.prototype.close=function(t){if(this.element)return this.isOpen()&&(e.hasTransition?this.fadeOut():this.element.style.display="none",t&&this.options.revokable&&this.toggleRevokeButton(!0),this.options.onPopupClose.call(this)),this},o.prototype.fadeIn=function(){var i=this.element;if(e.hasTransition&&i&&(this.afterTransition&&r.call(this,i),t.hasClass(i,"cc-invisible"))){if(i.style.display="",this.options.static){var n=this.element.clientHeight;this.element.parentNode.style.maxHeight=n+"px"}this.openingTimeout=setTimeout(s.bind(this,i),20)}},o.prototype.fadeOut=function(){var i=this.element;e.hasTransition&&i&&(this.openingTimeout&&(clearTimeout(this.openingTimeout),s.bind(this,i)),t.hasClass(i,"cc-invisible")||(this.options.static&&(this.element.parentNode.style.maxHeight=""),this.afterTransition=r.bind(this,i),i.addEventListener(e.transitionEnd,this.afterTransition),t.addClass(i,"cc-invisible")))},o.prototype.isOpen=function(){return this.element&&""==this.element.style.display&&(!e.hasTransition||!t.hasClass(this.element,"cc-invisible"))},o.prototype.toggleRevokeButton=function(e){this.revokeBtn&&(this.revokeBtn.style.display=e?"":"none")},o.prototype.revokeChoice=function(e){this.options.enabled=!0,this.clearStatus(),this.options.onRevokeChoice.call(this),e||this.autoOpen()},o.prototype.hasAnswered=function(t){return Object.keys(e.status).indexOf(this.getStatus())>=0},o.prototype.hasConsented=function(t){var i=this.getStatus();return i==e.status.allow||i==e.status.dismiss},o.prototype.autoOpen=function(e){!this.hasAnswered()&&this.options.enabled?this.open():this.hasAnswered()&&this.options.revokable&&this.toggleRevokeButton(!0)},o.prototype.setStatus=function(i){var n=this.options.cookie,o=t.getCookie(n.name),s=Object.keys(e.status).indexOf(o)>=0;Object.keys(e.status).indexOf(i)>=0?(t.setCookie(n.name,i,n.expiryDays,n.domain,n.path,n.secure),this.options.onStatusChange.call(this,i,s)):this.clearStatus()},o.prototype.getStatus=function(){return t.getCookie(this.options.cookie.name)},o.prototype.clearStatus=function(){var e=this.options.cookie;t.setCookie(e.name,"",-1,e.domain,e.path)},o}(),e.Location=function(){var e={timeout:5e3,services:["ipinfo"],serviceDefinitions:{ipinfo:function(){return{url:"//ipinfo.io",headers:["Accept: application/json"],callback:function(e,t){try{var i=JSON.parse(t);return i.error?s(i):{code:i.country}}catch(e){return s({error:"Invalid response ("+e+")"})}}}},ipinfodb:function(e){return{url:"//api.ipinfodb.com/v3/ip-country/?key={api_key}&format=json&callback={callback}",isScript:!0,callback:function(e,t){try{var i=JSON.parse(t);return"ERROR"==i.statusCode?s({error:i.statusMessage}):{code:i.countryCode}}catch(e){return s({error:"Invalid response ("+e+")"})}}}},maxmind:function(){return{url:"//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js",isScript:!0,callback:function(e){window.geoip2?geoip2.country(function(t){try{e({code:t.country.iso_code})}catch(t){e(s(t))}},function(t){e(s(t))}):e(new Error("Unexpected response format. The downloaded script should have exported `geoip2` to the global scope"))}}}}};function i(i){t.deepExtend(this.options={},e),t.isPlainObject(i)&&t.deepExtend(this.options,i),this.currentServiceIndex=-1}function n(e,t,i){var n,o=document.createElement("script");o.type="text/"+(e.type||"javascript"),o.src=e.src||e,o.async=!1,o.onreadystatechange=o.onload=function(){var e=o.readyState;clearTimeout(n),t.done||e&&!/loaded|complete/.test(e)||(t.done=!0,t(),o.onreadystatechange=o.onload=null)},document.body.appendChild(o),n=setTimeout(function(){t.done=!0,t(),o.onreadystatechange=o.onload=null},i)}function o(e,t,i,n,o){var s=new(window.XMLHttpRequest||window.ActiveXObject)("MSXML2.XMLHTTP.3.0");if(s.open(n?"POST":"GET",e,1),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),Array.isArray(o))for(var r=0,a=o.length;r3&&t(s)}),s.send(n)}function s(e){return new Error("Error ["+(e.code||"UNKNOWN")+"]: "+e.error)}return i.prototype.getNextService=function(){var e;do{e=this.getServiceByIdx(++this.currentServiceIndex)}while(this.currentServiceIndex=0,revokable:t.revokable.indexOf(e)>=0,explicitAction:t.explicitAction.indexOf(e)>=0}},i.prototype.applyLaw=function(e,t){var i=this.get(t);return i.hasLaw||(e.enabled=!1,"function"==typeof e.onNoCookieLaw&&e.onNoCookieLaw(t,i)),this.options.regionalLaw&&(i.revokable&&(e.revokable=!0),i.explicitAction&&(e.dismissOnScroll=!1,e.dismissOnTimeout=!1)),e},i}(),e.initialise=function(i,n,o){var s=new e.Law(i.law);n||(n=function(){}),o||(o=function(){});var r=Object.keys(e.status),a=t.getCookie("cookieconsent_status");r.indexOf(a)>=0?n(new e.Popup(i)):e.getCountryCode(i,function(t){delete i.law,delete i.location,t.code&&(i=s.applyLaw(i,t.code)),n(new e.Popup(i))},function(t){delete i.law,delete i.location,o(t,new e.Popup(i))})},e.getCountryCode=function(t,i,n){t.law&&t.law.countryCode?i({code:t.law.countryCode}):t.location?new e.Location(t.location).locate(function(e){i(e||{})},n):i({})},e.utils=t,e.hasInitialised=!0,window.cookieconsent=e}}(window.cookieconsent||{}); \ No newline at end of file diff --git a/assets/js/haven.umd.min.js b/assets/js/haven.umd.min.js new file mode 100644 index 0000000..d7e302e --- /dev/null +++ b/assets/js/haven.umd.min.js @@ -0,0 +1,12 @@ +/*! + * @chiiya/haven v0.5.11 + * (c) Elisha Witte + * Released under the MIT License. + */ +/*! + * @chiiya/haven v0.5.11 + * (c) Elisha Witte + * Released under the MIT License. + */ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).haven={})}(this,(function(e){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function t(e,n){for(var o=0;oe.length)&&(n=e.length);for(var o=0,t=new Array(n);o=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var t,i,a=!0,r=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return a=e.done,e},e:function(e){r=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(r)throw i}}}}function d(e){return e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)}var v=function(){function e(){o(this,e)}return i(e,null,[{key:"set",value:function(e,n,o){var t=this.resolveOptions(o),i=encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),a=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),r=this.encodeAttributes(t);document.cookie="".concat(a,"=").concat(i).concat(r)}},{key:"get",value:function(e){var n,o=f(document.cookie?document.cookie.split("; "):[]);try{for(o.s();!(n=o.n()).done;){var t=n.value.split("=");if(e===d(t[0])){var i=t.slice(1).join("=");return'"'===i.charAt(0)&&(i=i.slice(1,-1)),i=d(i)}}}catch(e){o.e(e)}finally{o.f()}}},{key:"getAll",value:function(){var e,n={},o=f(document.cookie?document.cookie.split("; "):[]);try{for(o.s();!(e=o.n()).done;){var t=e.value.split("="),i=d(t[0]),a=t.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1)),a=d(a),n[i]=a}}catch(e){o.e(e)}finally{o.f()}return n}},{key:"remove",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.resolveOptions(Object.assign(n,{expires:-1}));if(e instanceof RegExp)return this.removeByRegex(e,o);var t=this.encodeAttributes(o);document.cookie="".concat(e,"=''").concat(t),this.set(e,"",o)}},{key:"removeByRegex",value:function(e,n){var o=this;Object.keys(this.getAll()).map((function(t){if(e.test(t)){var i=o.encodeAttributes(n);document.cookie="".concat(t,"=''").concat(i),o.set(t,"",n)}}))}},{key:"encodeAttributes",value:function(e){for(var n="",o=0,t=Object.keys(e);o1&&void 0!==arguments[1]?arguments[1]:"opt-in",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o(this,e),this.prefix=n,this.type=t,this.attributes=i}return i(e,[{key:"enableFunctionalCookie",value:function(){e.setCookie("".concat(this.prefix,"-functional"),"true",this.attributes),p.emit("functional-enabled")}},{key:"hasFunctionalCookie",value:function(){return e.cookieExists("".concat(this.prefix,"-functional"))}},{key:"enableCookies",value:function(n){e.setCookie("".concat(this.prefix,"-").concat(n),"true",this.attributes),p.emit("".concat(n,"-enabled"))}},{key:"disableCookies",value:function(n){e.setCookie("".concat(this.prefix,"-").concat(n),"false",this.attributes),p.emit("".concat(n,"-disabled"))}},{key:"hasAllCookiesSet",value:function(){var n,o=f(g());try{for(o.s();!(n=o.n()).done;){var t=n.value;if(!e.cookieExists("".concat(this.prefix,"-").concat(t)))return!1}}catch(e){o.e(e)}finally{o.f()}return!0}},{key:"hasCookiesEnabled",value:function(n){var o=e.getCookie("".concat(this.prefix,"-").concat(n));return"opt-in"===this.type?"true"===o:void 0===o||"true"===o}},{key:"hasAllNecessaryCookiesEnabled",value:function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=f(n);try{for(o.s();!(e=o.n()).done;){var t=e.value;if(!this.hasCookiesEnabled(t))return!1}}catch(e){o.e(e)}finally{o.f()}return!0}},{key:"enableAllCookies",value:function(){var e=this;["functional"].concat(s(g())).map((function(n){return e.enableCookies(n)}))}},{key:"disableAllCookies",value:function(){var e=this;g().map((function(n){return e.disableCookies(n)}))}}],[{key:"getCookie",value:function(e){return v.get(e)}},{key:"setCookie",value:function(e,n,o){v.set(e,n,o)}},{key:"removeCookie",value:function(e,n){v.remove(e,n)}},{key:"cookieExists",value:function(e){return void 0!==v.get(e)&&""!==v.get(e)}}]),e}(),C=function(){function e(){o(this,e)}return i(e,null,[{key:"resolve",value:function(e){e.domains&&Array.isArray(e.domains)&&(e.domains=this.normalizeDomains(e.domains)),this.resolveBaseConfiguration(e),h.notification=m(h.notification,e.notification),h.translations=m(h.translations,e.translations)}},{key:"resolveBaseConfiguration",value:function(e){for(var n=0,o=["prefix","cookies","type","services","purposes"];n0?i:this.getDomains(),h.lang=this.detectLanguage(e),void 0!==e.cookieAttributes&&(h.cookieAttributes=Object.assign(h.cookieAttributes,e.cookieAttributes))}},{key:"detectLanguage",value:function(e){var n=(e.lang||document.documentElement.lang||"en").toLowerCase(),o=/^(\w{2})-(\w{2})$/.exec(n);return null===o?n:o[1]}},{key:"getDomains",value:function(){var e=[],n=window.location.hostname,o=n.match(/(?:[A-Za-z0-9-]+\.)*([A-Za-z0-9-]+\.co.uk|\.com.br|\.co.jp|\.com.au)\b/);null!==o&&e.push(o[1]);var t=n.match(/(?:[A-Za-z0-9-]+\.)*([A-Za-z0-9-]+\.(?:[A-za-z]{2}|[A-Za-z]{3,}))\b/);return null!==t&&e.push(t[1]),e.push(n),this.normalizeDomains(e)}},{key:"normalizeDomains",value:function(e){return e.map((function(e){return e.startsWith(".")?e:".".concat(e)}))}}]),e}(),x=["-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto","Oxygen","Ubuntu","Cantarell",'"Fira Sans"','"Droid Sans"','"Helvetica Neue"',"Arial",'"Noto Sans"',"sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],A=function(){function e(){o(this,e)}return i(e,null,[{key:"create",value:function(){var e,n=document.createElement("style");n.type="text/css",n.appendChild(document.createTextNode((e=h.notification.styles,"\n .hv-notification {\n align-items: center;\n background: ".concat(e.background,";\n box-sizing: border-box;\n color: ").concat(e.textColor,";\n display: flex;\n font-family: ").concat(x.join(", "),";\n font-size: 16px;\n justify-content: space-between;\n left: 0;\n line-height: 1.5;\n opacity: 1;\n overflow: hidden;\n padding: 16px 32px;\n position: fixed;\n right: 0;\n transition: opacity 1s ease;\n width: 100%;\n z-index: 9999;\n }\n\n .hv-notification--hidden {\n opacity: 0;\n }\n\n .hv-notification--top {\n top: 0;\n }\n\n .hv-notification--bottom {\n bottom: 0;\n }\n\n .hv-notification__message {\n margin: 0 16px 0 0;\n }\n\n .hv-notification__message a {\n color: ").concat(e.linkColor,";\n text-decoration: underline;\n }\n\n .hv-notification__message a:hover {\n color: ").concat(e.textColor,";\n }\n\n .hv-notification-button {\n align-items: center;\n border: 0;\n cursor: pointer;\n display: inline-flex;\n font-size: 14px;\n font-weight: 500;\n justify-content: center;\n outline: 0;\n padding: 8px 32px;\n transition: background-color 0.2s ease, color 0.2s ease;\n }\n\n .hv-notification__decline {\n background: transparent;\n color: ").concat(e.textColor,";\n }\n\n .hv-notification__decline:hover {\n text-decoration: underline;\n }\n\n .hv-notification__accept {\n background: ").concat(e.buttonBackgroundColor,";\n color: ").concat(e.buttonTextColor,";\n }\n\n .hv-notification__accept:hover {\n background: ").concat(e.buttonBackgroundColorHover,";\n }\n ")))),document.head.appendChild(n);var o=document.createElement("div");o.innerHTML=function(){var e=h.notification;return'\n \n ")}(),document.body.appendChild(o)}}]),e}(),j=!0,S=!1,_=function(){function e(){o(this,e),this.cookieNotification=null,this.cookiesAccept=null,this.cookiesDecline=null,this.cookieManager=new w(h.prefix,h.type,h.cookieAttributes)}return i(e,[{key:"init",value:function(){var e=this;this.cookieNotification=document.getElementById("cookie-notification"),null===this.cookieNotification&&(A.create(),this.cookieNotification=document.getElementById("cookie-notification")),this.cookiesAccept=document.getElementById("cookie-notification__accept"),this.cookiesDecline=document.getElementById("cookie-notification__decline"),null===this.cookieNotification||this.cookieManager.hasAllCookiesSet()||this.showCookieNotification(),null!==this.cookiesAccept&&this.cookiesAccept.addEventListener("click",(function(n){n.preventDefault(),e.cookieManager.enableAllCookies(),e.hideCookieNotification(),e.togglePreferences(j)})),null!==this.cookiesDecline&&this.cookiesDecline.addEventListener("click",(function(n){n.preventDefault(),e.cookieManager.disableAllCookies(),e.cookieManager.enableFunctionalCookie(),e.hideCookieNotification(),e.togglePreferences(S)}))}},{key:"showCookieNotification",value:function(){null!==this.cookieNotification&&(this.cookieNotification.style.display=this.cookieNotification.dataset.display||"block",this.cookieNotification.classList.remove("hv-notification--hidden"))}},{key:"hideCookieNotification",value:function(){null!==this.cookieNotification&&(this.cookieNotification.style.display="none")}},{key:"togglePreferences",value:function(e){var n,o=f(g());try{for(o.s();!(n=o.n()).done;){var t=n.value,i=document.getElementById("cookie-preferences--".concat(t));i&&(i.checked=e)}}catch(e){o.e(e)}finally{o.f()}}}]),e}(),E=["-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto","Oxygen","Ubuntu","Cantarell",'"Fira Sans"','"Droid Sans"','"Helvetica Neue"',"Arial",'"Noto Sans"',"sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],I=function(){function e(){o(this,e)}return i(e,null,[{key:"create",value:function(e){var n,o=document.createElement("style");o.type="text/css",o.appendChild(document.createTextNode((n=h.preferences.styles,"\n .hv-preference {\n align-items: center;\n box-sizing: border-box;\n display: flex;\n font-family: ".concat(E.join(", "),";\n font-size: 16px;\n justify-content: space-between;\n line-height: 1.5;\n width: 100%;\n }\n\n .hv-preference__purpose {\n font-size: 20px;\n margin: 0;\n }\n\n .hv-preference__description {\n margin-top: 10px;\n width: 100%;\n }\n\n .hv-toggle {\n display: none;\n }\n\n .hv-toggle:checked + label::before {\n background: ").concat(n.toggleBackground,";\n left: auto;\n right: 20px;\n transform: translateX(16px);\n }\n\n .hv-toggle:disabled + label {\n cursor: not-allowed;\n opacity: .5;\n }\n\n .hv-toggle-label {\n border: 1px solid ").concat(n.toggleBorder,";\n border-radius: 9999px;\n cursor: pointer;\n display: inline-block;\n height: 24px;\n margin: 0;\n position: relative;\n width: 48px;\n }\n\n .hv-toggle-label::before {\n background: ").concat(n.toggleBorder,';\n border-radius: 9999px;\n content: "";\n height: 16px;\n left: 4px;\n position: absolute;\n transition: transform .3s ease, background-color .3s ease;\n top: 3px;\n width: 16px;\n }\n ')))),document.head.appendChild(o);var t,i=document.createElement("div");i.innerHTML=(t=["functional"].concat(s(g())),"\n

".concat(k("preferences.description"),"

\n ").concat(t.map((function(e){return'\n
\n

'.concat(k("purposes.".concat(e,".name")),'

\n \n \n
\n

').concat(k("purposes.".concat(e,".description")),"

\n ")})).join(""),"\n ")),e.appendChild(i)}}]),e}(),O=function(){function e(){o(this,e),this.saveButton=null,this.cookieManager=new w(h.prefix,h.type,h.cookieAttributes)}return i(e,[{key:"init",value:function(){var e=document.getElementById("cookie-preferences");null!==e&&I.create(e),this.attachListeners()}},{key:"attachListeners",value:function(){var e,n=this,o=g(),t={},i=f(o);try{var a=function(){var o=e.value,i=document.getElementById("cookie-preferences--".concat(o));null!==i&&(t[o]=i,i.checked=n.cookieManager.hasCookiesEnabled(o),i.addEventListener("change",(function(){n.cookieManager.enableFunctionalCookie(),i.checked?n.cookieManager.enableCookies(o):n.cookieManager.disableCookies(o)})))};for(i.s();!(e=i.n()).done;)a()}catch(e){i.e(e)}finally{i.f()}var r=document.getElementById("cookie-preferences__save");null!==r&&r.addEventListener("click",(function(){n.cookieManager.enableFunctionalCookie();var e,i=f(o);try{for(i.s();!(e=i.n()).done;){var a=e.value;t[a].checked?n.cookieManager.enableCookies(a):n.cookieManager.disableCookies(a)}}catch(e){i.e(e)}finally{i.f()}var r=document.getElementById("cookie-notification");null!==r&&(r.style.display="none")}))}}]),e}(),N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.id?(b("https://connect.facebook.net/en_US/fbevents.js")||B(),window.fbq("init",e.id),window.fbq("track","PageView")):console.error("FACEBOOK_PIXEL: No ID specified. Please specify an ID using `options.id`.")},B=function(){if(!window.fbq){var e=window.fbq=function(){e.callMethod?e.callMethod.apply(e,arguments):e.queue.push(arguments)};window._fbq||(window._fbq=e),e.push=e,e.loaded=!0,e.version="2.0",e.queue=[];var n=document.createElement("script");n.async=!0,n.src="https://connect.facebook.net/en_US/fbevents.js";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(n,o)}},D=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.id?(b("https://www.google-analytics.com/analytics.js")||z(),void 0!==e.name?M(e):F(e)):console.error("GOOGLE_ANALYTICS: No ID specified. Please specify an ID using `options.id`.")},z=function(){window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=+new Date;var e=document.getElementsByTagName("script")[0],n=document.createElement("script");n.src="https://www.google-analytics.com/analytics.js",e.parentNode.insertBefore(n,e)},M=function(e){window.ga("create",e.id,"auto",e.name),!1!==e.anonymizeIp&&window.ga("".concat(e.name,".set"),"anonymizeIp",!0),window.ga("".concat(e.name,".send"),"pageview")},F=function(e){window.ga("create",e.id,"auto"),!1!==e.anonymizeIp&&window.ga("set","anonymizeIp",!0),window.ga("send","pageview")},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.id?b("https://www.googletagmanager.com/gtm.js?id=".concat(e.id))||L(e):console.error("GOOGLE_TAG_MANAGER: No ID specified. Please specify an ID using `options.id`.")},L=function(e){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"gtm.js","gtm.start":(new Date).getTime()});var n=document.getElementsByTagName("script")[0],o=document.createElement("script");o.src="https://www.googletagmanager.com/gtm.js?id=".concat(e.id),n.parentNode.insertBefore(o,n)},T=function(){function e(){o(this,e),this.injected={},this.cookieManager=new w(h.prefix,h.type,h.cookieAttributes)}return i(e,[{key:"injectServices",value:function(){var e,n=f(h.services);try{for(n.s();!(e=n.n()).done;){var o=e.value;this.injectService(o)}}catch(e){n.e(e)}finally{n.f()}}},{key:"injectService",value:function(e){if(this.shouldBeInjected(e)){var n=this.getInjectorFunction(e);void 0!==n&&(n(e.options||{}),p.emit("service-loaded",e.name)),this.injected[e.name]=!0}}},{key:"shouldBeInjected",value:function(e){return!1!==e.inject&&!this.injected[e.name]&&(e.required||this.cookieManager.hasAllNecessaryCookiesEnabled(e.purposes))}},{key:"getInjectorFunction",value:function(e){var n;if(!0===e.inject){var o=e.type||e.name;return void 0===(n=this.getDefaultInjector(o))?void console.error("No default injector found for ".concat(o,". Please specify your own implementation.")):n}if(e.inject)return e.inject}},{key:"getDefaultInjector",value:function(e){switch(e){case"google-analytics":return D;case"google-tag-manager":return P;case"facebook-pixel":return N;default:return}}},{key:"registerService",value:function(e,n,o){var t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=c({name:e,purposes:n,inject:o},t);h.services.push(i),this.injectService(i)}}]),e}(),U=function(){function e(){o(this,e)}return i(e,null,[{key:"removeCookies",value:function(){var e,n=this,o=f(h.services);try{for(o.s();!(e=o.n()).done;){var t=e.value;this.removeCookiesSetByService(t)}}catch(e){o.e(e)}finally{o.f()}h.cookies&&Object.values(h.cookies).map((function(e){return n.removeSimpleCookies(e)})),window.location.reload()}},{key:"removeCookiesForPurpose",value:function(e){var n,o=f(h.services);try{for(o.s();!(n=o.n()).done;){var t=n.value;-1!==t.purposes.indexOf(e)&&this.removeCookiesSetByService(t)}}catch(e){o.e(e)}finally{o.f()}h.cookies&&h.cookies[e]&&this.removeSimpleCookies(h.cookies[e])}},{key:"removeCookiesSetByService",value:function(e){e.cookies&&e.cookies.length&&this.removeSimpleCookies(e.cookies);var n=e.type||e.name;"google-analytics"===n&&this.removeGoogleAnalyticsCookies(e.options),"facebook-pixel"===n&&this.removeFacebookPixelCookies(e.options)}},{key:"removeGoogleAnalyticsCookies",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=["_ga","_gid","_gat","AMP_TOKEN"],o=["_dc_gtm_","_gac_","_gat_gtag_","_gat_"];this.removeSimpleCookies(n),void 0!==e.id&&this.removeCompositeCookies(o,e.id),void 0!==e.name&&this.removeCompositeCookies(o,e.name)}},{key:"removeFacebookPixelCookies",value:function(){this.removeSimpleCookies(["_fbp"])}},{key:"removeSimpleCookies",value:function(e){var n,o=f(e);try{for(o.s();!(n=o.n()).done;){var t,i=n.value,a=f(h.domains);try{for(a.s();!(t=a.n()).done;){var r=t.value;w.removeCookie(i,{domain:r})}}catch(e){a.e(e)}finally{a.f()}w.removeCookie(i)}}catch(e){o.e(e)}finally{o.f()}}},{key:"removeCompositeCookies",value:function(e,n){var o,t=f(e);try{for(t.s();!(o=t.n()).done;){var i,a=o.value,r=f(h.domains);try{for(r.s();!(i=r.n()).done;){var c=i.value;w.removeCookie("".concat(a).concat(n),{domain:c})}}catch(e){r.e(e)}finally{r.f()}w.removeCookie("".concat(a).concat(n))}}catch(e){t.e(e)}finally{t.f()}}}]),e}(),q=function(){function e(n){o(this,e),C.resolve(n),this.cookieNotification=new _,this.cookiePreferences=new O,this.cookieManager=new w(h.prefix,h.type,h.cookieAttributes),this.serviceLoader=new T}return i(e,[{key:"init",value:function(){var e=this;/complete|interactive|loaded/.test(document.readyState)?(this.cookieNotification.init(),this.cookiePreferences.init()):document.addEventListener("DOMContentLoaded",(function(){e.cookieNotification.init(),e.cookiePreferences.init()})),this.registerDefaultListeners(),this.checkInitialState()}},{key:"checkInitialState",value:function(){var e,n=f(g());try{for(n.s();!(e=n.n()).done;){var o=e.value;this.cookieManager.hasCookiesEnabled(o)&&p.emit("".concat(o,"-enabled"))}}catch(e){n.e(e)}finally{n.f()}}},{key:"registerDefaultListeners",value:function(){var e,n=this,o=f(g());try{var t=function(){var o=e.value;p.on("".concat(o,"-enabled"),(function(){n.serviceLoader.injectServices()})),p.on("".concat(o,"-disabled"),(function(){U.removeCookiesForPurpose(o)}))};for(o.s();!(e=o.n()).done;)t()}catch(e){o.e(e)}finally{o.f()}}},{key:"registerService",value:function(e,n,o){var t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this.serviceLoader.registerService(e,n,o,t)}}],[{key:"on",value:function(e,n){return p.on(e,n)}},{key:"create",value:function(n){return e.instance&&console.warn("Replacing an existing Haven instance. Are you sure this behaviour is intended?"),e.instance=new e(n),e.instance.init(),e.instance}},{key:"getInstance",value:function(){if(e.instance)return e.instance;console.error("No Haven instance found. Make sure to create a Haven instance before attempting to access it.")}},{key:"removeCookies",value:function(e,n){var o,t=f(e);try{for(t.s();!(o=t.n()).done;){var i=o.value;w.removeCookie(i,n)}}catch(e){t.e(e)}finally{t.f()}}}]),e}();window.Haven=q,e.CookieManager=w,e.Haven=q,Object.defineProperty(e,"__esModule",{value:!0})})); +//# sourceMappingURL=haven.umd.min.js.map diff --git a/i18n/ar.yaml b/i18n/ar.yaml index c7820c2..e2b7582 100644 --- a/i18n/ar.yaml +++ b/i18n/ar.yaml @@ -28,7 +28,7 @@ - id: cookieLink translation: ".اعْرَف أَكْثَر" -- id: cookieDismiss +- id: cookieAccept translation: "!أُوَافِق" - id: backToTop diff --git a/i18n/bg.yaml b/i18n/bg.yaml index 240284f..572f59a 100644 --- a/i18n/bg.yaml +++ b/i18n/bg.yaml @@ -28,8 +28,11 @@ - id: cookieLink translation: "Научете повече." -- id: cookieDismiss - translation: "Разбрах!" +- id: cookieAccept + translation: "Съгласен съм" + +- id: cookieDecline + translation: "Не съм съгласен" - id: backToTop translation: "Нагоре" diff --git a/i18n/de.yaml b/i18n/de.yaml index b16fd19..a8fcc23 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -28,8 +28,8 @@ - id: cookieLink translation: "Weitere Informationen" -- id: cookieDismiss - translation: "OK" +- id: cookieDecline + translation: "Nicht zustimmen" - id: backToTop translation: "Zurück zum Anfang" diff --git a/i18n/en.yaml b/i18n/en.yaml index 21e2e3c..17b09da 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -28,8 +28,11 @@ - id: cookieLink translation: "Learn more." -- id: cookieDismiss - translation: "Got it!" +- id: cookieAccept + translation: "Agree" + +- id: cookieDecline + translation: "Disagree" - id: backToTop translation: "Back to top" diff --git a/i18n/es.yaml b/i18n/es.yaml index 78f8e3b..e7dff1d 100644 --- a/i18n/es.yaml +++ b/i18n/es.yaml @@ -28,7 +28,7 @@ - id: cookieLink translation: "Leer más." -- id: cookieDismiss +- id: cookieAccept translation: "Comprendido!" - id: backToTop diff --git a/i18n/fa.yaml b/i18n/fa.yaml index 816b6ea..6f499a3 100644 --- a/i18n/fa.yaml +++ b/i18n/fa.yaml @@ -28,7 +28,7 @@ - id: cookieLink translation: ".بیشتر بدانید" -- id: cookieDismiss +- id: cookieAccept translation: "!متوجه شدم" - id: backToTop diff --git a/i18n/fr.yaml b/i18n/fr.yaml index f6c4f70..88678a9 100644 --- a/i18n/fr.yaml +++ b/i18n/fr.yaml @@ -28,7 +28,7 @@ - id: cookieLink translation: "En savoir plus." -- id: cookieDismiss +- id: cookieAccept translation: "J'ai compris !" - id: backToTop diff --git a/i18n/id.yaml b/i18n/id.yaml index 92609e8..8645576 100644 --- a/i18n/id.yaml +++ b/i18n/id.yaml @@ -28,7 +28,7 @@ - id: cookieLink translation: "Pelajari" -- id: cookieDismiss +- id: cookieAccept translation: "Paham!" - id: backToTop diff --git a/i18n/nl.yaml b/i18n/nl.yaml index d4ca481..c0a099d 100644 --- a/i18n/nl.yaml +++ b/i18n/nl.yaml @@ -28,7 +28,7 @@ - id: cookieLink translation: "Lees hier meer" -- id: cookieDismiss +- id: cookieAccept translation: "OK" - id: backToTop diff --git a/i18n/no.yaml b/i18n/no.yaml index 2e92683..08925c4 100644 --- a/i18n/no.yaml +++ b/i18n/no.yaml @@ -28,7 +28,7 @@ - id: cookieLink translation: "Lær mer." -- id: cookieDismiss +- id: cookieAccept translation: "Greit!" - id: backToTop diff --git a/i18n/pt.yaml b/i18n/pt.yaml index d38567d..6fd7c28 100644 --- a/i18n/pt.yaml +++ b/i18n/pt.yaml @@ -28,5 +28,5 @@ - id: cookieLink translation: "Saiba mais." -- id: cookieDismiss +- id: cookieAccept translation: "Ok!" diff --git a/i18n/zh-Hant-TW.yaml b/i18n/zh-Hant-TW.yaml index ae12af5..1ad1c74 100644 --- a/i18n/zh-Hant-TW.yaml +++ b/i18n/zh-Hant-TW.yaml @@ -28,7 +28,7 @@ - id: cookieLink translation: "進一步瞭解。" -- id: cookieDismiss +- id: cookieAccept translation: "知道了!" - id: backToTop diff --git a/layouts/partials/cookie-consent.html b/layouts/partials/cookie-consent.html index e0e72a4..716b903 100644 --- a/layouts/partials/cookie-consent.html +++ b/layouts/partials/cookie-consent.html @@ -1,28 +1,38 @@ -{{ $cookieConsentStyle := resources.Get "css/cookieconsent.min.css" | resources.Fingerprint }} - -{{ $cookieConsentScript := resources.Get "js/cookieconsent.min.js" | resources.Fingerprint }} - +{{ $cookieConsentScript := resources.Get "js/haven.umd.min.js" | resources.Fingerprint }} + {{- /* vim: set ts=2 sw=2 et: */}} diff --git a/package-lock.json b/package-lock.json index 8123fac..67f3503 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,12 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@chiiya/haven": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@chiiya/haven/-/haven-0.6.0.tgz", + "integrity": "sha512-t59swBfV/vxTu3TWedo+2NsniYsuCcLrPRSPs+7NbmMovCZntj+QDjGb+ZIzeYFGVzRfkN8XqRiuwt5/v0X+ng==", + "dev": true + }, "@fortawesome/fontawesome-common-types": { "version": "0.2.28", "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.28.tgz", @@ -1085,12 +1091,6 @@ "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", "dev": true }, - "cookieconsent": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/cookieconsent/-/cookieconsent-3.1.1.tgz", - "integrity": "sha512-v8JWLJcI7Zs9NWrs8hiVldVtm3EBF70TJI231vxn6YToBGj0c9dvdnYwltydkAnrbBMOM/qX1xLFrnTfm5wTag==", - "dev": true - }, "copy-concurrently": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", diff --git a/package.json b/package.json index 66ceef5..f1a7bb5 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "scripts": { "build:css": "node-sass --output-style expanded --precision 6 source/scss/style.scss assets/css/style.css.tmp && cleancss --level 1 assets/css/style.css.tmp -o assets/css/style.css", "build:rtlcss": "rtlcss -s assets/css/style.css.tmp assets/css/style.rtl.css.tmp && cleancss --level 1 assets/css/style.rtl.css.tmp -o assets/css/style.rtl.css", - "build:cookieconsent": "cp node_modules/cookieconsent/build/cookieconsent.min.css assets/css && cp node_modules/cookieconsent/build/cookieconsent.min.js assets/js", + "build:cookieconsent": "cp node_modules/@chiiya/haven/dist/haven.umd.min.js assets/js", "build:js": "webpack", "build": "npm run build:css && npm run build:rtlcss && npm run build:js && npm run build:cookieconsent && npm run clean", "clean": "rm assets/css/style.css.tmp assets/css/style.rtl.css.tmp" @@ -18,12 +18,12 @@ "author": "Alan Orth", "license": "CC-BY-3.0", "devDependencies": { + "@chiiya/haven": "^0.6.0", "@fortawesome/fontawesome-svg-core": "^1.2.28", "@fortawesome/free-brands-svg-icons": "^5.13.0", "@fortawesome/free-solid-svg-icons": "^5.13.0", "bootstrap": "~4.5.0", "clean-css-cli": "^4.3.0", - "cookieconsent": "^3.1.1", "node-sass": "^4.14.1", "rtlcss": "^2.5.0", "webpack": "^4.43.0",