From 2fa206395718cc11687faa8cb75c184786f566ca Mon Sep 17 00:00:00 2001 From: Alexis Gousseau Date: Tue, 28 Nov 2023 10:23:42 +0100 Subject: [PATCH] remove btn/event more details on first page banner --- dist/browser/cookie-cn.css | 33 +------ dist/browser/cookie-cn.js | 2 +- dist/browser/typings/ts/index.d.ts | 10 -- dist/esm/ts/index.js | 66 +------------ dist/typings/ts/index.d.ts | 10 -- dist/umd/css/standard.css | 33 +------ dist/umd/main.js | 66 ------------- dist/umd/main.js.map | 2 +- examples/laravel/cn-cookies.blade.php | 9 +- examples/laravel/lang/de/cookie-notice.php | 10 +- examples/laravel/lang/en/cookie-notice.php | 10 +- examples/laravel/lang/fr/cookie-notice.php | 10 +- examples/laravel/templates/standard.blade.php | 14 +-- examples/wordpress/cn-cookies.php | 43 ++++---- examples/wordpress/templates/standard.php | 16 +-- src/scss/themes/standard.scss | 31 ------ src/ts/index.ts | 99 ------------------- 17 files changed, 42 insertions(+), 422 deletions(-) diff --git a/dist/browser/cookie-cn.css b/dist/browser/cookie-cn.css index 6ae15ad..b1ca583 100644 --- a/dist/browser/cookie-cn.css +++ b/dist/browser/cookie-cn.css @@ -58,7 +58,7 @@ /* Accept/Deny btn settings */ /* Cookies list settings */ #cn-wrapper .cn-nav #cn-settings-banner, #cn-wrapper .cn-nav #cn-accept-banner, #cn-wrapper .cn-nav #cn-deny-banner, #cn-wrapper .cn-content .cn-modal-container .accept label, -#cn-wrapper .cn-content .cn-modal-container .deny label, #cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p { +#cn-wrapper .cn-content .cn-modal-container .deny label { display: flex; height: 3rem; flex-direction: column; @@ -71,13 +71,13 @@ font-size: 1rem; } #cn-wrapper .cn-nav #cn-settings-banner:hover, #cn-wrapper .cn-nav #cn-accept-banner:hover, #cn-wrapper .cn-nav #cn-deny-banner:hover, #cn-wrapper .cn-content .cn-modal-container .accept label:hover, -#cn-wrapper .cn-content .cn-modal-container .deny label:hover, #cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p:hover, #cn-wrapper .cn-nav #cn-settings-banner:focus, #cn-wrapper .cn-nav #cn-accept-banner:focus, #cn-wrapper .cn-nav #cn-deny-banner:focus, #cn-wrapper .cn-content .cn-modal-container .accept label:focus, -#cn-wrapper .cn-content .cn-modal-container .deny label:focus, #cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p:focus { +#cn-wrapper .cn-content .cn-modal-container .deny label:hover, #cn-wrapper .cn-nav #cn-settings-banner:focus, #cn-wrapper .cn-nav #cn-accept-banner:focus, #cn-wrapper .cn-nav #cn-deny-banner:focus, #cn-wrapper .cn-content .cn-modal-container .accept label:focus, +#cn-wrapper .cn-content .cn-modal-container .deny label:focus { background-color: #a0a0a0; color: #000; } #cn-wrapper .cn-nav #cn-settings-banner:focus, #cn-wrapper .cn-nav #cn-accept-banner:focus, #cn-wrapper .cn-nav #cn-deny-banner:focus, #cn-wrapper .cn-content .cn-modal-container .accept label:focus, -#cn-wrapper .cn-content .cn-modal-container .deny label:focus, #cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p:focus { +#cn-wrapper .cn-content .cn-modal-container .deny label:focus { outline-color: #000; } @@ -253,31 +253,6 @@ margin: 6px 0; text-align: justify; } -#cn-wrapper .cn-content .cn-banner-content .cn-banner-details { - display: flex; - overflow: hidden; - height: 0; - flex-direction: row; - align-items: flex-start; - justify-content: center; - text-align: justify; - transition: 0.3s; -} -#cn-wrapper .cn-content .cn-banner-content .cn-banner-details p { - padding-bottom: 1rem; -} -#cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details { - width: 100%; -} -#cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p { - display: inline-block; - width: 100%; - padding: 1rem 0; - margin: 0 auto; - cursor: pointer; - font-size: 14px; - text-align: center; -} #cn-wrapper .cn-content .cn-modal-container .cn-modal-title { color: #dc9c52; font-family: "Satisfy", sans-serif; diff --git a/dist/browser/cookie-cn.js b/dist/browser/cookie-cn.js index 5311e45..a504f7f 100644 --- a/dist/browser/cookie-cn.js +++ b/dist/browser/cookie-cn.js @@ -1 +1 @@ -!function(){class e{constructor(e){this.browserCookieName="cn-init",this.cookieTimeLife=6,this.cookieExpirationName="_expiration",this.cookiePolicies={sameSite:o.lax,secure:""},this.config=e;let n=this.readCookiesExpirationDate();n||(n=new Date,n.setMonth(n.getMonth()+this.cookieTimeLife)),this.cookieExpirationDate=n;const i=document.createElement("div");i.classList.add("cn-modal-bg"),document.body.append(i),this.modalBg=i;const s=document.querySelector("div#cn-wrapper"),a=document.querySelector("button#cn-cookie-btn"),r=document.querySelector("button#cn-close-modal"),l=document.querySelectorAll(".cn-cookie-link"),c=document.querySelector("div#cn-banner"),d=document.querySelector("div.cn-banner-content"),h=document.querySelector("div.cn-banner-details"),u=document.querySelector("div.cn-banner-para-p"),m=document.querySelector("p.cn-banner-para-p-open"),C=document.querySelector("p.cn-banner-para-p-close"),b=document.querySelector("button.cn-banner-btn-details-p"),k=document.querySelector("div.cn-banner-btn-details"),p=document.querySelector("div.cn-modal-container"),f=document.querySelector("button#cn-accept-banner"),w=document.querySelector("button#cn-deny-banner"),g=document.querySelector("button#cn-settings-banner"),v=document.querySelector("ul#cn-modal-list"),E=document.querySelector("div.cn-modal-wrapper"),L=document.querySelector("div#cn-li-template");if(!s)throw new Error("Cannot find div#cn-wrapper");if(!a)throw new Error("Cannot find 'button#cn-cookie-btn' element");if(!r)throw new Error("Cannot find 'button#cn-close-modal' element");if(!c)throw new Error("Cannot find 'div#cn-banner' element");if(!d)throw new Error("Cannot find 'div.cn-banner-content' element");if(!h)throw new Error("Cannot find 'div.cn-banner-details' element");if(!u)throw new Error("Cannot find 'div.cn-banner-para-p' element");if(!m)throw new Error("Cannot find 'p.cn-banner-para-p-open' element");if(!C)throw new Error("Cannot find 'p.cn-banner-para-p-close' element");if(!b)throw new Error("Cannot find 'button.cn-banner-btn-details-p' element");if(!k)throw new Error("Cannot find '.cn-banner-btn-details' element");if(!p)throw new Error("Cannot find 'div.cn-modal-container' element");if(!f)throw new Error("Cannot find 'button#cn-accept-banner' element");if(!w)throw new Error("Cannot find 'button#cn-deny-banner' element");if(!g)throw new Error("Cannot find 'button.cn-settings-banner' element");if(!v)throw new Error("Cannot find 'ul#cn-modal-list' element");if(!E)throw new Error("Cannot find 'div.cn-modal-wrapper' element");if(!L)throw new Error("Cannot find 'div#cn-li-template' element");this.cookieShowModalBtn=a,this.cookieCloseModalBtn=r,this.cookieLinkShowCustomizeModalList=l,this.cookieContainer=s,this.bannerDetailsContainer=k,this.bannerContainer=c,this.bannerContent=d,this.cookiesUnorderedList=v,this.modalWrapper=E,this.bannerParaP=u,this.detailsTextOpen=m,this.detailsTextClose=C,this.bannerDetails=h,this.bannerDetailsCollapseBtn=b,this.modalContainer=p,this.acceptAllBtn=f,this.denyAllBtn=w,this.customizeBtn=g,this.bannerDetailsAreExpanded=!1,this.template=L;const B=this.template.cloneNode(!0);this.template.remove(),this.template=B,this.addEventPrevent(this.modalBg,"click",this.closeCookieModal),this.addEventPrevent(this.cookieCloseModalBtn,"click",this.closeCookieModal),this.addEventPrevent(this.acceptAllBtn,"click",this.acceptAllCookies),this.addEventPrevent(this.denyAllBtn,"click",this.denyAllCookies),this.addEventPrevent(this.customizeBtn,"click",this.toggleCookieModalPages),this.addEventPrevent(this.bannerDetailsCollapseBtn,"click",this.toggleBannerDetails),this.addEventPrevent(this.cookieShowModalBtn,"click",this.toggleCookieModal),this.cookieLinkShowCustomizeModalList.forEach((e=>{this.addEventPrevent(e,"click",this.openCookieModalToCookiePage),this.addEventKbdValidate(e,this.openCookieModalToCookiePage)})),this.cookiesMatchesConfig()&&!this.cookiesOlderThan(new Date)||(this.resetBrowserCookie(),this.openCookieModalToBannerPage());const S=this.getCookieStatusList();Object.entries(S).forEach((([e,o])=>{o!==t.wait?this.config[e]&&(o!==t.true?null!=this.config[e].fallback&&this.config[e].fallback():this.config[e].script()):this.openCookieModalToBannerPage()}))}readCookiesExpirationDate(){var e;const t=(null!==(e=this.getBrowserCookieValue())&&void 0!==e?e:"").split(",").find((e=>e.startsWith(this.cookieExpirationName)));if(!t)return null;try{const e=Number.parseInt(t.replace(`${this.cookieExpirationName}=`,""));return isNaN(e)?null:new Date(e)}catch(e){return null}}cookiesOlderThan(e){return this.cookieExpirationDate.getTime()this.setCookieStatus(e,t.true,o)));for(const e of this.cookieContainer.querySelectorAll(".accept > label"))e.classList.add("active");for(const e of this.cookieContainer.querySelectorAll(".deny > label"))e.classList.remove("active");this.closeCookieModal()}denyAllCookies(){Object.entries(this.config).forEach((([e,o])=>this.setCookieStatus(e,t.false,o)));for(const e of this.cookieContainer.querySelectorAll(".accept > label"))e.classList.remove("active");for(const e of this.cookieContainer.querySelectorAll(".deny > label"))e.classList.add("active");this.closeCookieModal()}getCookieStatusList(){const e=this.getBrowserCookieValue(),t={};return void 0===e||e.split(",").filter((e=>!e.startsWith(this.cookieExpirationName))).forEach((e=>{const o=e.split("=");t[o[0]]=o[1]})),t}containsCookieStatus(e){const t=this.getCookieStatusList();return void 0!==Object.keys(t).find((t=>t===e))}setCookieStatus(e,o,n){o!==t.true?o!==t.false?this.setBrowserCookieStatus(e,t.wait):this.removeCookieStatus(e,n):this.addCookieStatus(e,n)}addCookieStatus(e,o){o.script&&o.script(),this.setBrowserCookieStatus(e,t.true)}removeCookieStatus(e,o){const n=document.getElementById(e);n&&n.remove(),o.fallback&&o.fallback(),this.setBrowserCookieStatus(e,t.false)}setBrowserCookieStatus(e,t){const o=this.getCookieStatusList();this.deleteBrowserCookie(),o[e]=t,this.saveBrowserCookie(o)}hasBrowserCookie(){return Boolean(this.getBrowserCookieValue())}getBrowserCookieValue(){const e=document.cookie.match(new RegExp("(?:^|; )"+this.browserCookieName.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}saveBrowserCookie(e){const t=new Date,o=Object.entries(e).map((([e,t])=>`${e}=${t}`));this.cookieExpirationDate=new Date(t.setMonth(t.getMonth()+this.cookieTimeLife)),o.push(`${this.cookieExpirationName}=${this.cookieExpirationDate.getTime()}`),document.cookie=`${this.browserCookieName}=${o.join(",")};path=/${location.hostname?`;domain=${location.hostname}`:""};expires=${this.cookieExpirationDate.toUTCString()};${this.getCookiePoliciesAsString()}`}deleteBrowserCookie(){this.hasBrowserCookie()&&(document.cookie=`${this.browserCookieName}=;path=/${location.hostname?`;domain=.${location.hostname}`:""};expires=Thu, 01 Jan 1970 00:00:01 GMT;`,document.cookie=`${this.browserCookieName}=;path=/${location.hostname?`;domain=${location.hostname}`:""};expires=Thu, 01 Jan 1970 00:00:01 GMT;`)}getCookiePoliciesAsString(){return Object.entries(this.cookiePolicies).map((([e,t])=>`${e}=${t}`)).join(";")}resetBrowserCookie(){const e={};Object.entries(this.config).forEach((([o])=>e[o]=t.wait)),this.saveBrowserCookie(e)}addEvent(e,t,o){return e.addEventListener(t,o.bind(this),!1)}addEventPrevent(e,t,o){return e.addEventListener(t,(e=>{e.preventDefault(),o.call(this,e)}),!1)}addEventKbdValidate(e,t){return this.addEvent(e,"keydown",(e=>{const o=e;" "!=o.key&&"Space"!=o.code&&32!=o.keyCode&&"Enter"!=o.key&&"Enter"!=o.code&&13!=o.keyCode||(t.call(this,o),e.preventDefault())}))}toggleCookieModal(){document.body.classList.contains("cn-open")?this.closeCookieModal():this.openCookieModalToBannerPage()}openCookieModalToBannerPage(){this.openCookieModalToCookiePage(),this.toggleCookieModalPages()}openCookieModalToCookiePage(){document.body.classList.add("cn-open"),this.resetCookieModal(),this.bannerContent.classList.add("d-none"),this.bannerDetails.classList.add("d-none"),this.bannerDetailsContainer.classList.add("d-none"),this.modalContainer.classList.remove("d-none"),this.modalWrapper.scrollTop=0,this.setupCookieModalList(),this.setTabIndex()}closeCookieModal(){document.body.classList.remove("cn-open"),this.unsetTabIndex(),this.setupCookieModalList()}setTabIndex(){document.documentElement.setAttribute("tabindex","-1"),setTimeout((()=>{const e='a[href], button, [role="button"], input, embed, object, iframe, textarea, select, details, [tabindex]:not([tabindex="-1"])';[...document.body.querySelectorAll(e)].filter((e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden"))).forEach((e=>{e.setAttribute("tabindex","-1"),e.classList.add("cn-disabled")})),[...this.cookieContainer.querySelectorAll(e)].filter((e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden")&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length))).forEach((e=>{e.setAttribute("tabindex","0"),e.classList.remove("cn-disabled")})),this.cookieShowModalBtn.setAttribute("tabindex","-1")}),500)}unsetTabIndex(){document.documentElement.setAttribute("tabindex","0"),setTimeout((()=>{document.body.querySelectorAll(".cn-disabled").forEach((e=>{e.setAttribute("tabindex","0"),e.classList.remove("cn-disabled")})),this.cookieShowModalBtn.setAttribute("tabindex","0")}),500)}resetCookieModal(){if(this.bannerContent.classList.remove("d-none"),this.bannerDetails.classList.remove("d-none"),this.bannerDetailsContainer.classList.remove("d-none"),this.modalContainer.classList.add("d-none"),!this.customizeBtn.dataset.openModal)throw new Error("Cannot find attribut data-open-modal");this.customizeBtn.innerHTML=this.customizeBtn.dataset.openModal}setupCookieModalList(){this.cookiesUnorderedList.innerHTML="",Object.entries(this.config).forEach((([e,o])=>{const n=document.createElement("li"),i=this.template.children.item(0);if(null===i)throw new Error("Cannot find child item");n.append(i.cloneNode(!0));const s=n.querySelector("span.cn-cookie-name"),a=n.querySelector("span.cn-cookie-description"),r=n.querySelector(".cn-cookie-link"),l=n.querySelector(".accept > input"),c=n.querySelector(".deny > input"),d=n.querySelector(".accept > label"),h=n.querySelector(".deny > label");s.textContent=o.name,a.textContent=o.description,r.textContent=o.labelLink,r.setAttribute("href",o.link),l.id=e+"1",l.name=e,l.dataset.name=e,d.htmlFor=e+"1",d.textContent=`${d.textContent} ${e}`,d.title=`${d.textContent} ${e}`,c.id=e+"2",c.name=e,c.dataset.name=e,h.htmlFor=e+"2",h.textContent=`${h.textContent} ${e}`,h.title=`${h.textContent} ${e}`;const u=()=>{d.classList.add("active"),h.classList.remove("active"),this.setCookieStatus(e,t.true,o)},m=()=>{d.classList.remove("active"),h.classList.add("active"),this.setCookieStatus(e,t.false,o)};this.addEvent(l,"click",u),this.addEventKbdValidate(d,u),this.addEvent(c,"click",m),this.addEventKbdValidate(h,m),this.cookiesUnorderedList.append(n),this.hasBrowserCookie()&&Object.entries(this.getCookieStatusList()).forEach((([o,n])=>{if(o===e)switch(d.classList.remove("active"),h.classList.remove("active"),n){case t.true:d.classList.add("active");break;case t.false:h.classList.add("active")}}))}))}toggleBannerDetails(){if(this.bannerDetails.classList.toggle("cn-details-open"),!this.bannerDetailsCollapseBtn.dataset.open||!this.bannerDetailsCollapseBtn.dataset.close)throw new Error("Cannot find attribute data-open or data-close");this.bannerDetailsAreExpanded?(this.bannerDetailsCollapseBtn.innerHTML=this.bannerDetailsCollapseBtn.dataset.close,this.bannerDetailsCollapseBtn.title=this.bannerDetailsCollapseBtn.dataset.close,this.bannerDetailsCollapseBtn.ariaPressed="false",this.detailsTextOpen.classList.add("d-none"),this.detailsTextClose.classList.remove("d-none"),this.bannerDetails.style.height="0px",this.bannerDetailsAreExpanded=!1):(this.bannerDetailsCollapseBtn.innerHTML=this.bannerDetailsCollapseBtn.dataset.open,this.bannerDetailsCollapseBtn.title=this.bannerDetailsCollapseBtn.dataset.open,this.bannerDetailsCollapseBtn.ariaPressed="true",this.detailsTextOpen.classList.remove("d-none"),this.detailsTextClose.classList.add("d-none"),this.bannerDetails.style.height=this.bannerDetails.children[0].clientHeight+"px",this.bannerDetailsAreExpanded=!0)}toggleCookieModalPages(){this.bannerContent.classList.toggle("d-none"),this.bannerDetails.classList.toggle("d-none"),this.bannerDetailsContainer.classList.toggle("d-none"),this.modalContainer.classList.toggle("d-none"),this.setTabIndex(),this.setupCookieModalList(),this.togglePersonalizeBtn()}togglePersonalizeBtn(){const e=this.customizeBtn.dataset;this.modalWrapper.scrollTop=0,this.bannerContent.classList.contains("d-none")?(this.customizeBtn.innerHTML=e.openModal,this.customizeBtn.title=e.openModal):(this.customizeBtn.innerHTML=e.closeModal,this.customizeBtn.title=e.closeModal)}}var t,o;!function(e){e.true="true",e.false="false",e.wait="wait"}(t||(t={})),function(e){e.lax="lax",e.strict="strict",e.none="none"}(o||(o={}));const n=window.CookieNotice;e.noConflict=function(t=!1){return t&&window.CookieNotice===e&&(window.CookieNotice=n),e},window.CookieNotice=e.noConflict()}(); +!function(){class e{constructor(e){this.browserCookieName="cn-init",this.cookieTimeLife=6,this.cookieExpirationName="_expiration",this.cookiePolicies={sameSite:o.lax,secure:""},this.config=e;let i=this.readCookiesExpirationDate();i||(i=new Date,i.setMonth(i.getMonth()+this.cookieTimeLife)),this.cookieExpirationDate=i;const n=document.createElement("div");n.classList.add("cn-modal-bg"),document.body.append(n),this.modalBg=n;const s=document.querySelector("div#cn-wrapper"),a=document.querySelector("button#cn-cookie-btn"),r=document.querySelector("button#cn-close-modal"),c=document.querySelectorAll(".cn-cookie-link"),l=document.querySelector("div#cn-banner"),d=document.querySelector("div.cn-banner-content"),h=document.querySelector("div.cn-modal-container"),u=document.querySelector("button#cn-accept-banner"),k=document.querySelector("button#cn-deny-banner"),m=document.querySelector("button#cn-settings-banner"),C=document.querySelector("ul#cn-modal-list"),b=document.querySelector("div.cn-modal-wrapper"),p=document.querySelector("div#cn-li-template");if(!s)throw new Error("Cannot find div#cn-wrapper");if(!a)throw new Error("Cannot find 'button#cn-cookie-btn' element");if(!r)throw new Error("Cannot find 'button#cn-close-modal' element");if(!l)throw new Error("Cannot find 'div#cn-banner' element");if(!d)throw new Error("Cannot find 'div.cn-banner-content' element");if(!h)throw new Error("Cannot find 'div.cn-modal-container' element");if(!u)throw new Error("Cannot find 'button#cn-accept-banner' element");if(!k)throw new Error("Cannot find 'button#cn-deny-banner' element");if(!m)throw new Error("Cannot find 'button.cn-settings-banner' element");if(!C)throw new Error("Cannot find 'ul#cn-modal-list' element");if(!b)throw new Error("Cannot find 'div.cn-modal-wrapper' element");if(!p)throw new Error("Cannot find 'div#cn-li-template' element");this.cookieShowModalBtn=a,this.cookieCloseModalBtn=r,this.cookieLinkShowCustomizeModalList=c,this.cookieContainer=s,this.bannerContainer=l,this.bannerContent=d,this.cookiesUnorderedList=C,this.modalWrapper=b,this.modalContainer=h,this.acceptAllBtn=u,this.denyAllBtn=k,this.customizeBtn=m,this.bannerDetailsAreExpanded=!1,this.template=p;const f=this.template.cloneNode(!0);this.template.remove(),this.template=f,this.addEventPrevent(this.modalBg,"click",this.closeCookieModal),this.addEventPrevent(this.cookieCloseModalBtn,"click",this.closeCookieModal),this.addEventPrevent(this.acceptAllBtn,"click",this.acceptAllCookies),this.addEventPrevent(this.denyAllBtn,"click",this.denyAllCookies),this.addEventPrevent(this.customizeBtn,"click",this.toggleCookieModalPages),this.addEventPrevent(this.cookieShowModalBtn,"click",this.toggleCookieModal),this.cookieLinkShowCustomizeModalList.forEach((e=>{this.addEventPrevent(e,"click",this.openCookieModalToCookiePage),this.addEventKbdValidate(e,this.openCookieModalToCookiePage)})),this.cookiesMatchesConfig()&&!this.cookiesOlderThan(new Date)||(this.resetBrowserCookie(),this.openCookieModalToBannerPage());const w=this.getCookieStatusList();Object.entries(w).forEach((([e,o])=>{o!==t.wait?this.config[e]&&(o!==t.true?null!=this.config[e].fallback&&this.config[e].fallback():this.config[e].script()):this.openCookieModalToBannerPage()}))}readCookiesExpirationDate(){var e;const t=(null!==(e=this.getBrowserCookieValue())&&void 0!==e?e:"").split(",").find((e=>e.startsWith(this.cookieExpirationName)));if(!t)return null;try{const e=Number.parseInt(t.replace(`${this.cookieExpirationName}=`,""));return isNaN(e)?null:new Date(e)}catch(e){return null}}cookiesOlderThan(e){return this.cookieExpirationDate.getTime()this.setCookieStatus(e,t.true,o)));for(const e of this.cookieContainer.querySelectorAll(".accept > label"))e.classList.add("active");for(const e of this.cookieContainer.querySelectorAll(".deny > label"))e.classList.remove("active");this.closeCookieModal()}denyAllCookies(){Object.entries(this.config).forEach((([e,o])=>this.setCookieStatus(e,t.false,o)));for(const e of this.cookieContainer.querySelectorAll(".accept > label"))e.classList.remove("active");for(const e of this.cookieContainer.querySelectorAll(".deny > label"))e.classList.add("active");this.closeCookieModal()}getCookieStatusList(){const e=this.getBrowserCookieValue(),t={};return void 0===e||e.split(",").filter((e=>!e.startsWith(this.cookieExpirationName))).forEach((e=>{const o=e.split("=");t[o[0]]=o[1]})),t}containsCookieStatus(e){const t=this.getCookieStatusList();return void 0!==Object.keys(t).find((t=>t===e))}setCookieStatus(e,o,i){o!==t.true?o!==t.false?this.setBrowserCookieStatus(e,t.wait):this.removeCookieStatus(e,i):this.addCookieStatus(e,i)}addCookieStatus(e,o){o.script&&o.script(),this.setBrowserCookieStatus(e,t.true)}removeCookieStatus(e,o){const i=document.getElementById(e);i&&i.remove(),o.fallback&&o.fallback(),this.setBrowserCookieStatus(e,t.false)}setBrowserCookieStatus(e,t){const o=this.getCookieStatusList();this.deleteBrowserCookie(),o[e]=t,this.saveBrowserCookie(o)}hasBrowserCookie(){return Boolean(this.getBrowserCookieValue())}getBrowserCookieValue(){const e=document.cookie.match(new RegExp("(?:^|; )"+this.browserCookieName.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}saveBrowserCookie(e){const t=new Date,o=Object.entries(e).map((([e,t])=>`${e}=${t}`));this.cookieExpirationDate=new Date(t.setMonth(t.getMonth()+this.cookieTimeLife)),o.push(`${this.cookieExpirationName}=${this.cookieExpirationDate.getTime()}`),document.cookie=`${this.browserCookieName}=${o.join(",")};path=/${location.hostname?`;domain=${location.hostname}`:""};expires=${this.cookieExpirationDate.toUTCString()};${this.getCookiePoliciesAsString()}`}deleteBrowserCookie(){this.hasBrowserCookie()&&(document.cookie=`${this.browserCookieName}=;path=/${location.hostname?`;domain=.${location.hostname}`:""};expires=Thu, 01 Jan 1970 00:00:01 GMT;`,document.cookie=`${this.browserCookieName}=;path=/${location.hostname?`;domain=${location.hostname}`:""};expires=Thu, 01 Jan 1970 00:00:01 GMT;`)}getCookiePoliciesAsString(){return Object.entries(this.cookiePolicies).map((([e,t])=>`${e}=${t}`)).join(";")}resetBrowserCookie(){const e={};Object.entries(this.config).forEach((([o])=>e[o]=t.wait)),this.saveBrowserCookie(e)}addEvent(e,t,o){return e.addEventListener(t,o.bind(this),!1)}addEventPrevent(e,t,o){return e.addEventListener(t,(e=>{e.preventDefault(),o.call(this,e)}),!1)}addEventKbdValidate(e,t){return this.addEvent(e,"keydown",(e=>{const o=e;" "!=o.key&&"Space"!=o.code&&32!=o.keyCode&&"Enter"!=o.key&&"Enter"!=o.code&&13!=o.keyCode||(t.call(this,o),e.preventDefault())}))}toggleCookieModal(){document.body.classList.contains("cn-open")?this.closeCookieModal():this.openCookieModalToBannerPage()}openCookieModalToBannerPage(){this.openCookieModalToCookiePage(),this.toggleCookieModalPages()}openCookieModalToCookiePage(){document.body.classList.add("cn-open"),this.resetCookieModal(),this.bannerContent.classList.add("d-none"),this.modalContainer.classList.remove("d-none"),this.modalWrapper.scrollTop=0,this.setupCookieModalList(),this.setTabIndex()}closeCookieModal(){document.body.classList.remove("cn-open"),this.unsetTabIndex(),this.setupCookieModalList()}setTabIndex(){document.documentElement.setAttribute("tabindex","-1"),setTimeout((()=>{const e='a[href], button, [role="button"], input, embed, object, iframe, textarea, select, details, [tabindex]:not([tabindex="-1"])';[...document.body.querySelectorAll(e)].filter((e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden"))).forEach((e=>{e.setAttribute("tabindex","-1"),e.classList.add("cn-disabled")})),[...this.cookieContainer.querySelectorAll(e)].filter((e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden")&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length))).forEach((e=>{e.setAttribute("tabindex","0"),e.classList.remove("cn-disabled")})),this.cookieShowModalBtn.setAttribute("tabindex","-1")}),500)}unsetTabIndex(){document.documentElement.setAttribute("tabindex","0"),setTimeout((()=>{document.body.querySelectorAll(".cn-disabled").forEach((e=>{e.setAttribute("tabindex","0"),e.classList.remove("cn-disabled")})),this.cookieShowModalBtn.setAttribute("tabindex","0")}),500)}resetCookieModal(){if(this.bannerContent.classList.remove("d-none"),this.modalContainer.classList.add("d-none"),!this.customizeBtn.dataset.openModal)throw new Error("Cannot find attribut data-open-modal");this.customizeBtn.innerHTML=this.customizeBtn.dataset.openModal}setupCookieModalList(){this.cookiesUnorderedList.innerHTML="",Object.entries(this.config).forEach((([e,o])=>{const i=document.createElement("li"),n=this.template.children.item(0);if(null===n)throw new Error("Cannot find child item");i.append(n.cloneNode(!0));const s=i.querySelector("span.cn-cookie-name"),a=i.querySelector("span.cn-cookie-description"),r=i.querySelector(".cn-cookie-link"),c=i.querySelector(".accept > input"),l=i.querySelector(".deny > input"),d=i.querySelector(".accept > label"),h=i.querySelector(".deny > label");s.textContent=o.name,a.textContent=o.description,r.textContent=o.labelLink,r.setAttribute("href",o.link),c.id=e+"1",c.name=e,c.dataset.name=e,d.htmlFor=e+"1",d.textContent=`${d.textContent} ${e}`,d.title=`${d.textContent} ${e}`,l.id=e+"2",l.name=e,l.dataset.name=e,h.htmlFor=e+"2",h.textContent=`${h.textContent} ${e}`,h.title=`${h.textContent} ${e}`;const u=()=>{d.classList.add("active"),h.classList.remove("active"),this.setCookieStatus(e,t.true,o)},k=()=>{d.classList.remove("active"),h.classList.add("active"),this.setCookieStatus(e,t.false,o)};this.addEvent(c,"click",u),this.addEventKbdValidate(d,u),this.addEvent(l,"click",k),this.addEventKbdValidate(h,k),this.cookiesUnorderedList.append(i),this.hasBrowserCookie()&&Object.entries(this.getCookieStatusList()).forEach((([o,i])=>{if(o===e)switch(d.classList.remove("active"),h.classList.remove("active"),i){case t.true:d.classList.add("active");break;case t.false:h.classList.add("active")}}))}))}toggleCookieModalPages(){this.bannerContent.classList.toggle("d-none"),this.modalContainer.classList.toggle("d-none"),this.setTabIndex(),this.setupCookieModalList(),this.togglePersonalizeBtn()}togglePersonalizeBtn(){const e=this.customizeBtn.dataset;this.modalWrapper.scrollTop=0,this.bannerContent.classList.contains("d-none")?(this.customizeBtn.innerHTML=e.openModal,this.customizeBtn.title=e.openModal):(this.customizeBtn.innerHTML=e.closeModal,this.customizeBtn.title=e.closeModal)}}var t,o;!function(e){e.true="true",e.false="false",e.wait="wait"}(t||(t={})),function(e){e.lax="lax",e.strict="strict",e.none="none"}(o||(o={}));const i=window.CookieNotice;e.noConflict=function(t=!1){return t&&window.CookieNotice===e&&(window.CookieNotice=i),e},window.CookieNotice=e.noConflict()}(); diff --git a/dist/browser/typings/ts/index.d.ts b/dist/browser/typings/ts/index.d.ts index 9e75edf..120d20c 100644 --- a/dist/browser/typings/ts/index.d.ts +++ b/dist/browser/typings/ts/index.d.ts @@ -15,13 +15,7 @@ export default class CookieNotice { modalContainer: HTMLDivElement; cookieShowModalBtn: HTMLButtonElement; cookieCloseModalBtn: HTMLButtonElement; - bannerDetailsCollapseBtn: HTMLButtonElement; - bannerParaP: HTMLDivElement; - detailsTextOpen: HTMLParagraphElement; - detailsTextClose: HTMLParagraphElement; bannerContent: HTMLDivElement; - bannerDetails: HTMLDivElement; - bannerDetailsContainer: HTMLDivElement; acceptAllBtn: HTMLButtonElement; denyAllBtn: HTMLButtonElement; customizeBtn: HTMLButtonElement; @@ -184,10 +178,6 @@ export default class CookieNotice { * Set the cookies list in the modal */ setupCookieModalList(): void; - /** - * Toggle show hide banner details - */ - toggleBannerDetails(): void; /** * Toggle Cookie modal pages */ diff --git a/dist/esm/ts/index.js b/dist/esm/ts/index.js index cc72e3d..0870ee5 100644 --- a/dist/esm/ts/index.js +++ b/dist/esm/ts/index.js @@ -25,7 +25,7 @@ export default class CookieNotice { document.body.append(modalBg); this.modalBg = modalBg; // * Setup Dom Elements - const cookieContainer = document.querySelector("div#cn-wrapper"), cookieShowModalBtn = document.querySelector("button#cn-cookie-btn"), cookieCloseModalBtn = document.querySelector("button#cn-close-modal"), cookieLinkShowCustomizeModalPageList = document.querySelectorAll(".cn-cookie-link"), bannerContainer = document.querySelector("div#cn-banner"), bannerContent = document.querySelector("div.cn-banner-content"), bannerDetails = document.querySelector("div.cn-banner-details"), bannerParaP = document.querySelector("div.cn-banner-para-p"), detailsTextOpen = document.querySelector("p.cn-banner-para-p-open"), detailsTextClose = document.querySelector("p.cn-banner-para-p-close"), bannerDetailsCollapseBtn = document.querySelector("button.cn-banner-btn-details-p"), bannerDetailsContainer = document.querySelector("div.cn-banner-btn-details"), modalContainer = document.querySelector("div.cn-modal-container"), acceptAllBtn = document.querySelector("button#cn-accept-banner"), denyAllBtn = document.querySelector("button#cn-deny-banner"), customizeBtn = document.querySelector("button#cn-settings-banner"), cookiesUnorderedList = document.querySelector("ul#cn-modal-list"), modalWrapper = document.querySelector("div.cn-modal-wrapper"), template = document.querySelector("div#cn-li-template"); + const cookieContainer = document.querySelector("div#cn-wrapper"), cookieShowModalBtn = document.querySelector("button#cn-cookie-btn"), cookieCloseModalBtn = document.querySelector("button#cn-close-modal"), cookieLinkShowCustomizeModalPageList = document.querySelectorAll(".cn-cookie-link"), bannerContainer = document.querySelector("div#cn-banner"), bannerContent = document.querySelector("div.cn-banner-content"), modalContainer = document.querySelector("div.cn-modal-container"), acceptAllBtn = document.querySelector("button#cn-accept-banner"), denyAllBtn = document.querySelector("button#cn-deny-banner"), customizeBtn = document.querySelector("button#cn-settings-banner"), cookiesUnorderedList = document.querySelector("ul#cn-modal-list"), modalWrapper = document.querySelector("div.cn-modal-wrapper"), template = document.querySelector("div#cn-li-template"); if (!cookieContainer) { throw new Error("Cannot find div#cn-wrapper"); } @@ -41,24 +41,6 @@ export default class CookieNotice { if (!bannerContent) { throw new Error("Cannot find 'div.cn-banner-content' element"); } - if (!bannerDetails) { - throw new Error("Cannot find 'div.cn-banner-details' element"); - } - if (!bannerParaP) { - throw new Error("Cannot find 'div.cn-banner-para-p' element"); - } - if (!detailsTextOpen) { - throw new Error("Cannot find 'p.cn-banner-para-p-open' element"); - } - if (!detailsTextClose) { - throw new Error("Cannot find 'p.cn-banner-para-p-close' element"); - } - if (!bannerDetailsCollapseBtn) { - throw new Error("Cannot find 'button.cn-banner-btn-details-p' element"); - } - if (!bannerDetailsContainer) { - throw new Error("Cannot find '.cn-banner-btn-details' element"); - } if (!modalContainer) { throw new Error("Cannot find 'div.cn-modal-container' element"); } @@ -85,16 +67,10 @@ export default class CookieNotice { this.cookieLinkShowCustomizeModalList = cookieLinkShowCustomizeModalPageList; this.cookieContainer = cookieContainer; - this.bannerDetailsContainer = bannerDetailsContainer; this.bannerContainer = bannerContainer; this.bannerContent = bannerContent; this.cookiesUnorderedList = cookiesUnorderedList; this.modalWrapper = modalWrapper; - this.bannerParaP = bannerParaP; - this.detailsTextOpen = detailsTextOpen; - this.detailsTextClose = detailsTextClose; - this.bannerDetails = bannerDetails; - this.bannerDetailsCollapseBtn = bannerDetailsCollapseBtn; this.modalContainer = modalContainer; this.acceptAllBtn = acceptAllBtn; this.denyAllBtn = denyAllBtn; @@ -110,7 +86,6 @@ export default class CookieNotice { this.addEventPrevent(this.acceptAllBtn, "click", this.acceptAllCookies); this.addEventPrevent(this.denyAllBtn, "click", this.denyAllCookies); this.addEventPrevent(this.customizeBtn, "click", this.toggleCookieModalPages); - this.addEventPrevent(this.bannerDetailsCollapseBtn, "click", this.toggleBannerDetails); this.addEventPrevent(this.cookieShowModalBtn, "click", this.toggleCookieModal); this.cookieLinkShowCustomizeModalList.forEach((cookieLink) => { this.addEventPrevent(cookieLink, "click", this.openCookieModalToCookiePage); @@ -431,8 +406,6 @@ export default class CookieNotice { document.body.classList.add("cn-open"); this.resetCookieModal(); this.bannerContent.classList.add("d-none"); - this.bannerDetails.classList.add("d-none"); - this.bannerDetailsContainer.classList.add("d-none"); this.modalContainer.classList.remove("d-none"); // Scroll to the top of the cookies list this.modalWrapper.scrollTop = 0; @@ -495,8 +468,6 @@ export default class CookieNotice { */ resetCookieModal() { this.bannerContent.classList.remove("d-none"); - this.bannerDetails.classList.remove("d-none"); - this.bannerDetailsContainer.classList.remove("d-none"); this.modalContainer.classList.add("d-none"); if (!this.customizeBtn.dataset.openModal) { throw new Error("Cannot find attribut data-open-modal"); @@ -573,46 +544,11 @@ export default class CookieNotice { }); }); } - /** - * Toggle show hide banner details - */ - toggleBannerDetails() { - this.bannerDetails.classList.toggle("cn-details-open"); - if (!this.bannerDetailsCollapseBtn.dataset.open || - !this.bannerDetailsCollapseBtn.dataset.close) { - throw new Error("Cannot find attribute data-open or data-close"); - } - if (this.bannerDetailsAreExpanded) { - this.bannerDetailsCollapseBtn.innerHTML = - this.bannerDetailsCollapseBtn.dataset.close; - this.bannerDetailsCollapseBtn.title = - this.bannerDetailsCollapseBtn.dataset.close; - this.bannerDetailsCollapseBtn.ariaPressed = "false"; - this.detailsTextOpen.classList.add("d-none"); - this.detailsTextClose.classList.remove("d-none"); - this.bannerDetails.style.height = "0px"; - this.bannerDetailsAreExpanded = false; - } - else { - this.bannerDetailsCollapseBtn.innerHTML = - this.bannerDetailsCollapseBtn.dataset.open; - this.bannerDetailsCollapseBtn.title = - this.bannerDetailsCollapseBtn.dataset.open; - this.bannerDetailsCollapseBtn.ariaPressed = "true"; - this.detailsTextOpen.classList.remove("d-none"); - this.detailsTextClose.classList.add("d-none"); - this.bannerDetails.style.height = - this.bannerDetails.children[0].clientHeight + "px"; - this.bannerDetailsAreExpanded = true; - } - } /** * Toggle Cookie modal pages */ toggleCookieModalPages() { this.bannerContent.classList.toggle("d-none"); - this.bannerDetails.classList.toggle("d-none"); - this.bannerDetailsContainer.classList.toggle("d-none"); this.modalContainer.classList.toggle("d-none"); this.setTabIndex(); this.setupCookieModalList(); diff --git a/dist/typings/ts/index.d.ts b/dist/typings/ts/index.d.ts index 9e75edf..120d20c 100644 --- a/dist/typings/ts/index.d.ts +++ b/dist/typings/ts/index.d.ts @@ -15,13 +15,7 @@ export default class CookieNotice { modalContainer: HTMLDivElement; cookieShowModalBtn: HTMLButtonElement; cookieCloseModalBtn: HTMLButtonElement; - bannerDetailsCollapseBtn: HTMLButtonElement; - bannerParaP: HTMLDivElement; - detailsTextOpen: HTMLParagraphElement; - detailsTextClose: HTMLParagraphElement; bannerContent: HTMLDivElement; - bannerDetails: HTMLDivElement; - bannerDetailsContainer: HTMLDivElement; acceptAllBtn: HTMLButtonElement; denyAllBtn: HTMLButtonElement; customizeBtn: HTMLButtonElement; @@ -184,10 +178,6 @@ export default class CookieNotice { * Set the cookies list in the modal */ setupCookieModalList(): void; - /** - * Toggle show hide banner details - */ - toggleBannerDetails(): void; /** * Toggle Cookie modal pages */ diff --git a/dist/umd/css/standard.css b/dist/umd/css/standard.css index 6ae15ad..b1ca583 100644 --- a/dist/umd/css/standard.css +++ b/dist/umd/css/standard.css @@ -58,7 +58,7 @@ /* Accept/Deny btn settings */ /* Cookies list settings */ #cn-wrapper .cn-nav #cn-settings-banner, #cn-wrapper .cn-nav #cn-accept-banner, #cn-wrapper .cn-nav #cn-deny-banner, #cn-wrapper .cn-content .cn-modal-container .accept label, -#cn-wrapper .cn-content .cn-modal-container .deny label, #cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p { +#cn-wrapper .cn-content .cn-modal-container .deny label { display: flex; height: 3rem; flex-direction: column; @@ -71,13 +71,13 @@ font-size: 1rem; } #cn-wrapper .cn-nav #cn-settings-banner:hover, #cn-wrapper .cn-nav #cn-accept-banner:hover, #cn-wrapper .cn-nav #cn-deny-banner:hover, #cn-wrapper .cn-content .cn-modal-container .accept label:hover, -#cn-wrapper .cn-content .cn-modal-container .deny label:hover, #cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p:hover, #cn-wrapper .cn-nav #cn-settings-banner:focus, #cn-wrapper .cn-nav #cn-accept-banner:focus, #cn-wrapper .cn-nav #cn-deny-banner:focus, #cn-wrapper .cn-content .cn-modal-container .accept label:focus, -#cn-wrapper .cn-content .cn-modal-container .deny label:focus, #cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p:focus { +#cn-wrapper .cn-content .cn-modal-container .deny label:hover, #cn-wrapper .cn-nav #cn-settings-banner:focus, #cn-wrapper .cn-nav #cn-accept-banner:focus, #cn-wrapper .cn-nav #cn-deny-banner:focus, #cn-wrapper .cn-content .cn-modal-container .accept label:focus, +#cn-wrapper .cn-content .cn-modal-container .deny label:focus { background-color: #a0a0a0; color: #000; } #cn-wrapper .cn-nav #cn-settings-banner:focus, #cn-wrapper .cn-nav #cn-accept-banner:focus, #cn-wrapper .cn-nav #cn-deny-banner:focus, #cn-wrapper .cn-content .cn-modal-container .accept label:focus, -#cn-wrapper .cn-content .cn-modal-container .deny label:focus, #cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p:focus { +#cn-wrapper .cn-content .cn-modal-container .deny label:focus { outline-color: #000; } @@ -253,31 +253,6 @@ margin: 6px 0; text-align: justify; } -#cn-wrapper .cn-content .cn-banner-content .cn-banner-details { - display: flex; - overflow: hidden; - height: 0; - flex-direction: row; - align-items: flex-start; - justify-content: center; - text-align: justify; - transition: 0.3s; -} -#cn-wrapper .cn-content .cn-banner-content .cn-banner-details p { - padding-bottom: 1rem; -} -#cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details { - width: 100%; -} -#cn-wrapper .cn-content .cn-banner-content .cn-banner-btn-details-p { - display: inline-block; - width: 100%; - padding: 1rem 0; - margin: 0 auto; - cursor: pointer; - font-size: 14px; - text-align: center; -} #cn-wrapper .cn-content .cn-modal-container .cn-modal-title { color: #dc9c52; font-family: "Satisfy", sans-serif; diff --git a/dist/umd/main.js b/dist/umd/main.js index f5aa064..debed55 100644 --- a/dist/umd/main.js +++ b/dist/umd/main.js @@ -80,12 +80,6 @@ var CookieNotice = /*#__PURE__*/function () { cookieLinkShowCustomizeModalPageList = document.querySelectorAll(".cn-cookie-link"), bannerContainer = document.querySelector("div#cn-banner"), bannerContent = document.querySelector("div.cn-banner-content"), - bannerDetails = document.querySelector("div.cn-banner-details"), - bannerParaP = document.querySelector("div.cn-banner-para-p"), - detailsTextOpen = document.querySelector("p.cn-banner-para-p-open"), - detailsTextClose = document.querySelector("p.cn-banner-para-p-close"), - bannerDetailsCollapseBtn = document.querySelector("button.cn-banner-btn-details-p"), - bannerDetailsContainer = document.querySelector("div.cn-banner-btn-details"), modalContainer = document.querySelector("div.cn-modal-container"), acceptAllBtn = document.querySelector("button#cn-accept-banner"), denyAllBtn = document.querySelector("button#cn-deny-banner"), @@ -108,24 +102,6 @@ var CookieNotice = /*#__PURE__*/function () { if (!bannerContent) { throw new Error("Cannot find 'div.cn-banner-content' element"); } - if (!bannerDetails) { - throw new Error("Cannot find 'div.cn-banner-details' element"); - } - if (!bannerParaP) { - throw new Error("Cannot find 'div.cn-banner-para-p' element"); - } - if (!detailsTextOpen) { - throw new Error("Cannot find 'p.cn-banner-para-p-open' element"); - } - if (!detailsTextClose) { - throw new Error("Cannot find 'p.cn-banner-para-p-close' element"); - } - if (!bannerDetailsCollapseBtn) { - throw new Error("Cannot find 'button.cn-banner-btn-details-p' element"); - } - if (!bannerDetailsContainer) { - throw new Error("Cannot find '.cn-banner-btn-details' element"); - } if (!modalContainer) { throw new Error("Cannot find 'div.cn-modal-container' element"); } @@ -151,16 +127,10 @@ var CookieNotice = /*#__PURE__*/function () { this.cookieCloseModalBtn = cookieCloseModalBtn; this.cookieLinkShowCustomizeModalList = cookieLinkShowCustomizeModalPageList; this.cookieContainer = cookieContainer; - this.bannerDetailsContainer = bannerDetailsContainer; this.bannerContainer = bannerContainer; this.bannerContent = bannerContent; this.cookiesUnorderedList = cookiesUnorderedList; this.modalWrapper = modalWrapper; - this.bannerParaP = bannerParaP; - this.detailsTextOpen = detailsTextOpen; - this.detailsTextClose = detailsTextClose; - this.bannerDetails = bannerDetails; - this.bannerDetailsCollapseBtn = bannerDetailsCollapseBtn; this.modalContainer = modalContainer; this.acceptAllBtn = acceptAllBtn; this.denyAllBtn = denyAllBtn; @@ -177,7 +147,6 @@ var CookieNotice = /*#__PURE__*/function () { this.addEventPrevent(this.acceptAllBtn, "click", this.acceptAllCookies); this.addEventPrevent(this.denyAllBtn, "click", this.denyAllCookies); this.addEventPrevent(this.customizeBtn, "click", this.toggleCookieModalPages); - this.addEventPrevent(this.bannerDetailsCollapseBtn, "click", this.toggleBannerDetails); this.addEventPrevent(this.cookieShowModalBtn, "click", this.toggleCookieModal); this.cookieLinkShowCustomizeModalList.forEach(function (cookieLink) { _this.addEventPrevent(cookieLink, "click", _this.openCookieModalToCookiePage); @@ -633,8 +602,6 @@ var CookieNotice = /*#__PURE__*/function () { document.body.classList.add("cn-open"); this.resetCookieModal(); this.bannerContent.classList.add("d-none"); - this.bannerDetails.classList.add("d-none"); - this.bannerDetailsContainer.classList.add("d-none"); this.modalContainer.classList.remove("d-none"); // Scroll to the top of the cookies list this.modalWrapper.scrollTop = 0; @@ -708,8 +675,6 @@ var CookieNotice = /*#__PURE__*/function () { key: "resetCookieModal", value: function resetCookieModal() { this.bannerContent.classList.remove("d-none"); - this.bannerDetails.classList.remove("d-none"); - this.bannerDetailsContainer.classList.remove("d-none"); this.modalContainer.classList.add("d-none"); if (!this.customizeBtn.dataset.openModal) { throw new Error("Cannot find attribut data-open-modal"); @@ -798,35 +763,6 @@ var CookieNotice = /*#__PURE__*/function () { }); } - /** - * Toggle show hide banner details - */ - }, { - key: "toggleBannerDetails", - value: function toggleBannerDetails() { - this.bannerDetails.classList.toggle("cn-details-open"); - if (!this.bannerDetailsCollapseBtn.dataset.open || !this.bannerDetailsCollapseBtn.dataset.close) { - throw new Error("Cannot find attribute data-open or data-close"); - } - if (this.bannerDetailsAreExpanded) { - this.bannerDetailsCollapseBtn.innerHTML = this.bannerDetailsCollapseBtn.dataset.close; - this.bannerDetailsCollapseBtn.title = this.bannerDetailsCollapseBtn.dataset.close; - this.bannerDetailsCollapseBtn.ariaPressed = "false"; - this.detailsTextOpen.classList.add("d-none"); - this.detailsTextClose.classList.remove("d-none"); - this.bannerDetails.style.height = "0px"; - this.bannerDetailsAreExpanded = false; - } else { - this.bannerDetailsCollapseBtn.innerHTML = this.bannerDetailsCollapseBtn.dataset.open; - this.bannerDetailsCollapseBtn.title = this.bannerDetailsCollapseBtn.dataset.open; - this.bannerDetailsCollapseBtn.ariaPressed = "true"; - this.detailsTextOpen.classList.remove("d-none"); - this.detailsTextClose.classList.add("d-none"); - this.bannerDetails.style.height = this.bannerDetails.children[0].clientHeight + "px"; - this.bannerDetailsAreExpanded = true; - } - } - /** * Toggle Cookie modal pages */ @@ -834,8 +770,6 @@ var CookieNotice = /*#__PURE__*/function () { key: "toggleCookieModalPages", value: function toggleCookieModalPages() { this.bannerContent.classList.toggle("d-none"); - this.bannerDetails.classList.toggle("d-none"); - this.bannerDetailsContainer.classList.toggle("d-none"); this.modalContainer.classList.toggle("d-none"); this.setTabIndex(); this.setupCookieModalList(); diff --git a/dist/umd/main.js.map b/dist/umd/main.js.map index 3e50afd..ed5f5ab 100644 --- a/dist/umd/main.js.map +++ b/dist/umd/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICVqBA,YAAY;EAe7B;;EA8BA,SAAAA,aAAYC,MAAqC,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAH,YAAA;IAAAI,eAAA,4BA5C/B,SAAS;IAE7B;IAAAA,eAAA,yBACiB,CAAC;IAElB;IAAAA,eAAA,+BACuB,aAAa;IAEpC;IAAAA,eAAA,yBAC+B;MAC3BC,QAAQ,EAAEC,oBAAoB,CAACC,GAAG;MAClCC,MAAM,EAAE;IACZ,CAAC;IAiCG;IACA,IAAI,CAACP,MAAM,GAAGA,MAAM;;IAEpB;IACA,IAAIQ,oBAA+B,GAAG,IAAI,CAACC,yBAAyB,CAAC,CAAC;IACtE,IAAI,CAACD,oBAAoB,EAAE;MACvBA,oBAAoB,GAAG,IAAIE,IAAI,CAAC,CAAC;MACjCF,oBAAoB,CAACG,QAAQ,CAACH,oBAAoB,CAACI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GAAG;WACH;WACA;WACA,CAAC;;;;;WCPD,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;UElBA;UACA;UACA;UACA;UACA","sources":["webpack://CookieNotice/webpack/universalModuleDefinition","webpack://CookieNotice/./src/ts/index.ts","webpack://CookieNotice/webpack/bootstrap","webpack://CookieNotice/webpack/runtime/define property getters","webpack://CookieNotice/webpack/runtime/global","webpack://CookieNotice/webpack/runtime/hasOwnProperty shorthand","webpack://CookieNotice/webpack/runtime/make namespace object","webpack://CookieNotice/webpack/runtime/publicPath","webpack://CookieNotice/webpack/before-startup","webpack://CookieNotice/webpack/startup","webpack://CookieNotice/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CookieNotice\"] = factory();\n\telse\n\t\troot[\"CookieNotice\"] = factory();\n})(this, function() {\nreturn ","export default class CookieNotice {\n browserCookieName = \"cn-init\";\n\n /** Cookie life time */\n cookieTimeLife = 6;\n\n /** The index on which store the expiration date */\n cookieExpirationName = \"_expiration\";\n\n /** Cookie policies for each functionality */\n cookiePolicies: CookiePolicy = {\n sameSite: CookiePolicySameSite.lax,\n secure: \"\",\n };\n\n /** Cookie expiration date as specified in the cookie itself */\n cookieExpirationDate: Date;\n\n config: Record;\n modalBg: HTMLDivElement;\n cookieContainer: HTMLDivElement;\n bannerContainer: HTMLDivElement;\n modalContainer: HTMLDivElement;\n\n cookieShowModalBtn: HTMLButtonElement;\n cookieCloseModalBtn: HTMLButtonElement;\n bannerDetailsCollapseBtn: HTMLButtonElement;\n\n bannerParaP: HTMLDivElement;\n detailsTextOpen: HTMLParagraphElement;\n detailsTextClose: HTMLParagraphElement;\n\n bannerContent: HTMLDivElement;\n bannerDetails: HTMLDivElement;\n bannerDetailsContainer: HTMLDivElement;\n acceptAllBtn: HTMLButtonElement;\n denyAllBtn: HTMLButtonElement;\n customizeBtn: HTMLButtonElement;\n cookiesUnorderedList: HTMLUListElement;\n cookieLinkShowCustomizeModalList: NodeListOf;\n modalWrapper: HTMLDivElement;\n template: HTMLDivElement;\n bannerDetailsAreExpanded: boolean;\n static noConflict: (deep?: boolean) => typeof CookieNotice;\n\n constructor(config: Record) {\n // * Setup Config\n this.config = config;\n\n // * Setup cookie expiration date\n let cookieExpirationDate: Date|null = this.readCookiesExpirationDate();\n if (!cookieExpirationDate) {\n cookieExpirationDate = new Date();\n cookieExpirationDate.setMonth(cookieExpirationDate.getMonth() + this.cookieTimeLife);\n }\n this.cookieExpirationDate = cookieExpirationDate;\n\n // * Inject DOM modal BG\n const modalBg = document.createElement(\"div\");\n modalBg.classList.add(\"cn-modal-bg\");\n document.body.append(modalBg);\n this.modalBg = modalBg;\n\n // * Setup Dom Elements\n const cookieContainer = document.querySelector(\n \"div#cn-wrapper\"\n ) as HTMLDivElement | null,\n cookieShowModalBtn = document.querySelector(\n \"button#cn-cookie-btn\"\n ) as HTMLButtonElement | null,\n cookieCloseModalBtn = document.querySelector(\n \"button#cn-close-modal\"\n ) as HTMLButtonElement | null,\n cookieLinkShowCustomizeModalPageList = document.querySelectorAll(\n \".cn-cookie-link\"\n ) as NodeListOf,\n bannerContainer = document.querySelector(\n \"div#cn-banner\"\n ) as HTMLDivElement | null,\n bannerContent = document.querySelector(\n \"div.cn-banner-content\"\n ) as HTMLDivElement | null,\n bannerDetails = document.querySelector(\n \"div.cn-banner-details\"\n ) as HTMLDivElement | null,\n bannerParaP = document.querySelector(\n \"div.cn-banner-para-p\"\n ) as HTMLDivElement | null,\n detailsTextOpen = document.querySelector(\n \"p.cn-banner-para-p-open\"\n ) as HTMLParagraphElement | null,\n detailsTextClose = document.querySelector(\n \"p.cn-banner-para-p-close\"\n ) as HTMLParagraphElement | null,\n bannerDetailsCollapseBtn = document.querySelector(\n \"button.cn-banner-btn-details-p\"\n ) as HTMLButtonElement | null,\n bannerDetailsContainer = document.querySelector(\n \"div.cn-banner-btn-details\"\n ) as HTMLDivElement | null,\n modalContainer = document.querySelector(\n \"div.cn-modal-container\"\n ) as HTMLDivElement | null,\n acceptAllBtn = document.querySelector(\n \"button#cn-accept-banner\"\n ) as HTMLButtonElement | null,\n denyAllBtn = document.querySelector(\n \"button#cn-deny-banner\"\n ) as HTMLButtonElement | null,\n customizeBtn = document.querySelector(\n \"button#cn-settings-banner\"\n ) as HTMLButtonElement | null,\n cookiesUnorderedList = document.querySelector(\n \"ul#cn-modal-list\"\n ) as HTMLUListElement | null,\n modalWrapper = document.querySelector(\n \"div.cn-modal-wrapper\"\n ) as HTMLDivElement,\n template = document.querySelector(\n \"div#cn-li-template\"\n ) as HTMLDivElement | null;\n if (!cookieContainer) {\n throw new Error(\"Cannot find div#cn-wrapper\");\n }\n if (!cookieShowModalBtn) {\n throw new Error(\"Cannot find 'button#cn-cookie-btn' element\");\n }\n if (!cookieCloseModalBtn) {\n throw new Error(\"Cannot find 'button#cn-close-modal' element\");\n }\n if (!bannerContainer) {\n throw new Error(\"Cannot find 'div#cn-banner' element\");\n }\n if (!bannerContent) {\n throw new Error(\"Cannot find 'div.cn-banner-content' element\");\n }\n if (!bannerDetails) {\n throw new Error(\"Cannot find 'div.cn-banner-details' element\");\n }\n if (!bannerParaP) {\n throw new Error(\"Cannot find 'div.cn-banner-para-p' element\");\n }\n if (!detailsTextOpen) {\n throw new Error(\"Cannot find 'p.cn-banner-para-p-open' element\");\n }\n if (!detailsTextClose) {\n throw new Error(\"Cannot find 'p.cn-banner-para-p-close' element\");\n }\n if (!bannerDetailsCollapseBtn) {\n throw new Error(\n \"Cannot find 'button.cn-banner-btn-details-p' element\"\n );\n }\n if (!bannerDetailsContainer) {\n throw new Error(\"Cannot find '.cn-banner-btn-details' element\");\n }\n if (!modalContainer) {\n throw new Error(\"Cannot find 'div.cn-modal-container' element\");\n }\n if (!acceptAllBtn) {\n throw new Error(\"Cannot find 'button#cn-accept-banner' element\");\n }\n if (!denyAllBtn) {\n throw new Error(\"Cannot find 'button#cn-deny-banner' element\");\n }\n if (!customizeBtn) {\n throw new Error(\"Cannot find 'button.cn-settings-banner' element\");\n }\n if (!cookiesUnorderedList) {\n throw new Error(\"Cannot find 'ul#cn-modal-list' element\");\n }\n if (!modalWrapper) {\n throw new Error(\"Cannot find 'div.cn-modal-wrapper' element\");\n }\n if (!template) {\n throw new Error(\"Cannot find 'div#cn-li-template' element\");\n }\n\n this.cookieShowModalBtn = cookieShowModalBtn;\n this.cookieCloseModalBtn = cookieCloseModalBtn;\n this.cookieLinkShowCustomizeModalList =\n cookieLinkShowCustomizeModalPageList;\n this.cookieContainer = cookieContainer;\n this.bannerDetailsContainer = bannerDetailsContainer;\n this.bannerContainer = bannerContainer;\n this.bannerContent = bannerContent;\n this.cookiesUnorderedList = cookiesUnorderedList;\n this.modalWrapper = modalWrapper;\n this.bannerParaP = bannerParaP;\n this.detailsTextOpen = detailsTextOpen;\n this.detailsTextClose = detailsTextClose;\n this.bannerDetails = bannerDetails;\n this.bannerDetailsCollapseBtn = bannerDetailsCollapseBtn;\n this.modalContainer = modalContainer;\n this.acceptAllBtn = acceptAllBtn;\n this.denyAllBtn = denyAllBtn;\n this.customizeBtn = customizeBtn;\n\n this.bannerDetailsAreExpanded = false;\n this.template = template;\n const memoryTemplate = this.template.cloneNode(true) as HTMLDivElement;\n this.template.remove();\n this.template = memoryTemplate;\n\n // * Setup Events\n this.addEventPrevent(this.modalBg, \"click\", this.closeCookieModal);\n this.addEventPrevent(\n this.cookieCloseModalBtn,\n \"click\",\n this.closeCookieModal\n );\n this.addEventPrevent(this.acceptAllBtn, \"click\", this.acceptAllCookies);\n this.addEventPrevent(this.denyAllBtn, \"click\", this.denyAllCookies);\n this.addEventPrevent(\n this.customizeBtn,\n \"click\",\n this.toggleCookieModalPages\n );\n this.addEventPrevent(\n this.bannerDetailsCollapseBtn,\n \"click\",\n this.toggleBannerDetails\n );\n this.addEventPrevent(\n this.cookieShowModalBtn,\n \"click\",\n this.toggleCookieModal\n );\n this.cookieLinkShowCustomizeModalList.forEach((cookieLink) => {\n this.addEventPrevent(\n cookieLink,\n \"click\",\n this.openCookieModalToCookiePage\n );\n this.addEventKbdValidate(cookieLink, this.openCookieModalToCookiePage);\n });\n\n // * Setup CN Cookie\n if (!this.cookiesMatchesConfig() || this.cookiesOlderThan(new Date())) {\n // * Setup Browser Cookie if none.\n this.resetBrowserCookie();\n this.openCookieModalToBannerPage();\n }\n\n // * Cookie should have been created from here.\n const cookies = this.getCookieStatusList();\n Object.entries(cookies).forEach(([cookieName, cookieStatus]) => {\n if (cookieStatus === CookieStatus.wait) {\n // * Open modal if any cookie config is not set.\n this.openCookieModalToBannerPage();\n return;\n }\n if (!this.config[cookieName]) {\n // * Ignore missing config\n return;\n }\n if (cookieStatus === CookieStatus.true) {\n // * Exec script part for accepted cookie.\n this.config[cookieName].script();\n return;\n }\n if (this.config[cookieName].fallback != null) {\n // * Exec fallback part for accepted cookie if provided.\n this.config[cookieName].fallback();\n }\n });\n }\n\n // COOKIES\n\n /**\n * Get cookies expiration date or null if not defined alread\n */\n readCookiesExpirationDate(): Date | null {\n const cookies = this.getBrowserCookieValue() ?? \"\",\n expirationDateString = cookies.split(\",\").find((cookieString) =>\n cookieString.startsWith(this.cookieExpirationName));\n if (!expirationDateString) {\n return null;\n }\n try {\n const epochExpiration = Number.parseInt(expirationDateString.replace(`${this.cookieExpirationName}=`, \"\"));\n if (isNaN(epochExpiration)) {\n return null;\n }\n return new Date(epochExpiration);\n } catch (e) {\n return null;\n }\n }\n\n /**\n * Check if the cookies date are older than a specified date\n\n * @param date The limit date for cookies\n */\n cookiesOlderThan(date: Date): boolean {\n return this.cookieExpirationDate.getTime() < date.getTime();\n }\n\n /**\n * Check if the actual cookie matches the config\n */\n cookiesMatchesConfig(): boolean {\n const cookies = this.getCookieStatusList();\n return Object.keys(cookies).length === Object.keys(this.config).length;\n }\n\n /**\n * Accept a specific cookie\n */\n acceptAllCookies() {\n Object.entries(this.config).forEach(([cookieName, cookieOption]) =>\n this.setCookieStatus(cookieName, CookieStatus.true, cookieOption)\n );\n for (const acceptLabel of this.cookieContainer.querySelectorAll(\n \".accept > label\"\n )) {\n acceptLabel.classList.add(\"active\");\n }\n for (const denyLabel of this.cookieContainer.querySelectorAll(\n \".deny > label\"\n )) {\n denyLabel.classList.remove(\"active\");\n }\n this.closeCookieModal();\n }\n\n /**\n * Deny a specific cookie\n */\n denyAllCookies() {\n Object.entries(this.config).forEach(([cookieName, cookieOption]) =>\n this.setCookieStatus(cookieName, CookieStatus.false, cookieOption)\n );\n for (const acceptLabel of this.cookieContainer.querySelectorAll(\n \".accept > label\"\n )) {\n acceptLabel.classList.remove(\"active\");\n }\n for (const denyLabel of this.cookieContainer.querySelectorAll(\n \".deny > label\"\n )) {\n denyLabel.classList.add(\"active\");\n }\n this.closeCookieModal();\n }\n\n /**\n * Fetch the cookie status list\n *\n * @returns the cookie status list\n */\n getCookieStatusList(): CookieStatusList {\n const cookies = this.getBrowserCookieValue(),\n statusList: CookieStatusList = {};\n if (cookies === undefined) {\n return statusList;\n }\n /** specificCookieString contains youtube=true like */\n cookies.split(\",\")\n // * Ignore timestamp\n .filter((specificCookieString) => !specificCookieString.startsWith(this.cookieExpirationName))\n .forEach((specificCookieString) => {\n const values = specificCookieString.split(\"=\");\n statusList[values[0]] = values[1] as CookieStatus;\n });\n return statusList;\n }\n\n /**\n * Check has cookie status\n *\n * @param key\n * @param value\n */\n containsCookieStatus(key: string): boolean {\n const statusList: CookieStatusList = this.getCookieStatusList();\n return (\n Object.keys(statusList).find((cookieName) => cookieName === key) !==\n undefined\n );\n }\n\n /**\n * Set the cookie value\n *\n * @param cookieName\n * @param status\n * @param cookieOption\n */\n setCookieStatus(\n cookieName: string,\n status: CookieStatus,\n cookieOption: CookieOptions\n ) {\n if (status === CookieStatus.true) {\n this.addCookieStatus(cookieName, cookieOption);\n return;\n }\n if (status === CookieStatus.false) {\n this.removeCookieStatus(cookieName, cookieOption);\n return;\n }\n this.setBrowserCookieStatus(cookieName, CookieStatus.wait);\n }\n\n /**\n * Add a specific cookie and\n * change his status to true\n *\n * @param cookieName\n * @param cookieOption\n */\n addCookieStatus(cookieName: string, cookieOption: CookieOptions) {\n if (cookieOption.script) {\n cookieOption.script();\n }\n this.setBrowserCookieStatus(cookieName, CookieStatus.true);\n }\n\n /**\n * Remove a specific cookie and\n * change his status to false\n *\n * @param cookieName\n * @param cookieOption\n */\n removeCookieStatus(cookieName: string, cookieOption: CookieOptions) {\n const cookieNameElement = document.getElementById(cookieName);\n if (cookieNameElement) {\n cookieNameElement.remove();\n }\n if (cookieOption.fallback) {\n cookieOption.fallback();\n }\n this.setBrowserCookieStatus(cookieName, CookieStatus.false);\n }\n\n /**\n * Change the status of a cookie\n *\n * @param cookieName\n * @param status\n */\n setBrowserCookieStatus(cookieName: string, status: CookieStatus) {\n const statusList: CookieStatusList = this.getCookieStatusList();\n // * Force refresh\n this.deleteBrowserCookie();\n statusList[cookieName] = status;\n this.saveBrowserCookie(statusList);\n }\n\n /**\n * Has CN cokie setup ?\n * @returns true if the cookie is setup\n */\n hasBrowserCookie(): boolean {\n return Boolean(this.getBrowserCookieValue());\n }\n\n /**\n * Get the Ldcweb cookie\n *\n * @returns A string like analytics=true,youtube=true or undefined\n */\n getBrowserCookieValue() {\n const matches = document.cookie.match(\n new RegExp(\n \"(?:^|; )\" +\n this.browserCookieName.replace(\n /([.$?*|{}()[\\]\\\\/+^])/g,\n \"\\\\$1\"\n ) +\n \"=([^;]*)\"\n )\n );\n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n\n /**\n * Save cookie content on web browser\n *\n * @param list\n */\n saveBrowserCookie(statusList: CookieStatusList) {\n const date = new Date(),\n content = Object.entries(statusList)\n .map(([cookieName, cookieStatus]) => {\n return `${cookieName}=${cookieStatus}`;\n });\n // * Update expiration date\n this.cookieExpirationDate = new Date(date.setMonth(date.getMonth() + this.cookieTimeLife));\n // * Append expiration date\n content.push(`${this.cookieExpirationName}=${this.cookieExpirationDate.getTime()}`);\n document.cookie = `${this.browserCookieName}=${content.join(\",\")};path=/${\n location.hostname ? `;domain=${location.hostname}` : \"\"\n };expires=${this.cookieExpirationDate.toUTCString()};${this.getCookiePoliciesAsString()}`;\n }\n\n /**\n * Set an older expire parameter to a specific cookie\n */\n deleteBrowserCookie() {\n if (this.hasBrowserCookie()) {\n // * Suppression du cookie et de sa version precedé d'un point\n document.cookie = `${this.browserCookieName}=;path=/${\n location.hostname ? `;domain=.${location.hostname}` : \"\"\n };expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\n document.cookie = `${this.browserCookieName}=;path=/${\n location.hostname ? `;domain=${location.hostname}` : \"\"\n };expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\n }\n }\n\n getCookiePoliciesAsString(): string {\n return Object.entries(this.cookiePolicies)\n .map(([policyName, policyValue]) => `${policyName}=${policyValue}`)\n .join(\";\");\n }\n\n /**\n * Reset Ldc Web CN cookie\n */\n resetBrowserCookie() {\n // * Create Cookie as It does not exists.\n const newCookieList: CookieStatusList = {};\n Object.entries(this.config).forEach(\n ([cookieName]) => (newCookieList[cookieName] = CookieStatus.wait)\n );\n this.saveBrowserCookie(newCookieList);\n }\n\n // LISTENERS\n\n /**\n * Add event on a specific element\n *\n * @param element\n * @param evnt\n * @param funct\n * @returns\n */\n addEvent(element: HTMLElement, evnt: string, funct: (e: Event) => void) {\n return element.addEventListener(evnt, funct.bind(this), false);\n }\n\n /**\n * Add event on a specific element and prevent default\n *\n * @param element\n * @param evnt\n * @param funct\n * @returns\n */\n addEventPrevent(\n element: HTMLElement,\n evnt: string,\n funct: (e: Event) => void\n ) {\n return element.addEventListener(\n evnt,\n (e) => {\n e.preventDefault();\n funct.call(this, e);\n },\n false\n );\n }\n\n /**\n * Add event on a specific element\n *\n * @param element\n * @param evnt\n * @param funct\n * @returns\n */\n addEventKbdValidate(element: HTMLElement, funct: (e: Event) => void) {\n return this.addEvent(element, \"keydown\", (e: Event) => {\n const kbdEvt = e as KeyboardEvent;\n if (\n kbdEvt.key == \" \" ||\n kbdEvt.code == \"Space\" ||\n kbdEvt.keyCode == 32 ||\n kbdEvt.key == \"Enter\" ||\n kbdEvt.code == \"Enter\" ||\n kbdEvt.keyCode == 13\n ) {\n funct.call(this, kbdEvt);\n e.preventDefault();\n }\n });\n }\n\n // COOKIE MODAL\n\n /**\n * Show or hide Cookie modal\n * @returns\n */\n toggleCookieModal() {\n if (!document.body.classList.contains(\"cn-open\")) {\n this.openCookieModalToBannerPage();\n return;\n }\n this.closeCookieModal();\n }\n\n /**\n * Open the cookies modal to the banner page\n */\n openCookieModalToBannerPage() {\n this.openCookieModalToCookiePage();\n this.toggleCookieModalPages();\n }\n\n /**\n * Open the cookies modal to the cookies page\n */\n openCookieModalToCookiePage() {\n document.body.classList.add(\"cn-open\");\n this.resetCookieModal();\n\n this.bannerContent.classList.add(\"d-none\");\n this.bannerDetails.classList.add(\"d-none\");\n this.bannerDetailsContainer.classList.add(\"d-none\");\n this.modalContainer.classList.remove(\"d-none\");\n // Scroll to the top of the cookies list\n this.modalWrapper.scrollTop = 0;\n this.setupCookieModalList();\n this.setTabIndex();\n }\n\n /**\n * Hide the cookies modal\n */\n closeCookieModal() {\n document.body.classList.remove(\"cn-open\");\n this.unsetTabIndex();\n this.setupCookieModalList();\n }\n\n /**\n * Setup tab indexes on visible elements\n */\n setTabIndex() {\n // * Prevent focus html tag\n document.documentElement.setAttribute(\"tabindex\", \"-1\");\n setTimeout(() => {\n const focusableSelector =\n \"a[href], button, [role=\\\"button\\\"], input, embed, object, iframe, textarea, select, details, [tabindex]:not([tabindex=\\\"-1\\\"])\";\n\n // * Only focusable elements\n [...document.body.querySelectorAll(focusableSelector)]\n .filter(\n (el) =>\n !el.hasAttribute(\"disabled\") &&\n !el.getAttribute(\"aria-hidden\")\n )\n .forEach((el) => {\n (el as HTMLElement).setAttribute(\"tabindex\", \"-1\");\n (el as HTMLElement).classList.add(\"cn-disabled\");\n });\n [...this.cookieContainer.querySelectorAll(focusableSelector)]\n .filter(\n (el) =>\n !el.hasAttribute(\"disabled\") &&\n !el.getAttribute(\"aria-hidden\") &&\n // * Only visible elements\n !!(\n (el as HTMLElement).offsetWidth ||\n (el as HTMLElement).offsetHeight ||\n el.getClientRects().length\n )\n )\n .forEach((el) => {\n (el as HTMLElement).setAttribute(\"tabindex\", \"0\");\n (el as HTMLElement).classList.remove(\"cn-disabled\");\n });\n this.cookieShowModalBtn.setAttribute(\"tabindex\", \"-1\");\n }, 500);\n }\n\n /**\n * Undo setup tab indexes on visible elements\n */\n unsetTabIndex() {\n document.documentElement.setAttribute(\"tabindex\", \"0\");\n setTimeout(() => {\n document.body.querySelectorAll(\".cn-disabled\").forEach((el) => {\n (el as HTMLElement).setAttribute(\"tabindex\", \"0\");\n (el as HTMLElement).classList.remove(\"cn-disabled\");\n });\n this.cookieShowModalBtn.setAttribute(\"tabindex\", \"0\");\n }, 500);\n }\n\n /**\n * Reset the modal view state\n */\n resetCookieModal() {\n this.bannerContent.classList.remove(\"d-none\");\n this.bannerDetails.classList.remove(\"d-none\");\n this.bannerDetailsContainer.classList.remove(\"d-none\");\n this.modalContainer.classList.add(\"d-none\");\n if (!this.customizeBtn.dataset.openModal) {\n throw new Error(\"Cannot find attribut data-open-modal\");\n }\n this.customizeBtn.innerHTML = this.customizeBtn.dataset.openModal;\n }\n\n /**\n * Set the cookies list in the modal\n */\n setupCookieModalList() {\n this.cookiesUnorderedList.innerHTML = \"\";\n Object.entries(this.config).forEach(([cookieName, cookieConfig]) => {\n const cookie = document.createElement(\"li\");\n const childItem = this.template.children.item(\n 0\n ) as HTMLDivElement | null;\n if (childItem === null) {\n throw new Error(\"Cannot find child item\");\n }\n cookie.append(childItem.cloneNode(true));\n const name = cookie.querySelector(\n \"span.cn-cookie-name\"\n ) as HTMLSpanElement;\n const description = cookie.querySelector(\n \"span.cn-cookie-description\"\n ) as HTMLSpanElement;\n const link = cookie.querySelector(\n \".cn-cookie-link\"\n ) as HTMLElement;\n const acceptInput = cookie.querySelector(\n \".accept > input\"\n ) as HTMLInputElement;\n const denyInput = cookie.querySelector(\n \".deny > input\"\n ) as HTMLInputElement;\n const acceptLabel = cookie.querySelector(\n \".accept > label\"\n ) as HTMLLabelElement;\n const denyLabel = cookie.querySelector(\n \".deny > label\"\n ) as HTMLLabelElement;\n\n name.textContent = cookieConfig.name;\n description.textContent = cookieConfig.description;\n link.textContent = cookieConfig.labelLink;\n link.setAttribute(\"href\", cookieConfig.link);\n acceptInput.id = cookieName + \"1\";\n acceptInput.name = cookieName;\n acceptInput.dataset.name = cookieName;\n acceptLabel.htmlFor = cookieName + \"1\";\n acceptLabel.textContent = `${acceptLabel.textContent} ${cookieName}`;\n acceptLabel.title = `${acceptLabel.textContent} ${cookieName}`;\n denyInput.id = cookieName + \"2\";\n denyInput.name = cookieName;\n denyInput.dataset.name = cookieName;\n denyLabel.htmlFor = cookieName + \"2\";\n denyLabel.textContent = `${denyLabel.textContent} ${cookieName}`;\n denyLabel.title = `${denyLabel.textContent} ${cookieName}`;\n\n const acceptFn = () => {\n acceptLabel.classList.add(\"active\");\n denyLabel.classList.remove(\"active\");\n this.setCookieStatus(\n cookieName,\n CookieStatus.true,\n cookieConfig\n );\n },\n denyFn = () => {\n acceptLabel.classList.remove(\"active\");\n denyLabel.classList.add(\"active\");\n this.setCookieStatus(\n cookieName,\n CookieStatus.false,\n cookieConfig\n );\n };\n this.addEvent(acceptInput, \"click\", acceptFn);\n this.addEventKbdValidate(acceptLabel, acceptFn);\n this.addEvent(denyInput, \"click\", denyFn);\n this.addEventKbdValidate(denyLabel, denyFn);\n\n this.cookiesUnorderedList.append(cookie);\n\n if (!this.hasBrowserCookie()) {\n // * Ldcweb cookie is not set.\n return;\n }\n // * Setup list status state\n Object.entries(this.getCookieStatusList()).forEach(\n ([ckName, cookieStatus]) => {\n if (ckName === cookieName) {\n acceptLabel.classList.remove(\"active\");\n denyLabel.classList.remove(\"active\");\n switch (cookieStatus) {\n case CookieStatus.true:\n acceptLabel.classList.add(\"active\");\n break;\n case CookieStatus.false:\n denyLabel.classList.add(\"active\");\n break;\n }\n }\n }\n );\n });\n }\n\n /**\n * Toggle show hide banner details\n */\n toggleBannerDetails() {\n this.bannerDetails.classList.toggle(\"cn-details-open\");\n\n if (\n !this.bannerDetailsCollapseBtn.dataset.open ||\n !this.bannerDetailsCollapseBtn.dataset.close\n ) {\n throw new Error(\"Cannot find attribute data-open or data-close\");\n }\n\n if (this.bannerDetailsAreExpanded) {\n this.bannerDetailsCollapseBtn.innerHTML =\n this.bannerDetailsCollapseBtn.dataset.close;\n this.bannerDetailsCollapseBtn.title =\n this.bannerDetailsCollapseBtn.dataset.close;\n this.bannerDetailsCollapseBtn.ariaPressed = \"false\";\n this.detailsTextOpen.classList.add(\"d-none\");\n this.detailsTextClose.classList.remove(\"d-none\");\n this.bannerDetails.style.height = \"0px\";\n this.bannerDetailsAreExpanded = false;\n } else {\n this.bannerDetailsCollapseBtn.innerHTML =\n this.bannerDetailsCollapseBtn.dataset.open;\n this.bannerDetailsCollapseBtn.title =\n this.bannerDetailsCollapseBtn.dataset.open;\n this.bannerDetailsCollapseBtn.ariaPressed = \"true\";\n this.detailsTextOpen.classList.remove(\"d-none\");\n this.detailsTextClose.classList.add(\"d-none\");\n this.bannerDetails.style.height =\n this.bannerDetails.children[0].clientHeight + \"px\";\n this.bannerDetailsAreExpanded = true;\n }\n }\n\n /**\n * Toggle Cookie modal pages\n */\n toggleCookieModalPages() {\n this.bannerContent.classList.toggle(\"d-none\");\n this.bannerDetails.classList.toggle(\"d-none\");\n this.bannerDetailsContainer.classList.toggle(\"d-none\");\n this.modalContainer.classList.toggle(\"d-none\");\n this.setTabIndex();\n this.setupCookieModalList();\n this.togglePersonalizeBtn();\n }\n\n /**\n * Toggle customize btn\n */\n togglePersonalizeBtn() {\n const customizeBtnBannerDataset = this.customizeBtn.dataset;\n this.modalWrapper.scrollTop = 0;\n if (this.bannerContent.classList.contains(\"d-none\")) {\n this.customizeBtn.innerHTML =\n customizeBtnBannerDataset.openModal as string;\n this.customizeBtn.title = customizeBtnBannerDataset.openModal as string;\n } else {\n this.customizeBtn.innerHTML =\n customizeBtnBannerDataset.closeModal as string;\n this.customizeBtn.title = customizeBtnBannerDataset.closeModal as string;\n }\n }\n}\n\nenum CookieStatus {\n true = \"true\",\n false = \"false\",\n wait = \"wait\",\n}\n\ntype CookieStatusList = Record;\n\ntype CookiePolicy = {\n sameSite: CookiePolicySameSite;\n secure: string;\n};\n\nenum CookiePolicySameSite {\n lax = \"lax\",\n strict = \"strict\",\n none = \"none\",\n}\n\nexport type CookieOptions = {\n name: string;\n description: string;\n link: string;\n labelLink: string;\n cookies: string[];\n /**\n * Fonction qui sert à initialiser la fonctionnalité\n * conduisant à la génération du cookie\n * @return void\n */\n script: () => void;\n /**\n * Fonction qui sert à informer l'utilisateur\n * sur chaque élèment que le cookie\n * associé à la fonctionnalité\n * est désactivé et propose un lien sur\n * cookie notice pour l'activer\n * @return void\n */\n fallback: () => void | null;\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","","// startup\n// Load entry module and return exports\n__webpack_require__(\"./src/ts/index.ts\");\n// This entry module doesn't tell about it's top-level declarations so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/scss/themes/standard.scss\");\n",""],"names":["CookieNotice","config","_this","_classCallCheck","_defineProperty","sameSite","CookiePolicySameSite","lax","secure","cookieExpirationDate","readCookiesExpirationDate","Date","setMonth","getMonth","cookieTimeLife","modalBg","document","createElement","classList","add","body","append","cookieContainer","querySelector","cookieShowModalBtn","cookieCloseModalBtn","cookieLinkShowCustomizeModalPageList","querySelectorAll","bannerContainer","bannerContent","bannerDetails","bannerParaP","detailsTextOpen","detailsTextClose","bannerDetailsCollapseBtn","bannerDetailsContainer","modalContainer","acceptAllBtn","denyAllBtn","customizeBtn","cookiesUnorderedList","modalWrapper","template","Error","cookieLinkShowCustomizeModalList","bannerDetailsAreExpanded","memoryTemplate","cloneNode","remove","addEventPrevent","closeCookieModal","acceptAllCookies","denyAllCookies","toggleCookieModalPages","toggleBannerDetails","toggleCookieModal","forEach","cookieLink","openCookieModalToCookiePage","addEventKbdValidate","cookiesMatchesConfig","cookiesOlderThan","resetBrowserCookie","openCookieModalToBannerPage","cookies","getCookieStatusList","Object","entries","_ref","_ref2","_slicedToArray","cookieName","cookieStatus","CookieStatus","wait","true","script","fallback","_createClass","key","value","_this$getBrowserCooki","_this2","getBrowserCookieValue","expirationDateString","split","find","cookieString","startsWith","cookieExpirationName","epochExpiration","Number","parseInt","replace","concat","isNaN","e","date","getTime","keys","length","_this3","_ref3","_ref4","cookieOption","setCookieStatus","_iterator","_createForOfIteratorHelper","_step","s","n","done","acceptLabel","err","f","_iterator2","_step2","denyLabel","_this4","_ref5","_ref6","false","_iterator3","_step3","_iterator4","_step4","_this5","statusList","undefined","filter","specificCookieString","values","containsCookieStatus","status","addCookieStatus","removeCookieStatus","setBrowserCookieStatus","cookieNameElement","getElementById","deleteBrowserCookie","saveBrowserCookie","hasBrowserCookie","Boolean","matches","cookie","match","RegExp","browserCookieName","decodeURIComponent","content","map","_ref7","_ref8","push","join","location","hostname","toUTCString","getCookiePoliciesAsString","cookiePolicies","_ref9","_ref10","policyName","policyValue","newCookieList","_ref11","_ref12","addEvent","element","evnt","funct","addEventListener","bind","_this6","preventDefault","call","_this7","kbdEvt","code","keyCode","contains","resetCookieModal","scrollTop","setupCookieModalList","setTabIndex","unsetTabIndex","_this8","documentElement","setAttribute","setTimeout","focusableSelector","_toConsumableArray","el","hasAttribute","getAttribute","offsetWidth","offsetHeight","getClientRects","_this9","dataset","openModal","innerHTML","_this10","_ref13","_ref14","cookieConfig","childItem","children","item","name","description","link","acceptInput","denyInput","textContent","labelLink","id","htmlFor","title","acceptFn","denyFn","_ref15","_ref16","ckName","toggle","open","close","ariaPressed","style","height","clientHeight","togglePersonalizeBtn","customizeBtnBannerDataset","closeModal","default"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"main.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICVqBA,YAAY;EAe7B;;EAuBA,SAAAA,aAAYC,MAAqC,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAH,YAAA;IAAAI,eAAA,4BArC/B,SAAS;IAE7B;IAAAA,eAAA,yBACiB,CAAC;IAElB;IAAAA,eAAA,+BACuB,aAAa;IAEpC;IAAAA,eAAA,yBAC+B;MAC3BC,QAAQ,EAAEC,oBAAoB,CAACC,GAAG;MAClCC,MAAM,EAAE;IACZ,CAAC;IA0BG;IACA,IAAI,CAACP,MAAM,GAAGA,MAAM;;IAEpB;IACA,IAAIQ,oBAA+B,GAAG,IAAI,CAACC,yBAAyB,CAAC,CAAC;IACtE,IAAI,CAACD,oBAAoB,EAAE;MACvBA,oBAAoB,GAAG,IAAIE,IAAI,CAAC,CAAC;MACjCF,oBAAoB,CAACG,QAAQ,CAACH,oBAAoB,CAACI,QAAQ,CAAC,CAAC,GAAG,IAAI,CAACC,cAAc,CAAC;IACxF;IACA,IAAI,CAACL,oBAAoB,GAAGA,oBAAoB;;IAEhD;IACA,IAAMM,OAAO,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;IAC7CF,OAAO,CAACG,SAAS,CAACC,GAAG,CAAC,aAAa,CAAC;IACpCH,QAAQ,CAACI,IAAI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aZ5D,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA,EAApBA,oBAAoB;;;;;;;;;;;;;;;;UC5xBzB;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;WCPD,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;UElBA;UACA;UACA;UACA;UACA","sources":["webpack://CookieNotice/webpack/universalModuleDefinition","webpack://CookieNotice/./src/ts/index.ts","webpack://CookieNotice/webpack/bootstrap","webpack://CookieNotice/webpack/runtime/define property getters","webpack://CookieNotice/webpack/runtime/global","webpack://CookieNotice/webpack/runtime/hasOwnProperty shorthand","webpack://CookieNotice/webpack/runtime/make namespace object","webpack://CookieNotice/webpack/runtime/publicPath","webpack://CookieNotice/webpack/before-startup","webpack://CookieNotice/webpack/startup","webpack://CookieNotice/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CookieNotice\"] = factory();\n\telse\n\t\troot[\"CookieNotice\"] = factory();\n})(this, function() {\nreturn ","export default class CookieNotice {\n browserCookieName = \"cn-init\";\n\n /** Cookie life time */\n cookieTimeLife = 6;\n\n /** The index on which store the expiration date */\n cookieExpirationName = \"_expiration\";\n\n /** Cookie policies for each functionality */\n cookiePolicies: CookiePolicy = {\n sameSite: CookiePolicySameSite.lax,\n secure: \"\",\n };\n\n /** Cookie expiration date as specified in the cookie itself */\n cookieExpirationDate: Date;\n\n config: Record;\n modalBg: HTMLDivElement;\n cookieContainer: HTMLDivElement;\n bannerContainer: HTMLDivElement;\n modalContainer: HTMLDivElement;\n\n cookieShowModalBtn: HTMLButtonElement;\n cookieCloseModalBtn: HTMLButtonElement;\n\n bannerContent: HTMLDivElement;\n acceptAllBtn: HTMLButtonElement;\n denyAllBtn: HTMLButtonElement;\n customizeBtn: HTMLButtonElement;\n cookiesUnorderedList: HTMLUListElement;\n cookieLinkShowCustomizeModalList: NodeListOf;\n modalWrapper: HTMLDivElement;\n template: HTMLDivElement;\n bannerDetailsAreExpanded: boolean;\n static noConflict: (deep?: boolean) => typeof CookieNotice;\n\n constructor(config: Record) {\n // * Setup Config\n this.config = config;\n\n // * Setup cookie expiration date\n let cookieExpirationDate: Date|null = this.readCookiesExpirationDate();\n if (!cookieExpirationDate) {\n cookieExpirationDate = new Date();\n cookieExpirationDate.setMonth(cookieExpirationDate.getMonth() + this.cookieTimeLife);\n }\n this.cookieExpirationDate = cookieExpirationDate;\n\n // * Inject DOM modal BG\n const modalBg = document.createElement(\"div\");\n modalBg.classList.add(\"cn-modal-bg\");\n document.body.append(modalBg);\n this.modalBg = modalBg;\n\n // * Setup Dom Elements\n const cookieContainer = document.querySelector(\n \"div#cn-wrapper\"\n ) as HTMLDivElement | null,\n cookieShowModalBtn = document.querySelector(\n \"button#cn-cookie-btn\"\n ) as HTMLButtonElement | null,\n cookieCloseModalBtn = document.querySelector(\n \"button#cn-close-modal\"\n ) as HTMLButtonElement | null,\n cookieLinkShowCustomizeModalPageList = document.querySelectorAll(\n \".cn-cookie-link\"\n ) as NodeListOf,\n bannerContainer = document.querySelector(\n \"div#cn-banner\"\n ) as HTMLDivElement | null,\n bannerContent = document.querySelector(\n \"div.cn-banner-content\"\n ) as HTMLDivElement | null,\n modalContainer = document.querySelector(\n \"div.cn-modal-container\"\n ) as HTMLDivElement | null,\n acceptAllBtn = document.querySelector(\n \"button#cn-accept-banner\"\n ) as HTMLButtonElement | null,\n denyAllBtn = document.querySelector(\n \"button#cn-deny-banner\"\n ) as HTMLButtonElement | null,\n customizeBtn = document.querySelector(\n \"button#cn-settings-banner\"\n ) as HTMLButtonElement | null,\n cookiesUnorderedList = document.querySelector(\n \"ul#cn-modal-list\"\n ) as HTMLUListElement | null,\n modalWrapper = document.querySelector(\n \"div.cn-modal-wrapper\"\n ) as HTMLDivElement,\n template = document.querySelector(\n \"div#cn-li-template\"\n ) as HTMLDivElement | null;\n if (!cookieContainer) {\n throw new Error(\"Cannot find div#cn-wrapper\");\n }\n if (!cookieShowModalBtn) {\n throw new Error(\"Cannot find 'button#cn-cookie-btn' element\");\n }\n if (!cookieCloseModalBtn) {\n throw new Error(\"Cannot find 'button#cn-close-modal' element\");\n }\n if (!bannerContainer) {\n throw new Error(\"Cannot find 'div#cn-banner' element\");\n }\n if (!bannerContent) {\n throw new Error(\"Cannot find 'div.cn-banner-content' element\");\n }\n if (!modalContainer) {\n throw new Error(\"Cannot find 'div.cn-modal-container' element\");\n }\n if (!acceptAllBtn) {\n throw new Error(\"Cannot find 'button#cn-accept-banner' element\");\n }\n if (!denyAllBtn) {\n throw new Error(\"Cannot find 'button#cn-deny-banner' element\");\n }\n if (!customizeBtn) {\n throw new Error(\"Cannot find 'button.cn-settings-banner' element\");\n }\n if (!cookiesUnorderedList) {\n throw new Error(\"Cannot find 'ul#cn-modal-list' element\");\n }\n if (!modalWrapper) {\n throw new Error(\"Cannot find 'div.cn-modal-wrapper' element\");\n }\n if (!template) {\n throw new Error(\"Cannot find 'div#cn-li-template' element\");\n }\n\n this.cookieShowModalBtn = cookieShowModalBtn;\n this.cookieCloseModalBtn = cookieCloseModalBtn;\n this.cookieLinkShowCustomizeModalList =\n cookieLinkShowCustomizeModalPageList;\n this.cookieContainer = cookieContainer;\n this.bannerContainer = bannerContainer;\n this.bannerContent = bannerContent;\n this.cookiesUnorderedList = cookiesUnorderedList;\n this.modalWrapper = modalWrapper;\n this.modalContainer = modalContainer;\n this.acceptAllBtn = acceptAllBtn;\n this.denyAllBtn = denyAllBtn;\n this.customizeBtn = customizeBtn;\n\n this.bannerDetailsAreExpanded = false;\n this.template = template;\n const memoryTemplate = this.template.cloneNode(true) as HTMLDivElement;\n this.template.remove();\n this.template = memoryTemplate;\n\n // * Setup Events\n this.addEventPrevent(this.modalBg, \"click\", this.closeCookieModal);\n this.addEventPrevent(\n this.cookieCloseModalBtn,\n \"click\",\n this.closeCookieModal\n );\n this.addEventPrevent(this.acceptAllBtn, \"click\", this.acceptAllCookies);\n this.addEventPrevent(this.denyAllBtn, \"click\", this.denyAllCookies);\n this.addEventPrevent(\n this.customizeBtn,\n \"click\",\n this.toggleCookieModalPages\n );\n this.addEventPrevent(\n this.cookieShowModalBtn,\n \"click\",\n this.toggleCookieModal\n );\n this.cookieLinkShowCustomizeModalList.forEach((cookieLink) => {\n this.addEventPrevent(\n cookieLink,\n \"click\",\n this.openCookieModalToCookiePage\n );\n this.addEventKbdValidate(cookieLink, this.openCookieModalToCookiePage);\n });\n\n // * Setup CN Cookie\n if (!this.cookiesMatchesConfig() || this.cookiesOlderThan(new Date())) {\n // * Setup Browser Cookie if none.\n this.resetBrowserCookie();\n this.openCookieModalToBannerPage();\n }\n\n // * Cookie should have been created from here.\n const cookies = this.getCookieStatusList();\n Object.entries(cookies).forEach(([cookieName, cookieStatus]) => {\n if (cookieStatus === CookieStatus.wait) {\n // * Open modal if any cookie config is not set.\n this.openCookieModalToBannerPage();\n return;\n }\n if (!this.config[cookieName]) {\n // * Ignore missing config\n return;\n }\n if (cookieStatus === CookieStatus.true) {\n // * Exec script part for accepted cookie.\n this.config[cookieName].script();\n return;\n }\n if (this.config[cookieName].fallback != null) {\n // * Exec fallback part for accepted cookie if provided.\n this.config[cookieName].fallback();\n }\n });\n }\n\n // COOKIES\n\n /**\n * Get cookies expiration date or null if not defined alread\n */\n readCookiesExpirationDate(): Date | null {\n const cookies = this.getBrowserCookieValue() ?? \"\",\n expirationDateString = cookies.split(\",\").find((cookieString) =>\n cookieString.startsWith(this.cookieExpirationName));\n if (!expirationDateString) {\n return null;\n }\n try {\n const epochExpiration = Number.parseInt(expirationDateString.replace(`${this.cookieExpirationName}=`, \"\"));\n if (isNaN(epochExpiration)) {\n return null;\n }\n return new Date(epochExpiration);\n } catch (e) {\n return null;\n }\n }\n\n /**\n * Check if the cookies date are older than a specified date\n\n * @param date The limit date for cookies\n */\n cookiesOlderThan(date: Date): boolean {\n return this.cookieExpirationDate.getTime() < date.getTime();\n }\n\n /**\n * Check if the actual cookie matches the config\n */\n cookiesMatchesConfig(): boolean {\n const cookies = this.getCookieStatusList();\n return Object.keys(cookies).length === Object.keys(this.config).length;\n }\n\n /**\n * Accept a specific cookie\n */\n acceptAllCookies() {\n Object.entries(this.config).forEach(([cookieName, cookieOption]) =>\n this.setCookieStatus(cookieName, CookieStatus.true, cookieOption)\n );\n for (const acceptLabel of this.cookieContainer.querySelectorAll(\n \".accept > label\"\n )) {\n acceptLabel.classList.add(\"active\");\n }\n for (const denyLabel of this.cookieContainer.querySelectorAll(\n \".deny > label\"\n )) {\n denyLabel.classList.remove(\"active\");\n }\n this.closeCookieModal();\n }\n\n /**\n * Deny a specific cookie\n */\n denyAllCookies() {\n Object.entries(this.config).forEach(([cookieName, cookieOption]) =>\n this.setCookieStatus(cookieName, CookieStatus.false, cookieOption)\n );\n for (const acceptLabel of this.cookieContainer.querySelectorAll(\n \".accept > label\"\n )) {\n acceptLabel.classList.remove(\"active\");\n }\n for (const denyLabel of this.cookieContainer.querySelectorAll(\n \".deny > label\"\n )) {\n denyLabel.classList.add(\"active\");\n }\n this.closeCookieModal();\n }\n\n /**\n * Fetch the cookie status list\n *\n * @returns the cookie status list\n */\n getCookieStatusList(): CookieStatusList {\n const cookies = this.getBrowserCookieValue(),\n statusList: CookieStatusList = {};\n if (cookies === undefined) {\n return statusList;\n }\n /** specificCookieString contains youtube=true like */\n cookies.split(\",\")\n // * Ignore timestamp\n .filter((specificCookieString) => !specificCookieString.startsWith(this.cookieExpirationName))\n .forEach((specificCookieString) => {\n const values = specificCookieString.split(\"=\");\n statusList[values[0]] = values[1] as CookieStatus;\n });\n return statusList;\n }\n\n /**\n * Check has cookie status\n *\n * @param key\n * @param value\n */\n containsCookieStatus(key: string): boolean {\n const statusList: CookieStatusList = this.getCookieStatusList();\n return (\n Object.keys(statusList).find((cookieName) => cookieName === key) !==\n undefined\n );\n }\n\n /**\n * Set the cookie value\n *\n * @param cookieName\n * @param status\n * @param cookieOption\n */\n setCookieStatus(\n cookieName: string,\n status: CookieStatus,\n cookieOption: CookieOptions\n ) {\n if (status === CookieStatus.true) {\n this.addCookieStatus(cookieName, cookieOption);\n return;\n }\n if (status === CookieStatus.false) {\n this.removeCookieStatus(cookieName, cookieOption);\n return;\n }\n this.setBrowserCookieStatus(cookieName, CookieStatus.wait);\n }\n\n /**\n * Add a specific cookie and\n * change his status to true\n *\n * @param cookieName\n * @param cookieOption\n */\n addCookieStatus(cookieName: string, cookieOption: CookieOptions) {\n if (cookieOption.script) {\n cookieOption.script();\n }\n this.setBrowserCookieStatus(cookieName, CookieStatus.true);\n }\n\n /**\n * Remove a specific cookie and\n * change his status to false\n *\n * @param cookieName\n * @param cookieOption\n */\n removeCookieStatus(cookieName: string, cookieOption: CookieOptions) {\n const cookieNameElement = document.getElementById(cookieName);\n if (cookieNameElement) {\n cookieNameElement.remove();\n }\n if (cookieOption.fallback) {\n cookieOption.fallback();\n }\n this.setBrowserCookieStatus(cookieName, CookieStatus.false);\n }\n\n /**\n * Change the status of a cookie\n *\n * @param cookieName\n * @param status\n */\n setBrowserCookieStatus(cookieName: string, status: CookieStatus) {\n const statusList: CookieStatusList = this.getCookieStatusList();\n // * Force refresh\n this.deleteBrowserCookie();\n statusList[cookieName] = status;\n this.saveBrowserCookie(statusList);\n }\n\n /**\n * Has CN cokie setup ?\n * @returns true if the cookie is setup\n */\n hasBrowserCookie(): boolean {\n return Boolean(this.getBrowserCookieValue());\n }\n\n /**\n * Get the Ldcweb cookie\n *\n * @returns A string like analytics=true,youtube=true or undefined\n */\n getBrowserCookieValue() {\n const matches = document.cookie.match(\n new RegExp(\n \"(?:^|; )\" +\n this.browserCookieName.replace(\n /([.$?*|{}()[\\]\\\\/+^])/g,\n \"\\\\$1\"\n ) +\n \"=([^;]*)\"\n )\n );\n return matches ? decodeURIComponent(matches[1]) : undefined;\n }\n\n /**\n * Save cookie content on web browser\n *\n * @param list\n */\n saveBrowserCookie(statusList: CookieStatusList) {\n const date = new Date(),\n content = Object.entries(statusList)\n .map(([cookieName, cookieStatus]) => {\n return `${cookieName}=${cookieStatus}`;\n });\n // * Update expiration date\n this.cookieExpirationDate = new Date(date.setMonth(date.getMonth() + this.cookieTimeLife));\n // * Append expiration date\n content.push(`${this.cookieExpirationName}=${this.cookieExpirationDate.getTime()}`);\n document.cookie = `${this.browserCookieName}=${content.join(\",\")};path=/${\n location.hostname ? `;domain=${location.hostname}` : \"\"\n };expires=${this.cookieExpirationDate.toUTCString()};${this.getCookiePoliciesAsString()}`;\n }\n\n /**\n * Set an older expire parameter to a specific cookie\n */\n deleteBrowserCookie() {\n if (this.hasBrowserCookie()) {\n // * Suppression du cookie et de sa version precedé d'un point\n document.cookie = `${this.browserCookieName}=;path=/${\n location.hostname ? `;domain=.${location.hostname}` : \"\"\n };expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\n document.cookie = `${this.browserCookieName}=;path=/${\n location.hostname ? `;domain=${location.hostname}` : \"\"\n };expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\n }\n }\n\n getCookiePoliciesAsString(): string {\n return Object.entries(this.cookiePolicies)\n .map(([policyName, policyValue]) => `${policyName}=${policyValue}`)\n .join(\";\");\n }\n\n /**\n * Reset Ldc Web CN cookie\n */\n resetBrowserCookie() {\n // * Create Cookie as It does not exists.\n const newCookieList: CookieStatusList = {};\n Object.entries(this.config).forEach(\n ([cookieName]) => (newCookieList[cookieName] = CookieStatus.wait)\n );\n this.saveBrowserCookie(newCookieList);\n }\n\n // LISTENERS\n\n /**\n * Add event on a specific element\n *\n * @param element\n * @param evnt\n * @param funct\n * @returns\n */\n addEvent(element: HTMLElement, evnt: string, funct: (e: Event) => void) {\n return element.addEventListener(evnt, funct.bind(this), false);\n }\n\n /**\n * Add event on a specific element and prevent default\n *\n * @param element\n * @param evnt\n * @param funct\n * @returns\n */\n addEventPrevent(\n element: HTMLElement,\n evnt: string,\n funct: (e: Event) => void\n ) {\n return element.addEventListener(\n evnt,\n (e) => {\n e.preventDefault();\n funct.call(this, e);\n },\n false\n );\n }\n\n /**\n * Add event on a specific element\n *\n * @param element\n * @param evnt\n * @param funct\n * @returns\n */\n addEventKbdValidate(element: HTMLElement, funct: (e: Event) => void) {\n return this.addEvent(element, \"keydown\", (e: Event) => {\n const kbdEvt = e as KeyboardEvent;\n if (\n kbdEvt.key == \" \" ||\n kbdEvt.code == \"Space\" ||\n kbdEvt.keyCode == 32 ||\n kbdEvt.key == \"Enter\" ||\n kbdEvt.code == \"Enter\" ||\n kbdEvt.keyCode == 13\n ) {\n funct.call(this, kbdEvt);\n e.preventDefault();\n }\n });\n }\n\n // COOKIE MODAL\n\n /**\n * Show or hide Cookie modal\n * @returns\n */\n toggleCookieModal() {\n if (!document.body.classList.contains(\"cn-open\")) {\n this.openCookieModalToBannerPage();\n return;\n }\n this.closeCookieModal();\n }\n\n /**\n * Open the cookies modal to the banner page\n */\n openCookieModalToBannerPage() {\n this.openCookieModalToCookiePage();\n this.toggleCookieModalPages();\n }\n\n /**\n * Open the cookies modal to the cookies page\n */\n openCookieModalToCookiePage() {\n document.body.classList.add(\"cn-open\");\n this.resetCookieModal();\n\n this.bannerContent.classList.add(\"d-none\");\n this.modalContainer.classList.remove(\"d-none\");\n // Scroll to the top of the cookies list\n this.modalWrapper.scrollTop = 0;\n this.setupCookieModalList();\n this.setTabIndex();\n }\n\n /**\n * Hide the cookies modal\n */\n closeCookieModal() {\n document.body.classList.remove(\"cn-open\");\n this.unsetTabIndex();\n this.setupCookieModalList();\n }\n\n /**\n * Setup tab indexes on visible elements\n */\n setTabIndex() {\n // * Prevent focus html tag\n document.documentElement.setAttribute(\"tabindex\", \"-1\");\n setTimeout(() => {\n const focusableSelector =\n \"a[href], button, [role=\\\"button\\\"], input, embed, object, iframe, textarea, select, details, [tabindex]:not([tabindex=\\\"-1\\\"])\";\n\n // * Only focusable elements\n [...document.body.querySelectorAll(focusableSelector)]\n .filter(\n (el) =>\n !el.hasAttribute(\"disabled\") &&\n !el.getAttribute(\"aria-hidden\")\n )\n .forEach((el) => {\n (el as HTMLElement).setAttribute(\"tabindex\", \"-1\");\n (el as HTMLElement).classList.add(\"cn-disabled\");\n });\n [...this.cookieContainer.querySelectorAll(focusableSelector)]\n .filter(\n (el) =>\n !el.hasAttribute(\"disabled\") &&\n !el.getAttribute(\"aria-hidden\") &&\n // * Only visible elements\n !!(\n (el as HTMLElement).offsetWidth ||\n (el as HTMLElement).offsetHeight ||\n el.getClientRects().length\n )\n )\n .forEach((el) => {\n (el as HTMLElement).setAttribute(\"tabindex\", \"0\");\n (el as HTMLElement).classList.remove(\"cn-disabled\");\n });\n this.cookieShowModalBtn.setAttribute(\"tabindex\", \"-1\");\n }, 500);\n }\n\n /**\n * Undo setup tab indexes on visible elements\n */\n unsetTabIndex() {\n document.documentElement.setAttribute(\"tabindex\", \"0\");\n setTimeout(() => {\n document.body.querySelectorAll(\".cn-disabled\").forEach((el) => {\n (el as HTMLElement).setAttribute(\"tabindex\", \"0\");\n (el as HTMLElement).classList.remove(\"cn-disabled\");\n });\n this.cookieShowModalBtn.setAttribute(\"tabindex\", \"0\");\n }, 500);\n }\n\n /**\n * Reset the modal view state\n */\n resetCookieModal() {\n this.bannerContent.classList.remove(\"d-none\");\n this.modalContainer.classList.add(\"d-none\");\n if (!this.customizeBtn.dataset.openModal) {\n throw new Error(\"Cannot find attribut data-open-modal\");\n }\n this.customizeBtn.innerHTML = this.customizeBtn.dataset.openModal;\n }\n\n /**\n * Set the cookies list in the modal\n */\n setupCookieModalList() {\n this.cookiesUnorderedList.innerHTML = \"\";\n Object.entries(this.config).forEach(([cookieName, cookieConfig]) => {\n const cookie = document.createElement(\"li\");\n const childItem = this.template.children.item(\n 0\n ) as HTMLDivElement | null;\n if (childItem === null) {\n throw new Error(\"Cannot find child item\");\n }\n cookie.append(childItem.cloneNode(true));\n const name = cookie.querySelector(\n \"span.cn-cookie-name\"\n ) as HTMLSpanElement;\n const description = cookie.querySelector(\n \"span.cn-cookie-description\"\n ) as HTMLSpanElement;\n const link = cookie.querySelector(\n \".cn-cookie-link\"\n ) as HTMLElement;\n const acceptInput = cookie.querySelector(\n \".accept > input\"\n ) as HTMLInputElement;\n const denyInput = cookie.querySelector(\n \".deny > input\"\n ) as HTMLInputElement;\n const acceptLabel = cookie.querySelector(\n \".accept > label\"\n ) as HTMLLabelElement;\n const denyLabel = cookie.querySelector(\n \".deny > label\"\n ) as HTMLLabelElement;\n\n name.textContent = cookieConfig.name;\n description.textContent = cookieConfig.description;\n link.textContent = cookieConfig.labelLink;\n link.setAttribute(\"href\", cookieConfig.link);\n acceptInput.id = cookieName + \"1\";\n acceptInput.name = cookieName;\n acceptInput.dataset.name = cookieName;\n acceptLabel.htmlFor = cookieName + \"1\";\n acceptLabel.textContent = `${acceptLabel.textContent} ${cookieName}`;\n acceptLabel.title = `${acceptLabel.textContent} ${cookieName}`;\n denyInput.id = cookieName + \"2\";\n denyInput.name = cookieName;\n denyInput.dataset.name = cookieName;\n denyLabel.htmlFor = cookieName + \"2\";\n denyLabel.textContent = `${denyLabel.textContent} ${cookieName}`;\n denyLabel.title = `${denyLabel.textContent} ${cookieName}`;\n\n const acceptFn = () => {\n acceptLabel.classList.add(\"active\");\n denyLabel.classList.remove(\"active\");\n this.setCookieStatus(\n cookieName,\n CookieStatus.true,\n cookieConfig\n );\n },\n denyFn = () => {\n acceptLabel.classList.remove(\"active\");\n denyLabel.classList.add(\"active\");\n this.setCookieStatus(\n cookieName,\n CookieStatus.false,\n cookieConfig\n );\n };\n this.addEvent(acceptInput, \"click\", acceptFn);\n this.addEventKbdValidate(acceptLabel, acceptFn);\n this.addEvent(denyInput, \"click\", denyFn);\n this.addEventKbdValidate(denyLabel, denyFn);\n\n this.cookiesUnorderedList.append(cookie);\n\n if (!this.hasBrowserCookie()) {\n // * Ldcweb cookie is not set.\n return;\n }\n // * Setup list status state\n Object.entries(this.getCookieStatusList()).forEach(\n ([ckName, cookieStatus]) => {\n if (ckName === cookieName) {\n acceptLabel.classList.remove(\"active\");\n denyLabel.classList.remove(\"active\");\n switch (cookieStatus) {\n case CookieStatus.true:\n acceptLabel.classList.add(\"active\");\n break;\n case CookieStatus.false:\n denyLabel.classList.add(\"active\");\n break;\n }\n }\n }\n );\n });\n }\n\n /**\n * Toggle Cookie modal pages\n */\n toggleCookieModalPages() {\n this.bannerContent.classList.toggle(\"d-none\");\n this.modalContainer.classList.toggle(\"d-none\");\n this.setTabIndex();\n this.setupCookieModalList();\n this.togglePersonalizeBtn();\n }\n\n /**\n * Toggle customize btn\n */\n togglePersonalizeBtn() {\n const customizeBtnBannerDataset = this.customizeBtn.dataset;\n this.modalWrapper.scrollTop = 0;\n if (this.bannerContent.classList.contains(\"d-none\")) {\n this.customizeBtn.innerHTML =\n customizeBtnBannerDataset.openModal as string;\n this.customizeBtn.title = customizeBtnBannerDataset.openModal as string;\n } else {\n this.customizeBtn.innerHTML =\n customizeBtnBannerDataset.closeModal as string;\n this.customizeBtn.title = customizeBtnBannerDataset.closeModal as string;\n }\n }\n}\n\nenum CookieStatus {\n true = \"true\",\n false = \"false\",\n wait = \"wait\",\n}\n\ntype CookieStatusList = Record;\n\ntype CookiePolicy = {\n sameSite: CookiePolicySameSite;\n secure: string;\n};\n\nenum CookiePolicySameSite {\n lax = \"lax\",\n strict = \"strict\",\n none = \"none\",\n}\n\nexport type CookieOptions = {\n name: string;\n description: string;\n link: string;\n labelLink: string;\n cookies: string[];\n /**\n * Fonction qui sert à initialiser la fonctionnalité\n * conduisant à la génération du cookie\n * @return void\n */\n script: () => void;\n /**\n * Fonction qui sert à informer l'utilisateur\n * sur chaque élèment que le cookie\n * associé à la fonctionnalité\n * est désactivé et propose un lien sur\n * cookie notice pour l'activer\n * @return void\n */\n fallback: () => void | null;\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","","// startup\n// Load entry module and return exports\n__webpack_require__(\"./src/ts/index.ts\");\n// This entry module doesn't tell about it's top-level declarations so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/scss/themes/standard.scss\");\n",""],"names":["CookieNotice","config","_this","_classCallCheck","_defineProperty","sameSite","CookiePolicySameSite","lax","secure","cookieExpirationDate","readCookiesExpirationDate","Date","setMonth","getMonth","cookieTimeLife","modalBg","document","createElement","classList","add","body","append","cookieContainer","querySelector","cookieShowModalBtn","cookieCloseModalBtn","cookieLinkShowCustomizeModalPageList","querySelectorAll","bannerContainer","bannerContent","modalContainer","acceptAllBtn","denyAllBtn","customizeBtn","cookiesUnorderedList","modalWrapper","template","Error","cookieLinkShowCustomizeModalList","bannerDetailsAreExpanded","memoryTemplate","cloneNode","remove","addEventPrevent","closeCookieModal","acceptAllCookies","denyAllCookies","toggleCookieModalPages","toggleCookieModal","forEach","cookieLink","openCookieModalToCookiePage","addEventKbdValidate","cookiesMatchesConfig","cookiesOlderThan","resetBrowserCookie","openCookieModalToBannerPage","cookies","getCookieStatusList","Object","entries","_ref","_ref2","_slicedToArray","cookieName","cookieStatus","CookieStatus","wait","true","script","fallback","_createClass","key","value","_this$getBrowserCooki","_this2","getBrowserCookieValue","expirationDateString","split","find","cookieString","startsWith","cookieExpirationName","epochExpiration","Number","parseInt","replace","concat","isNaN","e","date","getTime","keys","length","_this3","_ref3","_ref4","cookieOption","setCookieStatus","_iterator","_createForOfIteratorHelper","_step","s","n","done","acceptLabel","err","f","_iterator2","_step2","denyLabel","_this4","_ref5","_ref6","false","_iterator3","_step3","_iterator4","_step4","_this5","statusList","undefined","filter","specificCookieString","values","containsCookieStatus","status","addCookieStatus","removeCookieStatus","setBrowserCookieStatus","cookieNameElement","getElementById","deleteBrowserCookie","saveBrowserCookie","hasBrowserCookie","Boolean","matches","cookie","match","RegExp","browserCookieName","decodeURIComponent","content","map","_ref7","_ref8","push","join","location","hostname","toUTCString","getCookiePoliciesAsString","cookiePolicies","_ref9","_ref10","policyName","policyValue","newCookieList","_ref11","_ref12","addEvent","element","evnt","funct","addEventListener","bind","_this6","preventDefault","call","_this7","kbdEvt","code","keyCode","contains","resetCookieModal","scrollTop","setupCookieModalList","setTabIndex","unsetTabIndex","_this8","documentElement","setAttribute","setTimeout","focusableSelector","_toConsumableArray","el","hasAttribute","getAttribute","offsetWidth","offsetHeight","getClientRects","_this9","dataset","openModal","innerHTML","_this10","_ref13","_ref14","cookieConfig","childItem","children","item","name","description","link","acceptInput","denyInput","textContent","labelLink","id","htmlFor","title","acceptFn","denyFn","_ref15","_ref16","ckName","toggle","togglePersonalizeBtn","customizeBtnBannerDataset","closeModal","default"],"sourceRoot":""} \ No newline at end of file diff --git a/examples/laravel/cn-cookies.blade.php b/examples/laravel/cn-cookies.blade.php index d7e37e3..9299295 100644 --- a/examples/laravel/cn-cookies.blade.php +++ b/examples/laravel/cn-cookies.blade.php @@ -5,7 +5,6 @@ $site_name = Str::ucfirst(config('app.name')); $logo_picture_url = asset('picture string path'); $logo_title_text = __('Logo du site :name', ['name' => $site_name]); $logo_alt_text = __('Logo :name', ['name' => $site_name]); -$confidentiality_page_url = route('fo.charte'); $strings = (object)[ 'modal_title' => __('Fenetre de gestion de cookies'), @@ -20,13 +19,7 @@ $strings = (object)[ 'button_allow_all_title' => __('cookie-notice.button_allow_all_title'), 'button_back' => Str::upper(__('cookie-notice.button_back')), 'banner_title' => __('cookie-notice.banner_title', ['site_name' => $site_name]), - 'banner_text_open' => __('cookie-notice.banner_text_open', ['site_name' => $site_name]), 'banner_text' => __('cookie-notice.banner_text'), - 'banner_details' => __('cookie-notice.banner_details'), - 'banner_details_link' => __('cookie-notice.banner_details_link'), - 'banner_details_link_title' => __('cookie-notice.banner_details_link_title'), - 'banner_more_details' => __('cookie-notice.banner_more_details'), - 'banner_less_details' => __('cookie-notice.banner_less_details'), 'Panel_title' => __('cookie-notice.Panel_title'), 'Panel_content' => __('cookie-notice.Panel_content'), 'Panel_subtitle' => __('cookie-notice.Panel_subtitle'), @@ -215,7 +208,7 @@ SCRIPT; {{-- INCLUDE TEMPLATE --}} @include('vendor.cookie-notice-templates.standard', compact( 'site_name', 'logo_picture_url', 'logo_alt_text', - 'logo_title_text', 'confidentiality_page_url', 'strings' + 'logo_title_text', 'strings' )) @push('scripts') diff --git a/examples/laravel/lang/de/cookie-notice.php b/examples/laravel/lang/de/cookie-notice.php index 608c810..0a934f3 100644 --- a/examples/laravel/lang/de/cookie-notice.php +++ b/examples/laravel/lang/de/cookie-notice.php @@ -14,13 +14,9 @@ return [ 'button_customize' => 'Einstellungen', 'button_back' => 'Rückkehr', 'banner_title' => 'Die Website :site_name nutzt Cookies!', - 'banner_text_open' => 'Diese Website speichert Cookies auf Ihrem Computer. :site_name verwendet diese Informationen zur Verbesserung und Personalisierung Ihres Surferlebnisses sowie zur Analyse und Kennzahlen über unsere Besucher sowohl auf dieser Website als auch anderswo. Sie können auf „Akzeptieren“ klicken, wenn Sie der Verwendung dieser Cookies zustimmen.', - 'banner_text' => 'Wir verwenden Cookies, um das ordnungsgemäße Funktionieren unserer Website sicherzustellen und für analytische Zwecke. Indem Sie diese Website weiterhin durchsuchen oder durch Wenn Sie dieses Banner schließen, stimmen Sie der Verwendung dieser Cookies zu.', - 'banner_details' => 'Wenn Sie die Verwendung von Cookies ablehnen, werden Ihre Daten nicht erfasst. während Ihres Besuchs auf dieser Website. In Ihrem Browser wird ein Cookie verwendet, um Ihre Präferenzen nicht zu verfolgen. Auf einige Funktionen kann nicht zugegriffen werden. Sie können Ihre Meinung jederzeit ändern und Ihre Einwilligung ändern, indem Sie zu dieser Website zurückkehren.', - 'banner_details_link' => 'Weitere Informationen zu den von uns verwendeten Cookies finden Sie in unserer Datenschutzerklärung.', - 'banner_details_link_title' => 'Öffnen Sie die Seite mit den Datenschutzbestimmungen', - 'banner_more_details' => 'Mehr Erfahren...', - 'banner_less_details' => 'Weniger Details...', + 'banner_text' => 'Wir verwenden Cookies, um sicherzustellen, dass unsere Website ordnungsgemäß funktioniert, und zu analytischen Zwecken. + Sie können Ihre Meinung jederzeit ändern, indem Sie auf das Symbol auf jeder Seite unserer Website klicken. + Wenn Sie diese Dienste von Drittanbietern zulassen, stimmen Sie dem Ablegen und Lesen von Cookies und der Verwendung von Tracking-Technologien zu, die für das Funktionieren dieser Dienste erforderlich sind.', 'Panel_title' => 'Panel zur Verwaltung von Cookies', 'Panel_content' => 'Inhalt des Cookie-Verwaltungspanels', 'Panel_subtitle' => 'DerSchutz Ihrer Privatsphäre ist unsere Priorität', diff --git a/examples/laravel/lang/en/cookie-notice.php b/examples/laravel/lang/en/cookie-notice.php index 780789b..c9cf1b4 100644 --- a/examples/laravel/lang/en/cookie-notice.php +++ b/examples/laravel/lang/en/cookie-notice.php @@ -14,13 +14,9 @@ return [ 'button_customize' => 'Customize', 'button_back' => 'Back', 'banner_title' => 'The :site_name website uses cookies!', - 'banner_text_open' => 'This website stores cookies on your computer. :site_name uses this information to improve and personalize your browsing experience, as well as for analysis and indicators concerning our visitors both on this website and on other media. You can click on "Accept" if you consent to the use of these cookies.', - 'banner_text' => 'We use cookies to ensure the smooth operation of our site and for analytical purposes. By continuing to browse this site or by closing this banner, you consent to the use of these cookies.', - 'banner_details' => 'If you refuse the use of cookies, your information will not be tracked during your visit to this site. A cookie will be used in your browser to remember not to track your preferences. Some features will not be accessible. You can change your mind and modify your consent at any time by returning to this site.', - 'banner_details_link' => 'To find out more about the cookies we use, please consult our privacy policy.', - 'banner_details_link_title' => 'Open the privacy policy page', - 'banner_more_details' => 'More details...', - 'banner_less_details' => 'Fewer details...', + 'banner_text' => 'We use cookies to ensure the proper functioning of our site and for analytical purposes. + You can change your mind at any time by clicking on the icon on any page of our site. + By authorizing these third-party services, you agree to the deposit and reading of cookies and the use of tracking technologies necessary for their proper operation.', 'Panel_title' => 'Cookie management panel', 'Panel_content' => 'Cookie management panel content', 'Panel_subtitle' => 'Your privacy is our priority', diff --git a/examples/laravel/lang/fr/cookie-notice.php b/examples/laravel/lang/fr/cookie-notice.php index bd035e4..92b55da 100644 --- a/examples/laravel/lang/fr/cookie-notice.php +++ b/examples/laravel/lang/fr/cookie-notice.php @@ -14,13 +14,9 @@ return [ 'button_customize' => 'Personnaliser', 'button_back' => 'Retour', 'banner_title' => 'Le site internet :site_name utilise des cookies !', - 'banner_text_open' => 'Ce site web stocke les cookies sur votre ordinateur. :site_name utilise ces informations afin d’améliorer et de personnaliser votre expérience de navigation, ainsi que pour l’analyse et les indicateurs concernant nos visiteurs à la fois sur ce site web et sur d’autres supports. Vous pouvez cliquer sur « Accepter » si vous consentez à l’utilisation de ces cookies.', - 'banner_text' => 'Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques. En poursuivant votre navigation sur ce site ou en fermant ce bandeau, vous consentez à l’utilisationde ces cookies.', - 'banner_details' => 'Si vous refusez l’utilisation des cookies, vos informations ne seront pas suivies lors de votre visite sur ce site. Un cookie sera utilisé dans votre navigateur afin de se souvenir de ne pas suivre vos préférences. Certaines fonctionnalités ne seront pas accessibles. Vous pouvez changer d’avis et modifier votre consentement à tout moment en revenant sur ce site.', - 'banner_details_link' => 'Pour en savoir plus sur les cookies que nous utilisons, consultez notre charte de confidentialité.', - 'banner_details_link_title' => 'Ouvrir la page de la charte de confidentialité', - 'banner_more_details' => 'Plus de détails...', - 'banner_less_details' => 'Moins de détails...', + 'banner_text' => 'Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques. + Vous pouvez changer d\'avis à tout moment en cliquant sur l\'icône présente sur chaque page de notre site. + En autorisant ces services tiers, vous acceptez le dépôt et la lecture de cookies et l\'utilisation de technologies de suivi nécessaires à leur bon fonctionnement.', 'Panel_title' => 'Panneau de gestion des cookies', 'Panel_content' => 'Contenu du panneau des cookies', 'Panel_subtitle' => 'Le respect de votre vie privée est notre priorité', diff --git a/examples/laravel/templates/standard.blade.php b/examples/laravel/templates/standard.blade.php index c17f9b4..e0e6736 100644 --- a/examples/laravel/templates/standard.blade.php +++ b/examples/laravel/templates/standard.blade.php @@ -33,21 +33,9 @@ {!! nl2br(e($strings->banner_title)) !!}
-

{!! nl2br(e($strings->banner_text)) !!}

-

{!! nl2br(e($strings->banner_text_open)) !!}

+

{!! nl2br(e($strings->banner_text)) !!}

-
-

- {!! nl2br(e($strings->banner_details)) !!}
- {{ $strings->banner_details_link }} -

-
-
- -
{{-- 2ND PAGE CUSTOMIZE PANEL --}}
diff --git a/examples/wordpress/cn-cookies.php b/examples/wordpress/cn-cookies.php index 828430c..b6d5496 100644 --- a/examples/wordpress/cn-cookies.php +++ b/examples/wordpress/cn-cookies.php @@ -4,31 +4,26 @@ $site_name = 'Marie Restauration'; $logo_picture_url = get_stylesheet_directory_uri() . '/assets/images/logo-mr.png'; $logo_alt_text = "Logo " . $site_name; $logo_title_text = "Logo " . $site_name; -$confidentiality_page_url = ''; $strings = (object)[ - 'button_customize_cookies' => 'Personnaliser les cookies', - 'button_close_cookies' => 'Fermer la fenêtre des cookies', - 'button_forbid' => 'Interdire', - 'button_allow' => 'Autoriser', - 'button_forbid_all' => strtoupper('Tout refuser'), - 'button_allow_all' => strtoupper('Tout accepter'), - 'button_customize' => strtoupper('Personnaliser'), - 'button_back' => strtoupper('Retour'), - 'banner_title' => 'Le site internet ' . $site_name . ' utilise des cookies !', - 'banner_text_open' => "Ce site web stocke les cookies sur votre ordinateur. " . $site_name . " utilise ces informations afin d’améliorer et de personnaliser votre expérience de navigation, ainsi que pour l’analyse et les indicateurs concernant nos visiteurs à la fois sur ce site web et sur d’autres supports.\n Vous pouvez cliquer sur « Accepter » si vous consentez à l’utilisation de ces cookies.", - 'banner_text' => 'Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques. En poursuivant votre navigation sur ce site ou en fermant ce bandeau, vous consentez à l’utilisation de ces cookies.', - 'banner_details' => 'Si vous refusez l’utilisation des cookies, vos informations ne seront pas suivies lors de votre visite sur ce site. Un cookie sera utilisé dans votre navigateur afin de se souvenir de ne pas suivre vos préférences. Certaines fonctionnalités ne seront pas accessibles. Vous pouvez changer d’avis et modifier votre consentement à tout moment en revenant sur ce site.', - 'banner_details_link' => 'Pour en savoir plus sur les cookies que nous utilisons, consultez notre charte de confidentialité.', - 'banner_details_link_title' => 'Charte de confidentialité', - 'banner_more_details' => 'Plus de détails...', - 'banner_less_details' => 'Moins de détails...', - 'Panel_title' => 'Panneau de gestion des cookies', - 'Panel_subtitle' => 'Le respect de votre vie privée est notre priorité', - 'Panel_details' => 'Les fonctionnalités de ce site s’appuient sur des services proposés par des tiers. Si vous acceptez, ces tiers déposeront des cookies qui vous permettront de visualiser sur le site du contenu hébergé par ces tiers. - Via ces cookies, ces tiers collecteront et utiliseront vos données de navigation pour des finalités qui leur - sont propres, conformément à leur politique de confidentialité (lien ci-dessous). - Cette page vous permet de donner ou de retirer votre consentement, soit globalement soit service par service.', + 'button_customize_cookies' => 'Personnaliser les cookies', + 'button_close_cookies' => 'Fermer la fenêtre des cookies', + 'button_forbid' => 'Interdire', + 'button_allow' => 'Autoriser', + 'button_forbid_all' => strtoupper('Tout refuser'), + 'button_allow_all' => strtoupper('Tout accepter'), + 'button_customize' => strtoupper('Personnaliser'), + 'button_back' => strtoupper('Retour'), + 'banner_title' => 'Le site internet ' . $site_name . ' utilise des cookies !', + 'banner_text' => 'Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques. + Vous pouvez changer d\'avis à tout moment en cliquant sur l\'icône présente sur chaque page de notre site. + En autorisant ces services tiers, vous acceptez le dépôt et la lecture de cookies et l\'utilisation de technologies de suivi nécessaires à leur bon fonctionnement.', + 'Panel_title' => 'Panneau de gestion des cookies', + 'Panel_subtitle' => 'Le respect de votre vie privée est notre priorité', + 'Panel_details' => 'Les fonctionnalités de ce site s’appuient sur des services proposés par des tiers. Si vous acceptez, ces tiers déposeront des cookies qui vous permettront de visualiser sur le site du contenu hébergé par ces tiers. + Via ces cookies, ces tiers collecteront et utiliseront vos données de navigation pour des finalités qui leur + sont propres, conformément à leur politique de confidentialité (lien ci-dessous). + Cette page vous permet de donner ou de retirer votre consentement, soit globalement soit service par service.', ]; $cookies = []; @@ -213,4 +208,4 @@ SCRIPT; window.WebCookieNotice = new CookieNotice(window.WebCookieNotice); }); - + \ No newline at end of file diff --git a/examples/wordpress/templates/standard.php b/examples/wordpress/templates/standard.php index ac4a0b7..0ec911b 100644 --- a/examples/wordpress/templates/standard.php +++ b/examples/wordpress/templates/standard.php @@ -46,22 +46,8 @@

banner_text); ?>

-

banner_text_open); ?>

-
-

- banner_details; ?>
- - banner_details_link; ?> - -

-
-
- -
@@ -108,4 +94,4 @@
- \ No newline at end of file + diff --git a/src/scss/themes/standard.scss b/src/scss/themes/standard.scss index c24c731..5dd89f9 100644 --- a/src/scss/themes/standard.scss +++ b/src/scss/themes/standard.scss @@ -286,37 +286,6 @@ $breakpoint-mobile: 535px; text-align: justify; } } - - .cn-banner-details { - display: flex; - overflow: hidden; - height: 0; - flex-direction: row; - align-items: flex-start; - justify-content: center; - text-align: justify; - transition: 0.3s; - - p { - padding-bottom: 1rem; - } - } - - .cn-banner-btn-details { - width: 100%; - } - - .cn-banner-btn-details-p { - @extend %nav-button; - - display: inline-block; - width: 100%; - padding: 1rem 0; - margin: 0 auto; - cursor: pointer; - font-size: 14px; - text-align: center; - } } // 2nd Page MODAL diff --git a/src/ts/index.ts b/src/ts/index.ts index e5bcedf..697ef88 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -24,15 +24,8 @@ export default class CookieNotice { cookieShowModalBtn: HTMLButtonElement; cookieCloseModalBtn: HTMLButtonElement; - bannerDetailsCollapseBtn: HTMLButtonElement; - - bannerParaP: HTMLDivElement; - detailsTextOpen: HTMLParagraphElement; - detailsTextClose: HTMLParagraphElement; bannerContent: HTMLDivElement; - bannerDetails: HTMLDivElement; - bannerDetailsContainer: HTMLDivElement; acceptAllBtn: HTMLButtonElement; denyAllBtn: HTMLButtonElement; customizeBtn: HTMLButtonElement; @@ -80,24 +73,6 @@ export default class CookieNotice { bannerContent = document.querySelector( "div.cn-banner-content" ) as HTMLDivElement | null, - bannerDetails = document.querySelector( - "div.cn-banner-details" - ) as HTMLDivElement | null, - bannerParaP = document.querySelector( - "div.cn-banner-para-p" - ) as HTMLDivElement | null, - detailsTextOpen = document.querySelector( - "p.cn-banner-para-p-open" - ) as HTMLParagraphElement | null, - detailsTextClose = document.querySelector( - "p.cn-banner-para-p-close" - ) as HTMLParagraphElement | null, - bannerDetailsCollapseBtn = document.querySelector( - "button.cn-banner-btn-details-p" - ) as HTMLButtonElement | null, - bannerDetailsContainer = document.querySelector( - "div.cn-banner-btn-details" - ) as HTMLDivElement | null, modalContainer = document.querySelector( "div.cn-modal-container" ) as HTMLDivElement | null, @@ -134,26 +109,6 @@ export default class CookieNotice { if (!bannerContent) { throw new Error("Cannot find 'div.cn-banner-content' element"); } - if (!bannerDetails) { - throw new Error("Cannot find 'div.cn-banner-details' element"); - } - if (!bannerParaP) { - throw new Error("Cannot find 'div.cn-banner-para-p' element"); - } - if (!detailsTextOpen) { - throw new Error("Cannot find 'p.cn-banner-para-p-open' element"); - } - if (!detailsTextClose) { - throw new Error("Cannot find 'p.cn-banner-para-p-close' element"); - } - if (!bannerDetailsCollapseBtn) { - throw new Error( - "Cannot find 'button.cn-banner-btn-details-p' element" - ); - } - if (!bannerDetailsContainer) { - throw new Error("Cannot find '.cn-banner-btn-details' element"); - } if (!modalContainer) { throw new Error("Cannot find 'div.cn-modal-container' element"); } @@ -181,16 +136,10 @@ export default class CookieNotice { this.cookieLinkShowCustomizeModalList = cookieLinkShowCustomizeModalPageList; this.cookieContainer = cookieContainer; - this.bannerDetailsContainer = bannerDetailsContainer; this.bannerContainer = bannerContainer; this.bannerContent = bannerContent; this.cookiesUnorderedList = cookiesUnorderedList; this.modalWrapper = modalWrapper; - this.bannerParaP = bannerParaP; - this.detailsTextOpen = detailsTextOpen; - this.detailsTextClose = detailsTextClose; - this.bannerDetails = bannerDetails; - this.bannerDetailsCollapseBtn = bannerDetailsCollapseBtn; this.modalContainer = modalContainer; this.acceptAllBtn = acceptAllBtn; this.denyAllBtn = denyAllBtn; @@ -216,11 +165,6 @@ export default class CookieNotice { "click", this.toggleCookieModalPages ); - this.addEventPrevent( - this.bannerDetailsCollapseBtn, - "click", - this.toggleBannerDetails - ); this.addEventPrevent( this.cookieShowModalBtn, "click", @@ -623,8 +567,6 @@ export default class CookieNotice { this.resetCookieModal(); this.bannerContent.classList.add("d-none"); - this.bannerDetails.classList.add("d-none"); - this.bannerDetailsContainer.classList.add("d-none"); this.modalContainer.classList.remove("d-none"); // Scroll to the top of the cookies list this.modalWrapper.scrollTop = 0; @@ -701,8 +643,6 @@ export default class CookieNotice { */ resetCookieModal() { this.bannerContent.classList.remove("d-none"); - this.bannerDetails.classList.remove("d-none"); - this.bannerDetailsContainer.classList.remove("d-none"); this.modalContainer.classList.add("d-none"); if (!this.customizeBtn.dataset.openModal) { throw new Error("Cannot find attribut data-open-modal"); @@ -812,50 +752,11 @@ export default class CookieNotice { }); } - /** - * Toggle show hide banner details - */ - toggleBannerDetails() { - this.bannerDetails.classList.toggle("cn-details-open"); - - if ( - !this.bannerDetailsCollapseBtn.dataset.open || - !this.bannerDetailsCollapseBtn.dataset.close - ) { - throw new Error("Cannot find attribute data-open or data-close"); - } - - if (this.bannerDetailsAreExpanded) { - this.bannerDetailsCollapseBtn.innerHTML = - this.bannerDetailsCollapseBtn.dataset.close; - this.bannerDetailsCollapseBtn.title = - this.bannerDetailsCollapseBtn.dataset.close; - this.bannerDetailsCollapseBtn.ariaPressed = "false"; - this.detailsTextOpen.classList.add("d-none"); - this.detailsTextClose.classList.remove("d-none"); - this.bannerDetails.style.height = "0px"; - this.bannerDetailsAreExpanded = false; - } else { - this.bannerDetailsCollapseBtn.innerHTML = - this.bannerDetailsCollapseBtn.dataset.open; - this.bannerDetailsCollapseBtn.title = - this.bannerDetailsCollapseBtn.dataset.open; - this.bannerDetailsCollapseBtn.ariaPressed = "true"; - this.detailsTextOpen.classList.remove("d-none"); - this.detailsTextClose.classList.add("d-none"); - this.bannerDetails.style.height = - this.bannerDetails.children[0].clientHeight + "px"; - this.bannerDetailsAreExpanded = true; - } - } - /** * Toggle Cookie modal pages */ toggleCookieModalPages() { this.bannerContent.classList.toggle("d-none"); - this.bannerDetails.classList.toggle("d-none"); - this.bannerDetailsContainer.classList.toggle("d-none"); this.modalContainer.classList.toggle("d-none"); this.setTabIndex(); this.setupCookieModalList();