diff --git a/core/core.php b/core/core.php index f8d57d4b..0b787cc1 100644 --- a/core/core.php +++ b/core/core.php @@ -139,7 +139,8 @@ class common 'tippy', 'zwiico', 'imagemap', - 'simplelightbox' + 'simplelightbox', + 'tarteaucitron' ], 'view' => '' ]; diff --git a/core/vendor/tarteaucitron/inc.json b/core/vendor/tarteaucitron/inc.json new file mode 100644 index 00000000..1ce36e24 --- /dev/null +++ b/core/vendor/tarteaucitron/inc.json @@ -0,0 +1,4 @@ +[ + "tarteaucitron.js", + "tarteaucitron.css" +] \ No newline at end of file diff --git a/core/vendor/tarteaucitron/init.js b/core/vendor/tarteaucitron/init.js new file mode 100644 index 00000000..21a6873e --- /dev/null +++ b/core/vendor/tarteaucitron/init.js @@ -0,0 +1,43 @@ + // Paramètres d'initialisation + tarteaucitron.init({ + "privacyUrl": "", /* Privacy policy url */ + "bodyPosition": "bottom", /* or top to bring it as first element for accessibility */ + + "hashtag": "#tarteaucitron", /* Open the panel with this hashtag */ + "cookieName": "tarteaucitron", /* Cookie name */ + + "orientation": "middle", /* Banner position (top - bottom) */ + + "groupServices": false, /* Group services by category */ + "serviceDefaultState": "wait", /* Default state (true - wait - false) */ + + "showAlertSmall": false, /* Show the small banner on bottom right */ + "cookieslist": false, /* Show the cookie list */ + + "closePopup": false, /* Show a close X on the banner */ + + "showIcon": true, /* Show cookie icon to manage cookies */ + //"iconSrc": "", /* Optionnal: URL or base64 encoded image */ + "iconPosition": "BottomRight", /* BottomRight, BottomLeft, TopRight and TopLeft */ + + "adblocker": false, /* Show a Warning if an adblocker is detected */ + + "DenyAllCta" : true, /* Show the deny all button */ + "AcceptAllCta" : true, /* Show the accept all button when highPrivacy on */ + "highPrivacy": true, /* HIGHLY RECOMMANDED Disable auto consent */ + + "handleBrowserDNTRequest": false, /* If Do Not Track == 1, disallow all */ + + "removeCredit": false, /* Remove credit link */ + "moreInfoLink": true, /* Show more info link */ + + "useExternalCss": false, /* If false, the tarteaucitron.css file will be loaded */ + "useExternalJs": false, /* If false, the tarteaucitron.js file will be loaded */ + + //"cookieDomain": ".my-multisite-domaine.fr", /* Shared cookie for multisite */ + + "readmoreLink": "", /* Change the default readmore link */ + + "mandatory": true, /* Show a message about mandatory cookies */ + "mandatoryCta": true /* Show the disabled accept button when mandatory on */ + }); \ No newline at end of file diff --git a/core/vendor/tarteaucitron/tarteaucitron.css b/core/vendor/tarteaucitron/tarteaucitron.css new file mode 100644 index 00000000..552ae838 --- /dev/null +++ b/core/vendor/tarteaucitron/tarteaucitron.css @@ -0,0 +1,1018 @@ +div#tarteaucitronMainLineOffset,.tarteaucitronBorder {border:0!important;} + +#tarteaucitron [aria-pressed="true"] { + font-weight:700; +} + +.tac_visually-hidden { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; /* added line */ + border: 0; +} + +div#tarteaucitronAlertBig:focus {outline: 0;} + +.tarteaucitron-modal-open{ + overflow: hidden; + height: 100%; +} + +#tarteaucitronContentWrapper {display:unset;} + +/** 14042021 **/ +span.tarteaucitronReadmoreSeparator { + display: inline!important; +} +/******/ + +/** 09052021 **/ +.tarteaucitronName .tacCurrentStatus, .tarteaucitronName .tarteaucitronReadmoreSeparator { + color: #333!important; + font-size: 12px!important; + text-transform: capitalize; +} +/**************/ + +/** 27032021 **/ +button.tarteaucitron-toggle-group { + display: block; +} +span.tarteaucitronH3 { + font-weight: 700!important; +} +#tarteaucitron #tarteaucitronServices_mandatory .tarteaucitronH3 { + font-weight: 500!important; + font-size: 14px; + margin-top: 7px; +} +.tarteaucitronLine { + border-left: 0px solid transparent!important; +} +/*****/ + +/** BETTER MOBILE MODE **/ +@media screen and (max-width: 767px) { + + html body #tarteaucitronRoot #tarteaucitron ul#tarteaucitronServices_mandatory .tarteaucitronDeny { + display: none!important; + } + + html body #tarteaucitronRoot #tarteaucitron .tarteaucitronBorder button, + html body #tarteaucitronRoot #tarteaucitron .tarteaucitronAsk, + html body #tarteaucitronRoot #tarteaucitron .tarteaucitronName { + width:100%!important; + display: block!important; + margin-left: 0!important; + margin-right: 0!important; + box-sizing: border-box!important; + max-width: 100%!important; + margin-bottom: 8px!important; + } + + html body #tarteaucitronRoot #tarteaucitron .tarteaucitronBorder ul .tarteaucitronLine { + padding: 16px!important; + } + + html body #tarteaucitronRoot #tarteaucitron div#tarteaucitronMainLineOffset .tarteaucitronName { + display: none!important; + } + + #tarteaucitronServices_mandatory li.tarteaucitronLine .tarteaucitronName span { + width: 100%!important; + display: inline-block; + } + li.tarteaucitronLine .tarteaucitronName span { + width: 80%!important; + display: inline-block; + } + html body #tarteaucitronRoot #tarteaucitron .tarteaucitronBorder button.tarteaucitron-toggle-group { + width: 10%!important; + position: absolute; + top: 20px; + right: 20px; + font-size: 0px; + padding: 10px 0; + } + html body #tarteaucitronRoot #tarteaucitron .tarteaucitronBorder button.tarteaucitron-toggle-group:before { + content: '\0025BE'; + font-weight:700; + font-size: 14px; + } + html body #tarteaucitronRoot #tarteaucitron .tarteaucitronBorder .tarteaucitronIsExpanded button.tarteaucitron-toggle-group:before { + content: '\0025B4'; + } +} +@media screen and (min-width: 768px) { + + html body #tarteaucitronRoot #tarteaucitron .tarteaucitronBorder button.tarteaucitron-toggle-group:after { + content: '\0025BE'; + font-weight:700; + font-size: 14px; + margin-left: 15px; + } + html body #tarteaucitronRoot #tarteaucitron .tarteaucitronBorder .tarteaucitronIsExpanded button.tarteaucitron-toggle-group:after { + content: '\0025B4'; + margin-left: 15px; + } +} +/****/ + + + +/*** +* Reset CSS +*/ +#tarteaucitronRoot div, #tarteaucitronRoot span, #tarteaucitronRoot applet, #tarteaucitronRoot object, #tarteaucitronRoot iframe, #tarteaucitronRoot h1, #tarteaucitronRoot h2, #tarteaucitronRoot h3, #tarteaucitronRoot h4, #tarteaucitronRoot h5, #tarteaucitronRoot h6, #tarteaucitronRoot p, #tarteaucitronRoot blockquote, #tarteaucitronRoot pre, #tarteaucitronRoot a, #tarteaucitronRoot abbr, #tarteaucitronRoot acronym, #tarteaucitronRoot address, #tarteaucitronRoot big, #tarteaucitronRoot cite, #tarteaucitronRoot code, #tarteaucitronRoot del, #tarteaucitronRoot dfn, #tarteaucitronRoot em, #tarteaucitronRoot img, #tarteaucitronRoot ins, #tarteaucitronRoot kbd, #tarteaucitronRoot q, #tarteaucitronRoot s, #tarteaucitronRoot samp, #tarteaucitronRoot small, #tarteaucitronRoot strike, #tarteaucitronRoot strong, #tarteaucitronRoot sub, #tarteaucitronRoot sup, #tarteaucitronRoot tt, #tarteaucitronRoot var, #tarteaucitronRoot b, #tarteaucitronRoot u, #tarteaucitronRoot i, #tarteaucitronRoot center, #tarteaucitronRoot dl, #tarteaucitronRoot dt, #tarteaucitronRoot dd, #tarteaucitronRoot ol, #tarteaucitronRoot ul, #tarteaucitronRoot li, #tarteaucitronRoot fieldset, #tarteaucitronRoot form, #tarteaucitronRoot label, #tarteaucitronRoot legend, #tarteaucitronRoot table, #tarteaucitronRoot caption, #tarteaucitronRoot tbody, #tarteaucitronRoot tfoot, #tarteaucitronRoot thead, #tarteaucitronRoot tr, #tarteaucitronRoot th, #tarteaucitronRoot td, #tarteaucitronRoot article, #tarteaucitronRoot aside, #tarteaucitronRoot canvas, #tarteaucitronRoot details, #tarteaucitronRoot embed, #tarteaucitronRoot figure, #tarteaucitronRoot figcaption, #tarteaucitronRoot footer, #tarteaucitronRoot header, #tarteaucitronRoot hgroup, #tarteaucitronRoot menu, #tarteaucitronRoot nav, #tarteaucitronRoot output, #tarteaucitronRoot ruby, #tarteaucitronRoot section, #tarteaucitronRoot summary, #tarteaucitronRoot time, #tarteaucitronRoot mark, #tarteaucitronRoot audio, #tarteaucitronRoot video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; + /*background: initial;*/ + text-align: initial; + text-shadow: initial; +} + +/* Animation */ +#tarteaucitronRoot * {transition: border 300ms, background 300ms, opacity 200ms, box-shadow 400ms} + +/* HTML5 display-role reset for older browsers */ +#tarteaucitronRoot article, #tarteaucitronRoot aside, #tarteaucitronRoot details, #tarteaucitronRoot figcaption, #tarteaucitronRoot figure, #tarteaucitronRoot footer, #tarteaucitronRoot header, #tarteaucitronRoot hgroup, #tarteaucitronRoot menu, #tarteaucitronRoot nav, #tarteaucitronRoot section { + display: block; +} +#tarteaucitronRoot ol, #tarteaucitronRoot ul { + list-style: none; +} +#tarteaucitronRoot blockquote, #tarteaucitronRoot q { + quotes: none; +} +#tarteaucitronRoot blockquote:before, #tarteaucitronRoot blockquote:after, #tarteaucitronRoot q:before, #tarteaucitronRoot q:after { + content: ''; + content: none; +} +#tarteaucitronRoot table { + border-collapse: collapse; + border-spacing: 0; +} + +#tarteaucitronRoot a:focus-visible, #tarteaucitronRoot button:focus-visible { + outline: 3px dashed #3d86d8; +} + +/*** + * Better scroll management + */ +div#tarteaucitronMainLineOffset { + margin-top: 0!important; +} + +div#tarteaucitronServices { + margin-top: 21px!important; +} + +#tarteaucitronServices::-webkit-scrollbar { + width: 5px; +} + +#tarteaucitronServices::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 0 rgba(0,0,0,0); +} + +#tarteaucitronServices::-webkit-scrollbar-thumb { + background-color: #ddd; + outline: 0px solid slategrey; +} + +div#tarteaucitronServices { + box-shadow: 0 40px 60px #545454; +} + +/*** + * Responsive layout for the control panel + */ +@media screen and (max-width:479px) { + #tarteaucitron .tarteaucitronLine .tarteaucitronName { + width: 90% !important; + } + + #tarteaucitron .tarteaucitronLine .tarteaucitronAsk { + float: left !important; + margin: 10px 15px 5px; + } +} + +@media screen and (max-width:767px) { + #tarteaucitronAlertSmall #tarteaucitronCookiesListContainer, #tarteaucitron { + background: #fff; + border: 0 !important; + bottom: 0 !important; + height: 100% !important; + left: 0 !important; + margin: 0 !important; + max-height: 100% !important; + max-width: 100% !important; + top: 0 !important; + width: 100% !important; + } + + #tarteaucitron .tarteaucitronBorder { + border: 0 !important; + } + + #tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList { + border: 0 !important; + } + + #tarteaucitron #tarteaucitronServices .tarteaucitronTitle { + text-align: left !important; + } + + .tarteaucitronName .tarteaucitronH2 { + max-width: 80%; + } + + #tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk { + text-align: center !important; + } + + #tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk button { + margin-bottom: 5px; + } +} + +@media screen and (min-width:768px) and (max-width:991px) { + #tarteaucitron { + border: 0 !important; + left: 0 !important; + margin: 0 5% !important; + max-height: 80% !important; + width: 90% !important; + } +} + +/*** + * Common value + */ +#tarteaucitronRoot div#tarteaucitron { + left: 0; + right: 0; + margin: auto; +} + +#tarteaucitronRoot button#tarteaucitronBack { + background: #eee; +} + +#tarteaucitron .clear { + clear: both; +} + +#tarteaucitron a { + color: rgb(66, 66, 66); + font-size: 11px; + font-weight: 700; + text-decoration: none; +} + +#tarteaucitronRoot button { + background: transparent; + border: 0; +} + +#tarteaucitronAlertBig strong, #tarteaucitronAlertSmall strong, +#tarteaucitronAlertBig a, #tarteaucitronAlertSmall a { + color: #fff; +} + +#tarteaucitron strong { + font-size: 22px; + font-weight: 500; +} + +#tarteaucitron ul { + padding: 0; +} + +#tarteaucitron .tarteaucitronH1, #tarteaucitron .tarteaucitronH2, #tarteaucitron .tarteaucitronH3, #tarteaucitron .tarteaucitronH4, #tarteaucitron .tarteaucitronH5, #tarteaucitron .tarteaucitronH6 { + display: block; +} + +.cookie-list { + list-style: none; + padding: 0; + margin: 0; +} +/*** + * Root div added just before + */ +#tarteaucitronRoot { + left: 0; + position: absolute; + right: 0; + top: 0; + width: 100%; +} + +#tarteaucitronRoot * { + box-sizing: initial; + color: #333; + /*font-family: sans-serif !important;*/ + font-size: 14px; + line-height: normal; + vertical-align: initial; +} + +#tarteaucitronRoot .tarteaucitronH1 { + font-size: 1.5em; + text-align: center; + color: #fff; + margin: 15px 0 28px; +} + +#tarteaucitronRoot .tarteaucitronH2 { + display: inline-block; + margin: 12px 0 0 10px; + color: #fff; +} + +#tarteaucitronCookiesNumberBis.tarteaucitronH2 { + margin-left: 0; +} + +/*** + * Control panel + */ +#tarteaucitronBack { + background: #fff; + display: none; + height: 100%; + left: 0; + opacity: 0.7; + position: fixed; + top: 0; + width: 100%; + z-index: 2147483646; +} + +#tarteaucitron { + display: none; + max-height: 80%; + left: 50%; + margin: 0 auto 0 -430px; + padding: 0; + position: fixed; + top: 6%; + width: 860px; + z-index: 2147483647; +} + +#tarteaucitron .tarteaucitronBorder { + background: #fff; + border: 2px solid #333; + border-top: 0; + height: auto; + overflow: auto; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronClosePanelCookie, +#tarteaucitron #tarteaucitronClosePanel { + background: #333333; + color: #fff; + cursor: pointer; + font-size: 12px; + font-weight: 700; + text-decoration: none; + padding: 4px 0; + position: absolute; + right: 0; + text-align: center; + width: 70px; +} + +#tarteaucitron #tarteaucitronDisclaimer { + color: #555; + font-size: 12px; + margin: 15px auto 0; + width: 80%; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronHidden, +#tarteaucitron #tarteaucitronServices .tarteaucitronHidden { + background: rgba(51, 51, 51, 0.07); +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronHidden { + display: none; + position: relative; +} + +#tarteaucitronCookiesList .tarteaucitronH3.tarteaucitronTitle { + width: 100%; + box-sizing: border-box; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronTitle, +#tarteaucitron #tarteaucitronServices .tarteaucitronTitle button, +#tarteaucitron #tarteaucitronInfo, +#tarteaucitron #tarteaucitronServices .tarteaucitronDetails { + color: #fff; + display: inline-block; + font-size: 14px; + font-weight: 700; + margin: 20px 0px 0px; + padding: 5px 20px; + text-align: left; + width: auto; + background: #333; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronMainLine .tarteaucitronName a, +#tarteaucitron #tarteaucitronServices .tarteaucitronTitle a { + color: #fff; + font-weight: 500; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronMainLine .tarteaucitronName a:hover, +#tarteaucitron #tarteaucitronServices .tarteaucitronTitle a:hover { + text-decoration: none !important; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronMainLine .tarteaucitronName a { + font-size: 22px; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronTitle a { + font-size: 14px; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronTitle { + padding: 5px 10px; + margin: 0; +} + +#tarteaucitron #tarteaucitronInfo, +#tarteaucitron #tarteaucitronServices .tarteaucitronDetails { + color: #fff; + display: none; + font-size: 12px; + font-weight: 500; + margin-top: 0; + max-width: 270px; + padding: 20px; + position: absolute; + z-index: 2147483647; +} + +#tarteaucitron #tarteaucitronInfo a { + color: #fff; + text-decoration: underline; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronLine:hover { + background: rgba(51, 51, 51, 0.2); +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronLine { + background: rgba(51, 51, 51, 0.1); + border-left: 5px solid transparent; + margin: 0; + overflow: hidden; + padding: 15px 5px; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronLine.tarteaucitronIsAllowed { + border-color: #1B870B; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronLine.tarteaucitronIsDenied { + border-color: #9C1A1A; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronMainLine { + background: #333; + border: 3px solid #333; + border-left: 9px solid #333; + border-top: 5px solid #333; + margin-bottom: 0; + margin-top: 21px; + position: relative; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronMainLine:hover { + background: #333; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronMainLine .tarteaucitronName { + margin-left: 15px; + margin-top: 2px; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronMainLine .tarteaucitronName button { + color: #fff; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronMainLine .tarteaucitronAsk { + margin-top: 0px !important; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName { + display: inline-block; + float: left; + margin-left: 10px; + text-align: left; + width: 50%; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName a:hover { + text-decoration: underline; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk { + display: inline-block; + float: right; + margin: 7px 15px 0; + text-align: right; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk .tarteaucitronAllow, +#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronAsk .tarteaucitronDeny, +.tac_activate .tarteaucitronAllow { + background: #555; + border-radius: 4px; + color: #fff; + cursor: pointer; + display: inline-block; + padding: 6px 10px; + text-align: center; + text-decoration: none; + width: auto; + border: 0; +} + +#tarteaucitron #tarteaucitronServices #tarteaucitronAllAllowed.tarteaucitronIsSelected { + background-color: #1B870B; + opacity: 1; +} +#tarteaucitron #tarteaucitronServices #tarteaucitronAllDenied.tarteaucitronIsSelected, +#tarteaucitron #tarteaucitronServices #tarteaucitronAllDenied2.tarteaucitronIsSelected { + background-color: #9C1A1A; + opacity: 1; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronLine.tarteaucitronIsAllowed .tarteaucitronAllow, +#tarteaucitron #tarteaucitronServices #tarteaucitronServices_mandatory .tarteaucitronLine button.tarteaucitronAllow { + background-color: #1B870B; +} +#tarteaucitron #tarteaucitronServices .tarteaucitronLine.tarteaucitronIsDenied .tarteaucitronDeny { + background-color: #9C1A1A; +} + +#tarteaucitron #tarteaucitronServices #tarteaucitronServices_mandatory .tarteaucitronLine button.tarteaucitronAllow{ + opacity: 0.4; +} + +#tarteaucitron #tarteaucitronServices .tarteaucitronLine .tarteaucitronName .tarteaucitronListCookies { + color: #333; + font-size: 12px; +} + +#tarteaucitron .tarteaucitronH3 { + font-size: 18px; +} + +#tarteaucitron #tarteaucitronMainLineOffset .tarteaucitronName { + width: auto!important; + margin-left: 0!important; + font-size: 14px; +} +span#tarteaucitronDisclaimerAlert { + padding: 0 10px; + display: inline-block; +} +#tarteaucitron .tarteaucitronBorder, #tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronCookiesListMain, #tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList, #tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronHidden, #tarteaucitron #tarteaucitronServices .tarteaucitronMainLine { + border-color: #333!important; +} + +/*** + * Big alert + */ +.tarteaucitronAlertBigTop { + top: 0; +} + +.tarteaucitronAlertBigBottom { + bottom: 0; +} + +#tarteaucitronRoot #tarteaucitronAlertBig { + background: #333; + color: #fff; + display: none; + font-size: 15px !important; + left: 0; + position: fixed; + box-sizing: content-box; + z-index: 2147483645; + text-align: center; + padding: 10px 0 10px 0; + margin: auto; + width: 100%; +} + +#tarteaucitronAlertBig #tarteaucitronPrivacyUrl, +#tarteaucitronAlertBig #tarteaucitronPrivacyUrlDialog, +#tarteaucitronAlertBig #tarteaucitronDisclaimerAlert, +#tarteaucitronAlertBig #tarteaucitronDisclaimerAlert strong { + font: 15px verdana; + color: #fff; +} + +#tarteaucitronAlertBig #tarteaucitronDisclaimerAlert strong { + font-weight: 700; +} + +#tarteaucitronAlertBig #tarteaucitronPrivacyUrl, +#tarteaucitronAlertBig #tarteaucitronPrivacyUrlDialog { + cursor: pointer; +} + +#tarteaucitronAlertBig #tarteaucitronCloseAlert, +#tarteaucitronAlertBig #tarteaucitronPersonalize, +#tarteaucitronAlertBig #tarteaucitronPersonalize2, +.tarteaucitronCTAButton, +#tarteaucitron #tarteaucitronPrivacyUrl, +#tarteaucitron #tarteaucitronPrivacyUrlDialog, +#tarteaucitronRoot .tarteaucitronDeny, +#tarteaucitronRoot .tarteaucitronAllow { + background: #008300; + color: #fff; + cursor: pointer; + display: inline-block; + font-size: 16px!important; + line-height: 1.2; + padding: 5px 10px; + text-decoration: none; + margin-left: 7px; +} + +#tarteaucitronRoot .tarteaucitronDeny { + background: #9C1A1A; +} + +#tarteaucitronAlertBig #tarteaucitronCloseAlert, #tarteaucitron #tarteaucitronPrivacyUrl, #tarteaucitron #tarteaucitronPrivacyUrlDialog { + background: #fff; + color: #333; + font-size: 13px; + margin-bottom: 3px; + margin-left: 7px; + padding: 5px 10px; +} + +#tarteaucitronPercentage { + background: #0A0!important; + box-shadow: 0 0 2px #fff, 0 1px 2px #555; + height: 5px; + left: 0; + position: fixed; + width: 0; + z-index: 2147483644; +} + +/*** + * Icon + */ +.tarteaucitronIconBottomRight { + bottom: 0; + right: 0; +} +.tarteaucitronIconBottomLeft { + bottom: 0; + left: 0; +} +.tarteaucitronIconTopRight { + top: 0; + right: 0; +} +.tarteaucitronIconTopLeft { + top: 0; + left: 0; +} + +.tarteaucitronIconTopLeft #tarteaucitronManager { + border-radius: 2px 7px 7px 2px; +} + +.tarteaucitronIconTopRight #tarteaucitronManager { + border-radius: 7px 2px 2px 7px; +} + +.tarteaucitronIconBottomLeft #tarteaucitronManager { + border-radius: 7px 7px 2px 2px; +} + +.tarteaucitronIconBottomRight #tarteaucitronManager { + border-radius: 7px 7px 2px 2px; +} + +#tarteaucitronIcon { + background: transparent; + position: fixed; + display: none; + width: auto; + z-index: 2147483646; +} +#tarteaucitronIcon #tarteaucitronManager { + color: transparent; + cursor: pointer; + display: inline-block; + font-size: 11px !important; + padding: 8px 10px 8px; + border: none; +} +#tarteaucitronIcon #tarteaucitronManager img { + width: 50px; + height: 50px; +} + +#tarteaucitronRoot .tarteaucitronCross::before { + content: '\2717'; + display: inline-block; + color: white; +} + +#tarteaucitronRoot .tarteaucitronCheck::before { + content: '\2713'; + display: inline-block; + color: white; +} + +#tarteaucitronRoot .tarteaucitronPlus::before { + content: '\271b'; + display: inline-block; + color: white; +} + + +/*** + * Small alert + */ + +.tarteaucitronAlertSmallTop,.tarteaucitronAlertSmallBottom { + bottom: 0; +} + +#tarteaucitronAlertSmall { + background: #333; + display: none; + padding: 0; + position: fixed; + right: 0; + text-align: center; + width: auto; + z-index: 2147483646; +} + +#tarteaucitronAlertSmall #tarteaucitronManager { + color: #fff; + cursor: pointer; + display: inline-block; + font-size: 11px !important; + padding: 8px 10px 8px; +} + +#tarteaucitronAlertSmall #tarteaucitronManager:hover { + background: rgba(255, 255, 255, 0.05); +} + +#tarteaucitronAlertSmall #tarteaucitronManager #tarteaucitronDot { + background-color: gray; + border-radius: 5px; + display: block; + height: 8px; + margin-bottom: 1px; + margin-top: 5px; + overflow: hidden; + width: 100%; +} + +#tarteaucitronAlertSmall #tarteaucitronManager #tarteaucitronDot #tarteaucitronDotGreen, +#tarteaucitronAlertSmall #tarteaucitronManager #tarteaucitronDot #tarteaucitronDotYellow, +#tarteaucitronAlertSmall #tarteaucitronManager #tarteaucitronDot #tarteaucitronDotRed { + display: block; + float: left; + height: 100%; + width: 0%; +} + +#tarteaucitronAlertSmall #tarteaucitronManager #tarteaucitronDot #tarteaucitronDotGreen { + background-color: #1B870B; +} + +#tarteaucitronAlertSmall #tarteaucitronManager #tarteaucitronDot #tarteaucitronDotYellow { + background-color: #FBDA26; +} + +#tarteaucitronAlertSmall #tarteaucitronManager #tarteaucitronDot #tarteaucitronDotRed { + background-color: #9C1A1A; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesNumber { + background: rgba(255, 255, 255, 0.2); + color: #fff; + cursor: pointer; + display: inline-block; + font-size: 30px; + padding: 0px 10px; + vertical-align: top; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesNumber:hover { + background: rgba(255, 255, 255, 0.3); +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer { + display: none; + max-height: 70%; + max-width: 500px; + position: fixed; + right: 0; + width: 100%; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList { + background: #fff; + border: 2px solid #333; + color: #333; + font-size: 11px; + height: auto; + overflow: auto; + text-align: left; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList strong { + color: #333; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesTitle { + background: #333; + margin-top: 21px; + padding: 13px 0 9px 13px; + text-align: left; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesTitle strong { + color: #fff; + font-size: 16px; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronCookiesListMain { + background: rgba(51, 51, 51, 0.1); + padding: 7px 5px 10px; + word-wrap: break-word; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronCookiesListMain:hover { + background: rgba(51, 51, 51, 0.2); +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronCookiesListMain a { + color: #333; + text-decoration: none; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronCookiesListMain .tarteaucitronCookiesListLeft { + display: inline-block; + width: 50%; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronCookiesListMain .tarteaucitronCookiesListLeft a strong { + color: darkred; +} + +#tarteaucitronAlertSmall #tarteaucitronCookiesListContainer #tarteaucitronCookiesList .tarteaucitronCookiesListMain .tarteaucitronCookiesListRight { + color: #333; + display: inline-block; + font-size: 11px; + margin-left: 10%; + vertical-align: top; + width: 30%; +} + +/*** + * Fallback activate link + */ +.tac_activate { + background: #333; + color: #fff; + display: table; + font-size: 12px; + height: 100%; + line-height: initial; + margin: auto; + text-align: center; + width: 100%; +} + +.tac_float { + display: table-cell; + text-align: center; + vertical-align: middle; +} + +.tac_activate .tac_float strong { + color: #fff; +} + +.tac_activate .tac_float .tarteaucitronAllow { + background-color: #1B870B; + display: inline-block; +} + +/*** + * CSS for services + */ +ins.ferank-publicite, ins.adsbygoogle { + text-decoration: none; +} + +div.amazon_product { + height:240px; + width:120px; +} + +.tarteaucitronIsAllowed .tarteaucitronDeny { + opacity: 0.4!important; +}.tarteaucitronIsDenied .tarteaucitronAllow { + opacity: 0.4!important; + }.tarteaucitronIsAllowed .tarteaucitronAllow { + opacity: 1!important; + }.tarteaucitronIsDenied .tarteaucitronDeny { + opacity: 1!important; + } +.tarteaucitronLine .tarteaucitronAllow, .tarteaucitronLine .tarteaucitronDeny { + opacity: 0.4; +} +#tarteaucitronServices_mandatory button.tarteaucitronAllow { + opacity: 1; +} + +div#tarteaucitronInfo { + display: block!important; + position: relative !important; + text-align: center!important; + max-width: 80%!important; + padding: 15px 0!important; + margin: -10px auto 40px!important; + font-size: 1em!important; + border-bottom: 1px solid; + border-top: 1px solid; + border-color: #555; +} + +a.tarteaucitronSelfLink { + position: absolute; + left: 0; + right: 0; + bottom: -30px; + text-align: center!important; + display: block; + height:30px; +} + +.tarteaucitronMainLine .tarteaucitronH2 { + font-size: 1.2em!important; + margin-top: 4px!important; +} + +span.tarteaucitronTitle.tarteaucitronH3 { + margin-top: 12px!important; +} + +#tarteaucitronCloseCross { + position:absolute; + color: #FFFF; + font-size:1.8rem; + cursor: pointer; + top: 10px; + right: 26px +} + +.tarteaucitron-spacer-20 { + height: 20px; + display: block; +} + +.tarteaucitron-display-block { + display: block; +} + +.tarteaucitron-display-none { + display: none; +} \ No newline at end of file diff --git a/core/vendor/tarteaucitron/tarteaucitron.js b/core/vendor/tarteaucitron/tarteaucitron.js new file mode 100644 index 00000000..eea26add --- /dev/null +++ b/core/vendor/tarteaucitron/tarteaucitron.js @@ -0,0 +1,2116 @@ +/*jslint browser: true, evil: true */ + +var scripts = document.getElementsByTagName('script'), + path = scripts[scripts.length - 1].src.split('?')[0], + tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN, + cdn = (tarteaucitronForceCDN === '') ? path.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN, + alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch, + tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage, + tarteaucitronForceExpire = (tarteaucitronForceExpire === undefined) ? '' : tarteaucitronForceExpire, + tarteaucitronCustomText = (tarteaucitronCustomText === undefined) ? '' : tarteaucitronCustomText, + // tarteaucitronExpireInDay: true for day(s) value - false for hour(s) value + tarteaucitronExpireInDay = (tarteaucitronExpireInDay === undefined || typeof tarteaucitronExpireInDay !== "boolean") ? true : tarteaucitronExpireInDay, + timeExpire = 31536000000, + tarteaucitronProLoadServices, + tarteaucitronNoAdBlocker = false; + + + +var tarteaucitron = { + "version": 20230203, + "cdn": cdn, + "user": {}, + "lang": {}, + "services": {}, + "added": [], + "idprocessed": [], + "state": [], + "launch": [], + "parameters": {}, + "isAjax": false, + "reloadThePage": false, + "events": { + "init": function () {}, + "load": function () {}, + }, + "init": function (params) { + "use strict"; + var origOpen; + + tarteaucitron.parameters = params; + if (alreadyLaunch === 0) { + alreadyLaunch = 1; + if (window.addEventListener) { + window.addEventListener("load", function () { + tarteaucitron.initEvents.loadEvent(false); + }, false); + window.addEventListener("scroll", function () { + tarteaucitron.initEvents.scrollEvent(); + }, false); + + window.addEventListener("keydown", function (evt) { + tarteaucitron.initEvents.keydownEvent(false, evt); + }, false); + window.addEventListener("hashchange", function () { + tarteaucitron.initEvents.hashchangeEvent(); + }, false); + window.addEventListener("resize", function () { + tarteaucitron.initEvents.resizeEvent(); + }, false); + } else { + window.attachEvent("onload", function () { + tarteaucitron.initEvents.loadEvent(true); + }); + window.attachEvent("onscroll", function () { + tarteaucitron.initEvents.scrollEvent(); + }); + window.attachEvent("onkeydown", function (evt) { + tarteaucitron.initEvents.keydownEvent(true, evt); + + }); + window.attachEvent("onhashchange", function () { + tarteaucitron.initEvents.hashchangeEvent(); + }); + window.attachEvent("onresize", function () { + tarteaucitron.initEvents.resizeEvent(); + }); + } + + if (typeof XMLHttpRequest !== 'undefined') { + origOpen = XMLHttpRequest.prototype.open; + XMLHttpRequest.prototype.open = function () { + + if (window.addEventListener) { + this.addEventListener("load", function () { + if (typeof tarteaucitronProLoadServices === 'function') { + tarteaucitronProLoadServices(); + } + }, false); + } else if (typeof this.attachEvent !== 'undefined') { + this.attachEvent("onload", function () { + if (typeof tarteaucitronProLoadServices === 'function') { + tarteaucitronProLoadServices(); + } + }); + } else { + if (typeof tarteaucitronProLoadServices === 'function') { + setTimeout(tarteaucitronProLoadServices, 1000); + } + } + + try { + origOpen.apply(this, arguments); + } catch (err) {} + }; + } + } + + if(tarteaucitron.events.init) { + tarteaucitron.events.init(); + } + }, + "initEvents": { + "loadEvent": function (isOldBrowser) { + tarteaucitron.load(); + tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) { + if (isOldBrowser) { + elem.attachEvent("onclick", function (event) { + tarteaucitron.userInterface.openPanel(); + event.preventDefault(); + }); + } else { + elem.addEventListener("click", function (event) { + tarteaucitron.userInterface.openPanel(); + event.preventDefault(); + }, false); + } + }, true); + }, + "keydownEvent": function (isOldBrowser, evt) { + if (evt.keyCode === 27) { + tarteaucitron.userInterface.closePanel(); + } + + if (isOldBrowser) { + if ( evt.keyCode === 9 && focusableEls.indexOf(evt.target) >= 0) { + if ( evt.shiftKey ) /* shift + tab */ { + if (document.activeElement === firstFocusableEl) { + lastFocusableEl.focus(); + evt.preventDefault(); + } + } else /* tab */ { + if (document.activeElement === lastFocusableEl) { + firstFocusableEl.focus(); + evt.preventDefault(); + } + } + } + } + }, + "hashchangeEvent": function () { + if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') { + tarteaucitron.userInterface.openPanel(); + } + }, + "resizeEvent": function () { + var tacElem = document.getElementById('tarteaucitron'); + var tacCookieContainer = document.getElementById('tarteaucitronCookiesListContainer'); + + if (tacElem && tacElem.style.display === 'block') { + tarteaucitron.userInterface.jsSizing('main'); + } + + if (tacCookieContainer && tacCookieContainer.style.display === 'block') { + tarteaucitron.userInterface.jsSizing('cookie'); + } + }, + "scrollEvent": function () { + var scrollPos = window.pageYOffset || document.documentElement.scrollTop; + var heightPosition; + var tacPercentage = document.getElementById('tarteaucitronPercentage'); + var tacAlertBig = document.getElementById('tarteaucitronAlertBig'); + + if (tacAlertBig && !tarteaucitron.highPrivacy) { + if (tacAlertBig.style.display === 'block') { + heightPosition = tacAlertBig.offsetHeight + 'px'; + + if (scrollPos > (screen.height * 2)) { + tarteaucitron.userInterface.respondAll(true); + } else if (scrollPos > (screen.height / 2)) { + document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '' + tarteaucitron.lang.alertBigScroll + ' ' + tarteaucitron.lang.alertBig; + } + + if (tacPercentage) { + if (tarteaucitron.orientation === 'top') { + tacPercentage.style.top = heightPosition; + } else { + tacPercentage.style.bottom = heightPosition; + } + tacPercentage.style.width = ((100 / (screen.height * 2)) * scrollPos) + '%'; + } + } + } + }, + }, + "load": function () { + "use strict"; + var cdn = tarteaucitron.cdn, + language = tarteaucitron.getLanguage(), + useJSDelivrMinifiedJS = (cdn.indexOf('cdn.jsdelivr.net') >= 0), + pathToLang = cdn + 'lang/tarteaucitron.' + language + (useJSDelivrMinifiedJS ? '.min' : '') + '.js?v=' + tarteaucitron.version, + pathToServices = cdn + 'tarteaucitron.services' + (useJSDelivrMinifiedJS ? '.min' : '') + '.js?v=' + tarteaucitron.version, + linkElement = document.createElement('link'), + defaults = { + "adblocker": false, + "hashtag": '#tarteaucitron', + "cookieName": 'tarteaucitron', + "highPrivacy": true, + "orientation": "middle", + "bodyPosition": "bottom", + "removeCredit": false, + "showAlertSmall": false, + "showIcon": true, + "iconPosition": "BottomRight", + "cookieslist": false, + "handleBrowserDNTRequest": false, + "DenyAllCta": true, + "AcceptAllCta" : true, + "moreInfoLink": true, + "privacyUrl": "", + "useExternalCss": false, + "useExternalJs": false, + "mandatory": true, + "mandatoryCta": true, + "closePopup": false, + "groupServices": false, + "serviceDefaultState": 'wait', + }, + params = tarteaucitron.parameters; + + // Don't show the middle bar if we are on the privacy policy or more page + if (((tarteaucitron.parameters.readmoreLink !== undefined && window.location.href == tarteaucitron.parameters.readmoreLink) || window.location.href == tarteaucitron.parameters.privacyUrl) && tarteaucitron.parameters.orientation == "middle") { + tarteaucitron.parameters.orientation = "bottom"; + } + + // Step -1 + if (typeof tarteaucitronCustomPremium !== 'undefined') { + tarteaucitronCustomPremium(); + } + + // Step 0: get params + if (params !== undefined) { + + for (var k in defaults) { + if(!tarteaucitron.parameters.hasOwnProperty(k)) { + tarteaucitron.parameters[k] = defaults[k]; + } + } + } + + // global + tarteaucitron.orientation = tarteaucitron.parameters.orientation; + tarteaucitron.hashtag = tarteaucitron.parameters.hashtag; + tarteaucitron.highPrivacy = tarteaucitron.parameters.highPrivacy; + tarteaucitron.handleBrowserDNTRequest = tarteaucitron.parameters.handleBrowserDNTRequest; + tarteaucitron.customCloserId = tarteaucitron.parameters.customCloserId; + + // Step 1: load css + if ( !tarteaucitron.parameters.useExternalCss ) { + linkElement.rel = 'stylesheet'; + linkElement.type = 'text/css'; + linkElement.href = cdn + 'css/tarteaucitron' + (useJSDelivrMinifiedJS ? '.min' : '') + '.css?v=' + tarteaucitron.version; + document.getElementsByTagName('head')[0].appendChild(linkElement); + } + // Step 2: load language and services + tarteaucitron.addInternalScript(pathToLang, '', function () { + + if(tarteaucitronCustomText !== ''){ + tarteaucitron.lang = tarteaucitron.AddOrUpdate(tarteaucitron.lang, tarteaucitronCustomText); + } + tarteaucitron.addInternalScript(pathToServices, '', function () { + + // css for the middle bar TODO: add it on the css file + if (tarteaucitron.orientation === 'middle') { + var customThemeMiddle = document.createElement('style'), + cssRuleMiddle = 'div#tarteaucitronRoot.tarteaucitronBeforeVisible:before {content: \'\';position: fixed;width: 100%;height: 100%;background: white;top: 0;left: 0;z-index: 999;opacity: 0.5;}div#tarteaucitronAlertBig:before {content: \'' + tarteaucitron.lang.middleBarHead + '\';font-size: 35px;}body #tarteaucitronRoot div#tarteaucitronAlertBig {width: 60%;min-width: 285px;height: auto;margin: auto;left: 50%;top: 50%;transform: translate(-50%, -50%);box-shadow: 0 0 9000px #000;border-radius: 20px;padding: 35px 25px;}span#tarteaucitronDisclaimerAlert {padding: 0 30px;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 10px 0 30px;display: block;text-align: center;font-size: 21px;}@media screen and (max-width: 900px) {div#tarteaucitronAlertBig button {margin: 0 auto 10px!important;display: block!important;}}'; + + customThemeMiddle.type = 'text/css'; + if (customThemeMiddle.styleSheet) { + customThemeMiddle.styleSheet.cssText = cssRuleMiddle; + } else { + customThemeMiddle.appendChild(document.createTextNode(cssRuleMiddle)); + } + document.getElementsByTagName('head')[0].appendChild(customThemeMiddle); + } + + // css for the popup bar TODO: add it on the css file + if (tarteaucitron.orientation === 'popup') { + var customThemePopup = document.createElement('style'), + cssRulePopup = 'div#tarteaucitronAlertBig:before {content: \'' + tarteaucitron.lang.middleBarHead + '\';font-size: 22px;}body #tarteaucitronRoot div#tarteaucitronAlertBig {bottom: 0;top: auto!important;left: 8px!important;right: auto!important;transform: initial!important;border-radius: 5px 5px 0 0!important;max-width: 250px!important;width: Calc(100% - 16px)!important;min-width: 0!important;padding: 25px 0;}span#tarteaucitronDisclaimerAlert {padding: 0 30px;font-size: 15px!important;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 10px 0 30px;display: block;text-align: center;font-size: 21px;}div#tarteaucitronAlertBig button {margin: 0 auto 10px!important;display: block!important;width: Calc(100% - 60px);box-sizing: border-box;}'; + + customThemePopup.type = 'text/css'; + if (customThemePopup.styleSheet) { + customThemePopup.styleSheet.cssText = cssRulePopup; + } else { + customThemePopup.appendChild(document.createTextNode(cssRulePopup)); + } + document.getElementsByTagName('head')[0].appendChild(customThemePopup); + } + + var body = document.body, + div = document.createElement('div'), + html = '', + index, + orientation = 'Top', + cat = ['ads', 'analytic', 'api', 'comment', 'social', 'support', 'video', 'other'], + i; + + cat = cat.sort(function (a, b) { + if (tarteaucitron.lang[a].title > tarteaucitron.lang[b].title) { return 1; } + if (tarteaucitron.lang[a].title < tarteaucitron.lang[b].title) { return -1; } + return 0; + }); + + // Step 3: prepare the html + html += '
' + tarteaucitron.lang.title + '
'; + html += '
'; + if (tarteaucitron.reloadThePage) { + html += ''; + } else { + html += ''; + } + html += ''; + + if (tarteaucitron.parameters.orientation === 'bottom') { + orientation = 'Bottom'; + } + + if (tarteaucitron.parameters.highPrivacy && !tarteaucitron.parameters.AcceptAllCta) { + html += '
'; + //html += '
'; + html += ' '; + html += ' ' + tarteaucitron.lang.alertBigPrivacy; + html += ' '; + //html += ' '; + html += ' '; + + if (tarteaucitron.parameters.privacyUrl !== "") { + html += ' '; + } + + //html += ' '; + //html += '
'; + html += '
'; + } else { + html += '
'; + //html += '
'; + html += ' '; + + if (tarteaucitron.parameters.highPrivacy) { + html += ' ' + tarteaucitron.lang.alertBigPrivacy; + } else { + html += ' ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig; + } + + html += ' '; + //html += ' '; + html += ' '; + + + if (tarteaucitron.parameters.DenyAllCta) { + if (tarteaucitron.reloadThePage) { + html += ' '; + //html += '

'; + } + + html += ' '; + + if (tarteaucitron.parameters.privacyUrl !== "") { + html += ' '; + } + + //html += '
'; + //html += '
'; + html += '
'; + html += '
'; + } + + if (tarteaucitron.parameters.showIcon === true) { + html += '
'; + html += ' '; + html += '
'; + } + + if (tarteaucitron.parameters.showAlertSmall === true) { + html += '
'; + html += ' '; + html += '
'; + if (tarteaucitron.reloadThePage) { + html += ' '; + html += '
'; + html += ' 0 cookie'; + html += '
'; + html += '
'; + html += '
'; + } else { + html += '
'; + } + html += ''; + } + + tarteaucitron.addInternalScript(tarteaucitron.cdn + 'advertising' + (useJSDelivrMinifiedJS ? '.min' : '') + '.js?v=' + tarteaucitron.version, '', function () { + if (tarteaucitronNoAdBlocker === true || tarteaucitron.parameters.adblocker === false) { + + // create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened + /*var wrapper = document.createElement('div'); + wrapper.id = "tarteaucitronContentWrapper"; + + while (document.body.firstChild) + { + wrapper.appendChild(document.body.firstChild); + } + + // Append the wrapper to the body + document.body.appendChild(wrapper);*/ + + div.id = 'tarteaucitronRoot'; + if (tarteaucitron.parameters.bodyPosition === 'top') { + // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility + var bodyFirstChild = body.firstChild; + body.insertBefore(div, bodyFirstChild); + } + else { + // Append tarteaucitron: #tarteaucitronRoot last-child of the body + body.appendChild(div, body); + } + + div.setAttribute('data-nosnippet', 'true'); + div.setAttribute('lang', language); + div.setAttribute('role', 'region'); + div.setAttribute('aria-labelledby', 'tac_title'); + + div.innerHTML = html; + + //ie compatibility + var tacRootAvailableEvent; + if(typeof(Event) === 'function') { + tacRootAvailableEvent = new Event("tac.root_available"); + }else if (typeof(document.createEvent) === 'function'){ + tacRootAvailableEvent = document.createEvent('Event'); + tacRootAvailableEvent.initEvent("tac.root_available", true, true); + } + //end ie compatibility + + if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacRootAvailableEvent);} + + if (tarteaucitron.job !== undefined) { + tarteaucitron.job = tarteaucitron.cleanArray(tarteaucitron.job); + for (index = 0; index < tarteaucitron.job.length; index += 1) { + tarteaucitron.addService(tarteaucitron.job[index]); + } + } else { + tarteaucitron.job = []; + } + + if (tarteaucitron.job.length === 0) { + tarteaucitron.userInterface.closeAlert(); + } + + tarteaucitron.isAjax = true; + + tarteaucitron.job.push = function (id) { + + // ie <9 hack + if (typeof tarteaucitron.job.indexOf === 'undefined') { + tarteaucitron.job.indexOf = function (obj, start) { + var i, + j = this.length; + for (i = (start || 0); i < j; i += 1) { + if (this[i] === obj) { return i; } + } + return -1; + }; + } + + if (tarteaucitron.job.indexOf(id) === -1) { + Array.prototype.push.call(this, id); + } + tarteaucitron.launch[id] = false; + tarteaucitron.addService(id); + }; + + if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') { + tarteaucitron.userInterface.openPanel(); + } + + tarteaucitron.cookie.number(); + setInterval(tarteaucitron.cookie.number, 60000); + } + }, tarteaucitron.parameters.adblocker); + + if (tarteaucitron.parameters.adblocker === true) { + setTimeout(function () { + if (tarteaucitronNoAdBlocker === false) { + html = ''; + html += '
' + tarteaucitron.lang.title + '
'; + html += '
'; + + div.id = 'tarteaucitronRoot'; + if (tarteaucitron.parameters.bodyPosition === 'top') { + // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility + var bodyFirstChild = body.firstChild; + body.insertBefore(div, bodyFirstChild); + } + else { + // Append tarteaucitron: #tarteaucitronRoot last-child of the body + body.appendChild(div, body); + } + + div.setAttribute('data-nosnippet', 'true'); + div.setAttribute('lang', language); + div.setAttribute('role', 'region'); + div.setAttribute('aria-labelledby', 'tac_title'); + + div.innerHTML = html; + } + }, 1500); + } + if(tarteaucitron.parameters.closePopup === true){ + setTimeout(function() { + var closeElement = document.getElementById('tarteaucitronAlertBig'), + closeSpan = document.createElement('span'); + if (closeElement) { + closeSpan.textContent = 'X'; + closeSpan.setAttribute('id', "tarteaucitronCloseCross"); + closeElement.insertBefore(closeSpan, closeElement.firstElementChild); + } + }, 100); + } + + + if(tarteaucitron.parameters.groupServices === true) { + var tac_group_style = document.createElement('style'); + tac_group_style.innerHTML = '.tarteaucitronTitle{display:none}'; + document.head.appendChild(tac_group_style); + var cats = document.querySelectorAll('[id^="tarteaucitronServicesTitle_"]') + Array.prototype.forEach.call(cats, function(item) { + var cat = item.getAttribute('id').replace(/^(tarteaucitronServicesTitle_)/, ""); + if (cat !== "mandatory") { + var html = ''; + html += '
  • '; + html += '
    '; + html += ' '+tarteaucitron.lang[cat].title+''; + html += ' '+tarteaucitron.lang[cat].details+''; + html += ' '; + html += '
    '; + html += '
    '; + html += ' '; + html += ' '; + html += '
    '; + html += '
  • '; + var ul = document.createElement('ul'); + ul.innerHTML = html; + item.insertBefore(ul, item.querySelector('#tarteaucitronServices_'+cat+'')); + document.querySelector('#tarteaucitronServices_' + cat).style.display = 'none'; + tarteaucitron.addClickEventToId("tarteaucitron-toggle-group-" + cat, function () { + tarteaucitron.userInterface.toggle('tarteaucitronServices_' + cat); + if (document.getElementById('tarteaucitronServices_' + cat).style.display == 'block') { + tarteaucitron.userInterface.addClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded'); + document.getElementById('tarteaucitron-toggle-group-'+cat).setAttribute('aria-expanded', 'true'); + } else { + tarteaucitron.userInterface.removeClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded'); + document.getElementById('tarteaucitron-toggle-group-'+cat).setAttribute('aria-expanded', 'false'); + } + tarteaucitron.initEvents.resizeEvent(); + }); + tarteaucitron.addClickEventToId("tarteaucitron-accept-group-" + cat, function () { + tarteaucitron.userInterface.respondAll(true, cat); + }); + tarteaucitron.addClickEventToId("tarteaucitron-reject-group-" + cat, function () { + tarteaucitron.userInterface.respondAll(false, cat); + }); + } + }); + } + tarteaucitron.userInterface.color("", true); + + // add a little timeout to be sure everything is accessible + setTimeout(function () { + + // Setup events + tarteaucitron.addClickEventToId("tarteaucitronCloseCross", function () { + tarteaucitron.userInterface.closeAlert(); + }); + tarteaucitron.addClickEventToId("tarteaucitronPersonalize", function () { + tarteaucitron.userInterface.openPanel(); + }); + tarteaucitron.addClickEventToId("tarteaucitronPersonalize2", function () { + tarteaucitron.userInterface.respondAll(true); + }); + tarteaucitron.addClickEventToId("tarteaucitronManager", function () { + tarteaucitron.userInterface.openPanel(); + }); + tarteaucitron.addClickEventToId("tarteaucitronBack", function () { + tarteaucitron.userInterface.closePanel(); + }); + tarteaucitron.addClickEventToId("tarteaucitronClosePanel", function () { + tarteaucitron.userInterface.closePanel(); + }); + tarteaucitron.addClickEventToId("tarteaucitronClosePanelCookie", function () { + tarteaucitron.userInterface.closePanel(); + }); + tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrl", function () { + document.location = tarteaucitron.parameters.privacyUrl; + }); + tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrlDialog", function () { + document.location = tarteaucitron.parameters.privacyUrl; + }); + tarteaucitron.addClickEventToId("tarteaucitronCookiesNumber", function () { + tarteaucitron.userInterface.toggleCookiesList(); + }); + tarteaucitron.addClickEventToId("tarteaucitronAllAllowed", function () { + tarteaucitron.userInterface.respondAll(true); + }); + tarteaucitron.addClickEventToId("tarteaucitronAllDenied", function () { + tarteaucitron.userInterface.respondAll(false); + }); + tarteaucitron.addClickEventToId("tarteaucitronAllDenied2", function () { + tarteaucitron.userInterface.respondAll(false, '', true); + if (tarteaucitron.reloadThePage === true) { + window.location.reload(); + } + }); + tarteaucitron.addClickEventToId("tarteaucitronCloseAlert", function () { + tarteaucitron.userInterface.openPanel(); + }); + tarteaucitron.addClickEventToId("tarteaucitronCTAButton", function () { + location.reload(); + }); + var toggleBtns = document.getElementsByClassName("catToggleBtn"), i; + for (i = 0; i < toggleBtns.length; i++) { + toggleBtns[i].dataset.index = i; + tarteaucitron.addClickEventToElement(toggleBtns[i], function () { + tarteaucitron.userInterface.toggle('tarteaucitronDetails' + cat[this.dataset.index], 'tarteaucitronInfoBox'); + if (document.getElementById('tarteaucitronDetails' + cat[this.dataset.index]).style.display === 'block') { + this.setAttribute('aria-expanded', 'true'); + } else { + this.setAttribute('aria-expanded', 'false'); + } + return false; + }); + } + + var allowBtns = document.getElementsByClassName("tarteaucitronAllow"); + for (i = 0; i < allowBtns.length; i++) { + tarteaucitron.addClickEventToElement(allowBtns[i], function () { + tarteaucitron.userInterface.respond(this, true); + }); + } + var denyBtns = document.getElementsByClassName("tarteaucitronDeny"); + for (i = 0; i < denyBtns.length; i++) { + tarteaucitron.addClickEventToElement(denyBtns[i], function () { + tarteaucitron.userInterface.respond(this, false); + }); + } + if(tarteaucitron.events.load) { + tarteaucitron.events.load(); + } + }, 500); + + }); + }); + }, + "addService": function (serviceId) { + "use strict"; + var html = '', + s = tarteaucitron.services, + service = s[serviceId], + cookie = tarteaucitron.cookie.read(), + hostname = document.location.hostname, + hostRef = document.referrer.split('/')[2], + isNavigating = (hostRef === hostname && window.location.href !== tarteaucitron.parameters.privacyUrl), + isAutostart = (!service.needConsent), + isWaiting = (cookie.indexOf(service.key + '=wait') >= 0), + isDenied = (cookie.indexOf(service.key + '=false') >= 0), + isAllowed = ((cookie.indexOf(service.key + '=true') >= 0) || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)), + isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0), + isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1"), + currentStatus = (isAllowed) ? tarteaucitron.lang.allowed : tarteaucitron.lang.disallowed, + state = (undefined !== service.defaultState) ? service.defaultState : + (undefined !== tarteaucitron.parameters.serviceDefaultState ? tarteaucitron.parameters.serviceDefaultState : 'wait'); + + + if (tarteaucitron.added[service.key] !== true) { + tarteaucitron.added[service.key] = true; + + html += '
  • '; + html += '
    '; + html += ' ' + service.name + ''; + html += ' '+currentStatus+''; + html += ' - '; + html += '
    '; + if (tarteaucitron.parameters.moreInfoLink == true) { + + var link = 'https://tarteaucitron.io/service/' + service.key + '/'; + if (service.readmoreLink !== undefined && service.readmoreLink !== '') { + link = service.readmoreLink; + } + if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') { + link = tarteaucitron.parameters.readmoreLink; + } + html += ' '; + html += ' ' + tarteaucitron.lang.more; + html += ' '; + html += ' - '; + html += ' '; + html += ' ' + tarteaucitron.lang.source; + html += ' '; + } + + html += '
    '; + html += '
    '; + html += ' '; + html += ' '; + html += '
    '; + html += '
  • '; + + tarteaucitron.userInterface.css('tarteaucitronServicesTitle_' + service.type, 'display', 'block'); + + if (document.getElementById('tarteaucitronServices_' + service.type) !== null) { + document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html; + } + + tarteaucitron.userInterface.css('tarteaucitronNoServicesTitle', 'display', 'none'); + + tarteaucitron.userInterface.order(service.type); + + tarteaucitron.addClickEventToId(service.key + 'Allowed', function () { + tarteaucitron.userInterface.respond(this, true); + }); + + tarteaucitron.addClickEventToId(service.key + 'Denied', function () { + tarteaucitron.userInterface.respond(this, false); + }); + } + + tarteaucitron.pro('!' + service.key + '=' + isAllowed); + + // allow by default for non EU + if (isResponded === false && tarteaucitron.user.bypass === true) { + isAllowed = true; + tarteaucitron.cookie.create(service.key, true); + } + + if ((!isResponded && (isAutostart || (isNavigating && isWaiting)) && !tarteaucitron.highPrivacy) || isAllowed) { + if (!isAllowed || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)) { + tarteaucitron.cookie.create(service.key, true); + } + if (tarteaucitron.launch[service.key] !== true) { + tarteaucitron.launch[service.key] = true; + if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.js(); } + tarteaucitron.sendEvent(service.key + '_loaded'); + } + tarteaucitron.state[service.key] = true; + tarteaucitron.userInterface.color(service.key, true); + } else if (isDenied) { + if (typeof service.fallback === 'function') { + if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.fallback(); } + } + tarteaucitron.state[service.key] = false; + tarteaucitron.userInterface.color(service.key, false); + } else if (!isResponded && isDNTRequested && tarteaucitron.handleBrowserDNTRequest) { + tarteaucitron.cookie.create(service.key, 'false'); + if (typeof service.fallback === 'function') { + if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.fallback(); } + } + tarteaucitron.state[service.key] = false; + tarteaucitron.userInterface.color(service.key, false); + } else if (!isResponded) { + tarteaucitron.cookie.create(service.key, state); + if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { + if(true === state && typeof service.js === 'function') { + service.js(); + } else if (typeof service.fallback === 'function') { + service.fallback(); + } + } + + tarteaucitron.userInterface.color(service.key, state); + + if( 'wait' === state ) { + tarteaucitron.userInterface.openAlert(); + } + } + + tarteaucitron.cookie.checkCount(service.key); + tarteaucitron.sendEvent(service.key + '_added') + }, + "sendEvent" : function(event_key) { + if(event_key !== undefined) { + //ie compatibility + var send_event_item; + if(typeof(Event) === 'function') { + send_event_item = new Event(event_key); + }else if (typeof(document.createEvent) === 'function'){ + send_event_item = document.createEvent('Event'); + send_event_item.initEvent(event_key, true, true); + } + //end ie compatibility + + document.dispatchEvent(send_event_item); + } + }, + "cleanArray": function cleanArray(arr) { + "use strict"; + var i, + len = arr.length, + out = [], + obj = {}, + s = tarteaucitron.services; + + for (i = 0; i < len; i += 1) { + if (!obj[arr[i]]) { + obj[arr[i]] = {}; + if (tarteaucitron.services[arr[i]] !== undefined) { + out.push(arr[i]); + } + } + } + + out = out.sort(function (a, b) { + if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; } + if (s[a].type + s[a].key < s[b].type + s[b].key) { return -1; } + return 0; + }); + + return out; + }, + "userInterface": { + "css": function (id, property, value) { + "use strict"; + if (document.getElementById(id) !== null) { + + if (property == "display" && value == "none" && (id == "tarteaucitron" || id == "tarteaucitronBack" || id == "tarteaucitronAlertBig")) { + document.getElementById(id).style["opacity"] = "0"; + + /*setTimeout(function() {*/document.getElementById(id).style[property] = value;/*}, 200);*/ + } else { + + document.getElementById(id).style[property] = value; + + if (property == "display" && value == "block" && (id == "tarteaucitron" || id == "tarteaucitronAlertBig")) { + document.getElementById(id).style["opacity"] = "1"; + } + + if (property == "display" && value == "block" && id == "tarteaucitronBack") { + document.getElementById(id).style["opacity"] = "0.7"; + } + } + } + }, + "addClass": function (id, className) { + "use strict"; + if (document.getElementById(id) !== null && document.getElementById(id).classList !== undefined) { + document.getElementById(id).classList.add(className); + } + }, + "removeClass": function (id, className) { + "use strict"; + if (document.getElementById(id) !== null && document.getElementById(id).classList !== undefined) { + document.getElementById(id).classList.remove(className); + } + }, + "respondAll": function (status, type, allowSafeAnalytics) { + "use strict"; + var s = tarteaucitron.services, + service, + key, + index = 0; + + for (index = 0; index < tarteaucitron.job.length; index += 1) { + + if (typeof type !== 'undefined' && type !== '' && s[tarteaucitron.job[index]].type !== type) { + continue; + } + + if (allowSafeAnalytics && typeof s[tarteaucitron.job[index]].safeanalytic !== "undefined" && s[tarteaucitron.job[index]].safeanalytic === true) { + continue; + } + + service = s[tarteaucitron.job[index]]; + key = service.key; + if (tarteaucitron.state[key] !== status) { + if (status === false && tarteaucitron.launch[key] === true) { + tarteaucitron.reloadThePage = true; + if (tarteaucitron.checkIfExist('tarteaucitronClosePanel')) { + var ariaCloseValue = document.getElementById('tarteaucitronClosePanel').textContent.trim() + ' (' + tarteaucitron.lang.reload + ')'; + document.getElementById('tarteaucitronClosePanel').setAttribute("aria-label", ariaCloseValue); + document.getElementById('tarteaucitronClosePanel').setAttribute("title", ariaCloseValue); + } + } + if (tarteaucitron.launch[key] !== true && status === true) { + + tarteaucitron.pro('!' + key + '=engage'); + + tarteaucitron.launch[key] = true; + if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); } + tarteaucitron.sendEvent(key + '_loaded'); + } + var itemStatusElem = document.getElementById('tacCurrentStatus'+key); + if(status == true){ + itemStatusElem.innerHTML = tarteaucitron.lang.allowed; + tarteaucitron.sendEvent(key + '_allowed'); + }else{ + itemStatusElem.innerHTML = tarteaucitron.lang.disallowed; + tarteaucitron.sendEvent(key + '_disallowed'); + } + tarteaucitron.state[key] = status; + tarteaucitron.cookie.create(key, status); + tarteaucitron.userInterface.color(key, status); + } + } + }, + "respond": function (el, status) { + "use strict"; + if (el.id === '') { + return; + } + var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), ''); + + if (key.substring(0, 13) === 'tarteaucitron' || key === '') {return;} + + // return if same state + if (tarteaucitron.state[key] === status) { + return; + } + + if (status === false && tarteaucitron.launch[key] === true) { + tarteaucitron.reloadThePage = true; + if (tarteaucitron.checkIfExist('tarteaucitronClosePanel')) { + var ariaCloseValue = document.getElementById('tarteaucitronClosePanel').textContent.trim() + ' (' + tarteaucitron.lang.reload + ')'; + document.getElementById('tarteaucitronClosePanel').setAttribute("aria-label", ariaCloseValue); + document.getElementById('tarteaucitronClosePanel').setAttribute("title", ariaCloseValue); + } + } + + // if not already launched... launch the service + if (status === true) { + if (tarteaucitron.launch[key] !== true) { + + tarteaucitron.pro('!' + key + '=engage'); + + tarteaucitron.launch[key] = true; + if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); } + tarteaucitron.sendEvent(key + '_loaded'); + } + } + var itemStatusElem = document.getElementById('tacCurrentStatus'+key); + if(status == true){ + itemStatusElem.innerHTML = tarteaucitron.lang.allowed; + tarteaucitron.sendEvent(key + '_allowed'); + }else{ + itemStatusElem.innerHTML = tarteaucitron.lang.disallowed; + tarteaucitron.sendEvent(key + '_disallowed'); + } + tarteaucitron.state[key] = status; + tarteaucitron.cookie.create(key, status); + tarteaucitron.userInterface.color(key, status); + }, + "color": function (key, status) { + "use strict"; + var c = 'tarteaucitron', + nbDenied = 0, + nbPending = 0, + nbAllowed = 0, + sum = tarteaucitron.job.length, + index, + s = tarteaucitron.services; + + if (key !== "") { + + if (status === true) { + tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsAllowed'); + tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsDenied'); + document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'true'); + document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'false'); + } else if (status === false) { + tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsAllowed'); + tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsDenied'); + document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'false'); + document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'true'); + } else { + document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'false'); + document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'false'); + } + + // check if all services are allowed + var sumToRemove = 0; + for (index = 0; index < sum; index += 1) { + + if (typeof s[tarteaucitron.job[index]].safeanalytic !== "undefined" && s[tarteaucitron.job[index]].safeanalytic === true) { + sumToRemove += 1; + continue; + } + + if (tarteaucitron.state[tarteaucitron.job[index]] === false) { + nbDenied += 1; + } else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) { + nbPending += 1; + } else if (tarteaucitron.state[tarteaucitron.job[index]] === true) { + nbAllowed += 1; + } + } + sum -= sumToRemove; + + tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%'); + tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%'); + tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%'); + + if (nbDenied === 0 && nbPending === 0) { + tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected'); + tarteaucitron.userInterface.addClass(c + 'AllAllowed', c + 'IsSelected'); + + tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsAllowed'); + tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied'); + + document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false'); + document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'true'); + + } else if (nbAllowed === 0 && nbPending === 0) { + tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected'); + tarteaucitron.userInterface.addClass(c + 'AllDenied', c + 'IsSelected'); + + tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed'); + tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsDenied'); + + document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'true'); + document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false'); + + } else { + tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected'); + tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected'); + + tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed'); + tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied'); + + document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false'); + document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false'); + } + + // close the alert if all service have been reviewed + if (nbPending === 0) { + tarteaucitron.userInterface.closeAlert(); + } + + if (tarteaucitron.services[key].cookies.length > 0 && status === false) { + tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies); + } + + if (status === true) { + if (document.getElementById('tacCL' + key) !== null) { + document.getElementById('tacCL' + key).innerHTML = '...'; + } + setTimeout(function () { + tarteaucitron.cookie.checkCount(key); + }, 2500); + } else { + tarteaucitron.cookie.checkCount(key); + } + + } + + // groups + var cats = document.querySelectorAll('[id^="tarteaucitronServicesTitle_"]') + Array.prototype.forEach.call(cats, function(item) { + var cat = item.getAttribute('id').replace(/^(tarteaucitronServicesTitle_)/, ""), + total = document.getElementById("tarteaucitronServices_"+cat).childElementCount; + var doc = document.getElementById("tarteaucitronServices_"+cat), + groupdenied = 0, + groupallowed = 0; + for (var ii = 0; ii < doc.children.length; ii++) { + if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsDenied") { + groupdenied++; + } + if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsAllowed") { + groupallowed++; + } + } + if (total === groupallowed) { + tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied'); + tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed'); + + if (document.getElementById('tarteaucitron-reject-group-'+cat)) { + document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false'); + document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'true'); + } + } + if (total === groupdenied) { + tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied'); + tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed'); + + if (document.getElementById('tarteaucitron-reject-group-'+cat)) { + document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'true'); + document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false'); + } + } + if (total !== groupdenied && total !== groupallowed) { + tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied'); + tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed'); + + if (document.getElementById('tarteaucitron-reject-group-'+cat)) { + document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false'); + document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false'); + } + } + groupdenied = 0; + groupallowed = 0; + }); + + }, + "openPanel": function () { + "use strict"; + + tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block'); + tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); + tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); + + document.getElementById('tarteaucitronClosePanel').focus(); + if (document.getElementsByTagName('body')[0].classList !== undefined) { + document.getElementsByTagName('body')[0].classList.add('tarteaucitron-modal-open'); + } + tarteaucitron.userInterface.focusTrap(); + tarteaucitron.userInterface.jsSizing('main'); + + //ie compatibility + var tacOpenPanelEvent; + if(typeof(Event) === 'function') { + tacOpenPanelEvent = new Event("tac.open_panel"); + }else if (typeof(document.createEvent) === 'function'){ + tacOpenPanelEvent = document.createEvent('Event'); + tacOpenPanelEvent.initEvent("tac.open_panel", true, true); + } + //end ie compatibility + + if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacOpenPanelEvent);} + }, + "closePanel": function () { + "use strict"; + + if (document.location.hash === tarteaucitron.hashtag) { + if (window.history) { + window.history.replaceState('', document.title, window.location.pathname + window.location.search); + } else { + document.location.hash = ''; + } + } + if (tarteaucitron.checkIfExist('tarteaucitron')) { + // accessibility: manage focus on close panel + if (tarteaucitron.checkIfExist('tarteaucitronCloseAlert')) { + document.getElementById('tarteaucitronCloseAlert').focus(); + } else if (tarteaucitron.checkIfExist('tarteaucitronManager')) { + document.getElementById('tarteaucitronManager').focus(); + } else if (tarteaucitron.customCloserId && tarteaucitron.checkIfExist(tarteaucitron.customCloserId)) { + document.getElementById(tarteaucitron.customCloserId).focus(); + } + tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); + } + + if (tarteaucitron.checkIfExist('tarteaucitronCookiesListContainer') && tarteaucitron.checkIfExist('tarteaucitronCookiesNumber')) { + // accessibility: manage focus on close cookies list + document.getElementById('tarteaucitronCookiesNumber').focus(); + document.getElementById('tarteaucitronCookiesNumber').setAttribute("aria-expanded", "false"); + tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); + } + + tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) { + elem.style.display = 'none'; + }, true); + + if (tarteaucitron.reloadThePage === true) { + window.location.reload(); + } else { + tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none'); + } + if (document.getElementsByTagName('body')[0].classList !== undefined) { + document.getElementsByTagName('body')[0].classList.remove('tarteaucitron-modal-open'); + } + + //ie compatibility + var tacClosePanelEvent; + if(typeof(Event) === 'function') { + tacClosePanelEvent = new Event("tac.close_panel"); + }else if (typeof(document.createEvent) === 'function'){ + tacClosePanelEvent = document.createEvent('Event'); + tacClosePanelEvent.initEvent("tac.close_panel", true, true); + } + //end ie compatibility + + if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacClosePanelEvent);} + }, + "focusTrap": function() { + "use strict"; + + var focusableEls, + firstFocusableEl, + lastFocusableEl, + filtered; + + focusableEls = document.getElementById('tarteaucitron').querySelectorAll('a[href], button'); + filtered = []; + + // get only visible items + for (var i = 0, max = focusableEls.length; i < max; i++) { + if (focusableEls[i].offsetHeight > 0) { + filtered.push(focusableEls[i]); + } + } + + firstFocusableEl = filtered[0]; + lastFocusableEl = filtered[filtered.length - 1]; + + //loop focus inside tarteaucitron + document.getElementById('tarteaucitron').addEventListener("keydown", function (evt) { + + if ( evt.key === 'Tab' || evt.keyCode === 9 ) { + + if ( evt.shiftKey ) /* shift + tab */ { + if (document.activeElement === firstFocusableEl) { + lastFocusableEl.focus(); + evt.preventDefault(); + } + } else /* tab */ { + if (document.activeElement === lastFocusableEl) { + firstFocusableEl.focus(); + evt.preventDefault(); + } + } + } + }) + }, + "openAlert": function () { + "use strict"; + var c = 'tarteaucitron'; + tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block'); + tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none'); + tarteaucitron.userInterface.css(c + 'Icon', 'display', 'none'); + tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'block'); + tarteaucitron.userInterface.addClass(c + 'Root', 'tarteaucitronBeforeVisible'); + + //ie compatibility + var tacOpenAlertEvent; + if(typeof(Event) === 'function') { + tacOpenAlertEvent = new Event("tac.open_alert"); + }else if (typeof(document.createEvent) === 'function'){ + tacOpenAlertEvent = document.createEvent('Event'); + tacOpenAlertEvent.initEvent("tac.open_alert", true, true); + } + //end ie compatibility + + if (document.getElementById('tarteaucitronAlertBig') !== null) { + document.getElementById('tarteaucitronAlertBig').focus(); + } + + if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacOpenAlertEvent);} + }, + "closeAlert": function () { + "use strict"; + var c = 'tarteaucitron'; + tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none'); + tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block'); + tarteaucitron.userInterface.css(c + 'Icon', 'display', 'block'); + tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'none'); + tarteaucitron.userInterface.removeClass(c + 'Root', 'tarteaucitronBeforeVisible'); + tarteaucitron.userInterface.jsSizing('box'); + + //ie compatibility + var tacCloseAlertEvent; + if(typeof(Event) === 'function') { + tacCloseAlertEvent = new Event("tac.close_alert"); + }else if (typeof(document.createEvent) === 'function'){ + tacCloseAlertEvent = document.createEvent('Event'); + tacCloseAlertEvent.initEvent("tac.close_alert", true, true); + } + //end ie compatibility + + if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacCloseAlertEvent);} + }, + "toggleCookiesList": function () { + "use strict"; + var div = document.getElementById('tarteaucitronCookiesListContainer'), + togglediv = document.getElementById('tarteaucitronCookiesNumber'); + + if (div === null) { + return; + } + + if (div.style.display !== 'block') { + tarteaucitron.cookie.number(); + div.style.display = 'block'; + togglediv.setAttribute("aria-expanded", "true"); + tarteaucitron.userInterface.jsSizing('cookie'); + tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); + tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); + tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) { + elem.style.display = 'none'; + }, true); + } else { + div.style.display = 'none'; + togglediv.setAttribute("aria-expanded", "false"); + tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); + tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none'); + } + }, + "toggle": function (id, closeClass) { + "use strict"; + var div = document.getElementById(id); + + if (div === null) { + return; + } + + if (closeClass !== undefined) { + tarteaucitron.fallback([closeClass], function (elem) { + if (elem.id !== id) { + elem.style.display = 'none'; + } + }, true); + } + + if (div.style.display !== 'block') { + div.style.display = 'block'; + } else { + div.style.display = 'none'; + } + }, + "order": function (id) { + "use strict"; + var main = document.getElementById('tarteaucitronServices_' + id), + allDivs, + store = [], + i; + + if (main === null) { + return; + } + + allDivs = main.childNodes; + + if (typeof Array.prototype.map === 'function' && typeof Enumerable === 'undefined') { + Array.prototype.map.call(main.children, Object).sort(function (a, b) { + //var mainChildren = Array.from(main.children); + //mainChildren.sort(function (a, b) { + if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; } + if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; } + return 0; + }).forEach(function (element) { + main.appendChild(element); + }); + } + }, + "jsSizing": function (type) { + "use strict"; + var scrollbarMarginRight = 10, + scrollbarWidthParent, + scrollbarWidthChild, + servicesHeight, + e = window, + a = 'inner', + windowInnerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, + mainTop, + mainHeight, + closeButtonHeight, + headerHeight, + cookiesListHeight, + cookiesCloseHeight, + cookiesTitleHeight, + paddingBox, + alertSmallHeight, + cookiesNumberHeight; + + if (type === 'box') { + if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) { + + // reset + tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px'); + + // calculate + alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight; + cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight; + paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2; + + // apply + tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px'); + } + } else if (type === 'main') { + + // get the real window width for media query + if (window.innerWidth === undefined) { + a = 'client'; + e = document.documentElement || document.body; + } + + // height of the services list container + if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) { + + // reset + tarteaucitron.userInterface.css('tarteaucitronServices', 'height', 'auto'); + + // calculate + mainHeight = document.getElementById('tarteaucitron').offsetHeight; + closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight; + + // apply + servicesHeight = (mainHeight - closeButtonHeight + 2); + tarteaucitron.userInterface.css('tarteaucitronServices', 'height', servicesHeight + 'px'); + tarteaucitron.userInterface.css('tarteaucitronServices', 'overflow-x', 'auto'); + } + + // align the main allow/deny button depending on scrollbar width + if (document.getElementById('tarteaucitronServices') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) { + + // media query + if (e[a + 'Width'] <= 479) { + //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px'); + } else if (e[a + 'Width'] <= 767) { + scrollbarMarginRight = 12; + } + + scrollbarWidthParent = document.getElementById('tarteaucitronServices').offsetWidth; + scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth; + //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px'); + } + + // center the main panel + if (document.getElementById('tarteaucitron') !== null) { + + // media query + if (e[a + 'Width'] <= 767) { + mainTop = 0; + } else { + mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21; + } + + if (document.getElementById('tarteaucitronMainLineOffset') !== null) { + if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) { + mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight; + } + } + + // correct + if (mainTop < 0) { + mainTop = 0; + } + + // apply + tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px'); + } + + + } else if (type === 'cookie') { + + // put cookies list at bottom + if (document.getElementById('tarteaucitronAlertSmall') !== null) { + tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px'); + } + + // height of cookies list + if (document.getElementById('tarteaucitronCookiesListContainer') !== null) { + + // reset + tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto'); + + // calculate + cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight; + cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight; + cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight; + + // apply + tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookiesListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px'); + } + } + } + }, + "cookie": { + "owner": {}, + "create": function (key, status) { + "use strict"; + + if (tarteaucitronForceExpire !== '') { + // The number of day(s)/hour(s) can't be higher than 1 year + if ((tarteaucitronExpireInDay && tarteaucitronForceExpire < 365) || (!tarteaucitronExpireInDay && tarteaucitronForceExpire < 8760)) { + if (tarteaucitronExpireInDay) { + // Multiplication to tranform the number of days to milliseconds + timeExpire = tarteaucitronForceExpire * 86400000; + } else { + // Multiplication to tranform the number of hours to milliseconds + timeExpire = tarteaucitronForceExpire * 3600000; + } + } + } + + var d = new Date(), + time = d.getTime(), + expireTime = time + timeExpire, // 365 days + regex = new RegExp("!" + key + "=(wait|true|false)", "g"), + cookie = tarteaucitron.cookie.read().replace(regex, ""), + value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status, + domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? '; domain=' + tarteaucitron.parameters.cookieDomain : '', + secure = location.protocol === 'https:' ? '; Secure' : ''; + + d.setTime(expireTime); + document.cookie = value + '; expires=' + d.toGMTString() + '; path=/' + domain + secure + '; samesite=lax'; + }, + "read": function () { + "use strict"; + var nameEQ = tarteaucitron.parameters.cookieName + "=", + ca = document.cookie.split(';'), + i, + c; + + for (i = 0; i < ca.length; i += 1) { + c = ca[i]; + while (c.charAt(0) === ' ') { + c = c.substring(1, c.length); + } + if (c.indexOf(nameEQ) === 0) { + return c.substring(nameEQ.length, c.length); + } + } + return ''; + }, + "purge": function (arr) { + "use strict"; + var i; + + for (i = 0; i < arr.length; i += 1) { + + var rgxpCookie = new RegExp("^(.*;)?\\s*" + arr[i] + "\\s*=\\s*[^;]+(.*)?$"); + if (document.cookie.match(rgxpCookie)) { + document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;'; + document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';'; + document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';'; + } + } + }, + "checkCount": function (key) { + "use strict"; + var arr = tarteaucitron.services[key].cookies, + nb = arr.length, + nbCurrent = 0, + html = '', + i, + status = document.cookie.indexOf(key + '=true'); + + if (status >= 0 && nb === 0) { + html += tarteaucitron.lang.useNoCookie; + } else if (status >= 0) { + for (i = 0; i < nb; i += 1) { + if (document.cookie.indexOf(arr[i] + '=') !== -1) { + nbCurrent += 1; + if (tarteaucitron.cookie.owner[arr[i]] === undefined) { + tarteaucitron.cookie.owner[arr[i]] = []; + } + if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) { + tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name); + } + } + } + + if (nbCurrent > 0) { + html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' cookie'; + if (nbCurrent > 1) { + html += 's'; + } + html += '.'; + } else { + html += tarteaucitron.lang.useNoCookie; + } + } else if (nb === 0) { + html = tarteaucitron.lang.noCookie; + } else { + html += tarteaucitron.lang.useCookie + ' ' + nb + ' cookie'; + if (nb > 1) { + html += 's'; + } + html += '.'; + } + + if (document.getElementById('tacCL' + key) !== null) { + document.getElementById('tacCL' + key).innerHTML = html; + } + }, + "crossIndexOf": function (arr, match) { + "use strict"; + var i; + for (i = 0; i < arr.length; i += 1) { + if (arr[i] === match) { + return true; + } + } + return false; + }, + "number": function () { + "use strict"; + var cookies = document.cookie.split(';'), + nb = (document.cookie !== '') ? cookies.length : 0, + html = '', + i, + name, + namea, + nameb, + c, + d, + s = (nb > 1) ? 's' : '', + savedname, + regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i, + regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn, + host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain; + + cookies = cookies.sort(function (a, b) { + namea = a.split('=', 1).toString().replace(/ /g, ''); + nameb = b.split('=', 1).toString().replace(/ /g, ''); + c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0'; + d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0'; + if (c + a > d + b) { return 1; } + if (c + a < d + b) { return -1; } + return 0; + }); + + if (document.cookie !== '') { + for (i = 0; i < nb; i += 1) { + name = cookies[i].split('=', 1).toString().replace(/ /g, ''); + if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) { + savedname = tarteaucitron.cookie.owner[name].join(' // '); + html += '
    '; + html += ' '; + html += ' ' + tarteaucitron.cookie.owner[name].join(' // '); + html += ' '; + html += '