1/*jslint browser: true, evil: true */ 2 3var scripts = document.getElementsByTagName('script'), 4 path = scripts[scripts.length - 1].src.split('?')[0], 5 tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN, 6 cdn = (tarteaucitronForceCDN === '') ? path.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN, 7 alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch, 8 tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage, 9 tarteaucitronForceExpire = (tarteaucitronForceExpire === undefined) ? '' : tarteaucitronForceExpire, 10 tarteaucitronCustomText = (tarteaucitronCustomText === undefined) ? '' : tarteaucitronCustomText, 11 // tarteaucitronExpireInDay: true for day(s) value - false for hour(s) value 12 tarteaucitronExpireInDay = (tarteaucitronExpireInDay === undefined || typeof tarteaucitronExpireInDay !== "boolean") ? true : tarteaucitronExpireInDay, 13 timeExpire = 31536000000, 14 tarteaucitronProLoadServices, 15 tarteaucitronNoAdBlocker = false; 16 17 18 19var tarteaucitron = { 20 "version": 20201013, 21 "cdn": cdn, 22 "user": {}, 23 "lang": {}, 24 "services": {}, 25 "added": [], 26 "idprocessed": [], 27 "state": [], 28 "launch": [], 29 "parameters": {}, 30 "isAjax": false, 31 "reloadThePage": false, 32 "events": { 33 "init": function () {}, 34 "load": function () {}, 35 }, 36 "init": function (params) { 37 "use strict"; 38 var origOpen; 39 40 tarteaucitron.parameters = params; 41 if (alreadyLaunch === 0) { 42 alreadyLaunch = 1; 43 if (window.addEventListener) { 44 window.addEventListener("load", function () { 45 tarteaucitron.initEvents.loadEvent(false); 46 }, false); 47 window.addEventListener("scroll", function () { 48 tarteaucitron.initEvents.scrollEvent(); 49 }, false); 50 51 window.addEventListener("keydown", function (evt) { 52 tarteaucitron.initEvents.keydownEvent(false, evt); 53 }, false); 54 window.addEventListener("hashchange", function () { 55 tarteaucitron.initEvents.hashchangeEvent(); 56 }, false); 57 window.addEventListener("resize", function () { 58 tarteaucitron.initEvents.resizeEvent(); 59 }, false); 60 } else { 61 window.attachEvent("onload", function () { 62 tarteaucitron.initEvents.loadEvent(true); 63 });
vendor: 5,716 bytes, lines 63-196
63 64 window.attachEvent("onscroll", function () { 65 tarteaucitron.initEvents.scrollEvent(); 66 }); 67 window.attachEvent("onkeydown", function (evt) { 68 tarteaucitron.initEvents.keydownEvent(true, evt); 69 70 }); 71 window.attachEvent("onhashchange", function () { 72 tarteaucitron.initEvents.hashchangeEvent(); 73 }); 74 window.attachEvent("onresize", function () { 75 tarteaucitron.initEvents.resizeEvent(); 76 }); 77 } 78 79 if (typeof XMLHttpRequest !== 'undefined') { 80 origOpen = XMLHttpRequest.prototype.open; 81 XMLHttpRequest.prototype.open = function () { 82 83 if (window.addEventListener) { 84 this.addEventListener("load", function () { 85 if (typeof tarteaucitronProLoadServices === 'function') { 86 tarteaucitronProLoadServices(); 87 } 88 }, false); 89 } else if (typeof this.attachEvent !== 'undefined') { 90 this.attachEvent("onload", function () { 91 if (typeof tarteaucitronProLoadServices === 'function') { 92 tarteaucitronProLoadServices(); 93 } 94 }); 95 } else { 96 if (typeof tarteaucitronProLoadServices === 'function') { 97 setTimeout(tarteaucitronProLoadServices, 1000); 98 } 99 } 100 101 try { 102 origOpen.apply(this, arguments); 103 } catch (err) {} 104 }; 105 } 106 } 107 108 if(tarteaucitron.events.init) { 109 tarteaucitron.events.init(); 110 } 111 }, 112 "initEvents": { 113 "loadEvent": function (isOldBrowser) { 114 tarteaucitron.load(); 115 tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) { 116 if (isOldBrowser) { 117 elem.attachEvent("onclick", function (event) { 118 tarteaucitron.userInterface.openPanel(); 119 event.preventDefault(); 120 }); 121 } else { 122 elem.addEventListener("click", function (event) { 123 tarteaucitron.userInterface.openPanel(); 124 event.preventDefault(); 125 }, false); 126 } 127 }, true); 128 }, 129 "keydownEvent": function (isOldBrowser, evt) { 130 if (evt.keyCode === 27) { 131 tarteaucitron.userInterface.closePanel(); 132 } 133 134 if (isOldBrowser) { 135 if ( evt.keyCode === 9 && focusableEls.indexOf(evt.target) >= 0) { 136 if ( evt.shiftKey ) /* shift + tab */ { 137 if (document.activeElement === firstFocusableEl) { 138 lastFocusableEl.focus(); 139 evt.preventDefault(); 140 } 141 } else /* tab */ { 142 if (document.activeElement === lastFocusableEl) { 143 firstFocusableEl.focus(); 144 evt.preventDefault(); 145 } 146 } 147 } 148 } 149 }, 150 "hashchangeEvent": function () { 151 if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') { 152 tarteaucitron.userInterface.openPanel(); 153 } 154 }, 155 "resizeEvent": function () { 156 var tacElem = document.getElementById('tarteaucitron'); 157 var tacCookieContainer = document.getElementById('tarteaucitronCookiesListContainer'); 158 159 if (tacElem && tacElem.style.display === 'block') { 160 tarteaucitron.userInterface.jsSizing('main'); 161 } 162 163 if (tacCookieContainer && tacCookieContainer.style.display === 'block') { 164 tarteaucitron.userInterface.jsSizing('cookie'); 165 } 166 }, 167 "scrollEvent": function () { 168 var scrollPos = window.pageYOffset || document.documentElement.scrollTop; 169 var heightPosition; 170 var tacPercentage = document.getElementById('tarteaucitronPercentage'); 171 var tacAlertBig = document.getElementById('tarteaucitronAlertBig'); 172 173 if (tacAlertBig && !tarteaucitron.highPrivacy) { 174 if (tacAlertBig.style.display === 'block') { 175 heightPosition = tacAlertBig.offsetHeight + 'px'; 176 177 if (scrollPos > (screen.height * 2)) { 178 tarteaucitron.userInterface.respondAll(true); 179 } else if (scrollPos > (screen.height / 2)) { 180 document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '<strong>' + tarteaucitron.lang.alertBigScroll + '</strong> ' + tarteaucitron.lang.alertBig; 181 } 182 183 if (tacPercentage) { 184 if (tarteaucitron.orientation === 'top') { 185 tacPercentage.style.top = heightPosition; 186 } else { 187 tacPercentage.style.bottom = heightPosition; 188 } 189 tacPercentage.style.width = ((100 / (screen.height * 2)) * scrollPos) + '%'; 190 } 191 } 192 } 193 }, 194 }, 195 "load": function () { 196 "use strict";
197 var cdn = tarteaucitron.cdn, 198 language = tarteaucitron.getLanguage(), 199 pathToLang = cdn + 'lang/tarteaucitron.' + language + '.js?v=' + tarteaucitron.version, 200 pathToServices = cdn + 'tarteaucitron.services.js?v=' + tarteaucitron.version, 201 linkElement = document.createElement('link'), 202 defaults = { 203 "adblocker": false, 204 "hashtag": '#tarteaucitron', 205 "cookieName": 'tarteaucitron', 206 "highPrivacy": true, 207 "orientation": "middle", 208 "bodyPosition": "bottom", 209 "removeCredit": false, 210 "showAlertSmall": false, 211 "showIcon": true, 212 "iconPosition": "BottomRight", 213 "cookieslist": false, 214 "handleBrowserDNTRequest": false, 215 "DenyAllCta": true, 216 "AcceptAllCta" : true, 217 "moreInfoLink": true, 218 "privacyUrl": "", 219 "useExternalCss": false, 220 "useExternalJs": false, 221 "mandatory": true 222 }, 223 params = tarteaucitron.parameters; 224 225 // Don't show the middle bar if we are on the privacy policy or more page 226 if (((tarteaucitron.parameters.readmoreLink !== undefined && window.location.href == tarteaucitron.parameters.readmoreLink) || window.location.href == tarteaucitron.parameters.privacyUrl) && tarteaucitron.parameters.orientation == "middle") { 227 tarteaucitron.parameters.orientation = "bottom"; 228 } 229 230 // Step -1 231 if (typeof tarteaucitronCustomPremium !== 'undefined') { 232 tarteaucitronCustomPremium(); 233 } 234 235 // Step 0: get params 236 if (params !== undefined) { 237 238 for (var k in defaults) { 239 if(!tarteaucitron.parameters.hasOwnProperty(k)) { 240 tarteaucitron.parameters[k] = defaults[k]; 241 } 242 } 243 } 244 245 // global 246 tarteaucitron.orientation = tarteaucitron.parameters.orientation; 247 tarteaucitron.hashtag = tarteaucitron.parameters.hashtag; 248 tarteaucitron.highPrivacy = tarteaucitron.parameters.highPrivacy; 249 tarteaucitron.handleBrowserDNTRequest = tarteaucitron.parameters.handleBrowserDNTRequest; 250 251 // Step 1: load css 252 if ( !tarteaucitron.parameters.useExternalCss ) { 253 linkElement.rel = 'stylesheet'; 254 linkElement.type = 'text/css'; 255 linkElement.href = cdn + 'css/tarteaucitron.css?v=' + tarteaucitron.version; 256 document.getElementsByTagName('head')[0].appendChild(linkElement); 257 } 258 // Step 2: load language and services 259 tarteaucitron.addInternalScript(pathToLang, '', function () { 260 261 if(tarteaucitronCustomText !== ''){ 262 tarteaucitron.lang = tarteaucitron.AddOrUpdate(tarteaucitron.lang, tarteaucitronCustomText); 263 } 264 tarteaucitron.addInternalScript(pathToServices, '', function () { 265 266 267 // css for new middle bar 268 if (tarteaucitron.orientation === 'middle') { 269 var customThemeMiddle = document.createElement('style'), 270 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: 50px;}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: 50px 0;}span#tarteaucitronDisclaimerAlert {padding: 0 30px;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 50px 0;display: block;text-align: center;font-size: 21px;}'; 271 272 customThemeMiddle.type = 'text/css'; 273 if (customThemeMiddle.styleSheet) { 274 customThemeMiddle.styleSheet.cssText = cssRuleMiddle; 275 } else { 276 customThemeMiddle.appendChild(document.createTextNode(cssRuleMiddle)); 277 } 278 document.getElementsByTagName('head')[0].appendChild(customThemeMiddle); 279 } 280 281 var body = document.body, 282 div = document.createElement('div'), 283 html = '', 284 index, 285 orientation = 'Top', 286 cat = ['ads', 'analytic', 'api', 'comment', 'social', 'support', 'video', 'other'], 287 i; 288 289 cat = cat.sort(function (a, b) { 290 if (tarteaucitron.lang[a].title > tarteaucitron.lang[b].title) { return 1; } 291 if (tarteaucitron.lang[a].title < tarteaucitron.lang[b].title) { return -1; } 292 return 0; 293 }); 294 295 // Step 3: prepare the html 296 html += '<div id="tarteaucitronPremium"></div>'; 297 html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron.lang.close + '"></button>'; 298 html += '<div id="tarteaucitron" role="dialog" aria-labelledby="dialogTitle">'; 299 html += ' <button type="button" id="tarteaucitronClosePanel">'; 300 html += ' ' + tarteaucitron.lang.close; 301 html += ' </button>'; 302 html += ' <div id="tarteaucitronServices">'; 303 html += ' <div class="tarteaucitronLine tarteaucitronMainLine" id="tarteaucitronMainLineOffset">';
304 html += ' <span class="tarteaucitronH1" role="heading" aria-level="1" id="dialogTitle">'+ tarteaucitron.lang.title + '</span>'; 305 html += ' <div id="tarteaucitronInfo">'; 306 html += ' ' + tarteaucitron.lang.disclaimer; 307 if (tarteaucitron.parameters.privacyUrl !== "") { 308 html += ' <br/><br/>'; 309 html += ' <button type="button" id="tarteaucitronPrivacyUrlDialog">'; 310 html += ' ' + tarteaucitron.lang.privacyUrl; 311 html += ' </button>'; 312 } 313 html += ' </div>'; 314 html += ' <div class="tarteaucitronName">'; 315 html += ' <span class="tarteaucitronH2" role="heading" aria-level="2">' + tarteaucitron.lang.all + '</span>'; 316 html += ' </div>'; 317 html += ' <div class="tarteaucitronAsk" id="tarteaucitronScrollbarAdjust">'; 318 html += ' <button type="button" id="tarteaucitronAllAllowed" class="tarteaucitronAllow">'; 319 html += ' ✓ ' + tarteaucitron.lang.allowAll; 320 html += ' </button> '; 321 html += ' <button type="button" id="tarteaucitronAllDenied" class="tarteaucitronDeny">'; 322 html += ' ✗ ' + tarteaucitron.lang.denyAll; 323 html += ' </button>'; 324 html += ' </div>'; 325 html += ' </div>'; 326 html += ' <div class="tarteaucitronBorder">'; 327 html += ' <div class="clear"></div><ul>'; 328 329 330 if (tarteaucitron.parameters.mandatory == true) { 331 html += '<li id="tarteaucitronServicesTitle_mandatory">'; 332 html += '<div class="tarteaucitronTitle">'; 333 html += ' <button type="button"> ' + tarteaucitron.lang.mandatoryTitle + '</button>'; 334 html += '</div>'; 335 html += '<ul id="tarteaucitronServices_mandatory">'; 336 html += '<li class="tarteaucitronLine">'; 337 html += ' <div class="tarteaucitronName">';
vendor: 6,844 bytes, lines 338-441
338 html += ' <span class="tarteaucitronH3" role="heading" aria-level="3">' + tarteaucitron.lang.mandatoryText + '</span>'; 339 html += ' <span class="tarteaucitronListCookies"></span><br/>'; 340 html += ' </div>'; 341 html += ' <div class="tarteaucitronAsk">'; 342 html += ' <button type="button" class="tarteaucitronAllow">'; 343 html += ' ✓ ' + tarteaucitron.lang.allow; 344 html += ' </button> '; 345 html += ' <button type="button" class="tarteaucitronDeny" style="visibility:hidden">'; 346 html += ' ✗ ' + tarteaucitron.lang.deny; 347 html += ' </button> '; 348 html += ' </div>'; 349 html += '</li>'; 350 html += '</ul></li>'; 351 } 352 353 for (i = 0; i < cat.length; i += 1) { 354 html += ' <li id="tarteaucitronServicesTitle_' + cat[i] + '" class="tarteaucitronHidden">'; 355 html += ' <div class="tarteaucitronTitle">'; 356 html += ' <button type="button" class="catToggleBtn" data-cat="tarteaucitronDetails' + cat[i] + '">✛ ' + tarteaucitron.lang[cat[i]].title + '</button>'; 357 html += ' </div>'; 358 html += ' <div id="tarteaucitronDetails' + cat[i] + '" class="tarteaucitronDetails tarteaucitronInfoBox">'; 359 html += ' ' + tarteaucitron.lang[cat[i]].details; 360 html += ' </div>'; 361 html += ' <ul id="tarteaucitronServices_' + cat[i] + '"></ul></li>'; 362 } 363 html += ' <li id="tarteaucitronNoServicesTitle" class="tarteaucitronLine">' + tarteaucitron.lang.noServices + '</li>'; 364 html += ' </ul>'; 365 html += ' <div class="tarteaucitronHidden spacer-20" id="tarteaucitronScrollbarChild"></div>'; 366 if (tarteaucitron.parameters.removeCredit === false) { 367 html += ' <a class="tarteaucitronSelfLink" href="https://tarteaucitron.io/" rel="nofollow noreferrer noopener" target="_blank" title="tarteaucitron ' + tarteaucitron.lang.newWindow + '">ð ' + tarteaucitron.lang.credit + '</a>'; 368 } 369 html += ' </div>'; 370 html += ' </div>'; 371 html += '</div>'; 372 373 if (tarteaucitron.parameters.orientation === 'bottom') { 374 orientation = 'Bottom'; 375 } 376 377 if (tarteaucitron.parameters.highPrivacy && !tarteaucitron.parameters.AcceptAllCta) { 378 html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">'; 379 //html += '<div class="tarteaucitronAlertBigWrapper">'; 380 html += ' <span id="tarteaucitronDisclaimerAlert">'; 381 html += ' ' + tarteaucitron.lang.alertBigPrivacy; 382 html += ' </span>'; 383 //html += ' <span class="tarteaucitronAlertBigBtnWrapper">'; 384 html += ' <button type="button" id="tarteaucitronPersonalize">'; 385 html += ' ' + tarteaucitron.lang.personalize; 386 html += ' </button>'; 387 388 if (tarteaucitron.parameters.privacyUrl !== "") { 389 html += ' <button type="button" id="tarteaucitronPrivacyUrl">'; 390 html += ' ' + tarteaucitron.lang.privacyUrl; 391 html += ' </button>'; 392 } 393 394 //html += ' </span>'; 395 //html += '</div>'; 396 html += '</div>'; 397 } else { 398 html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">'; 399 //html += '<div class="tarteaucitronAlertBigWrapper">'; 400 html += ' <span id="tarteaucitronDisclaimerAlert">'; 401 402 if (tarteaucitron.parameters.highPrivacy) { 403 html += ' ' + tarteaucitron.lang.alertBigPrivacy; 404 } else { 405 html += ' ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig; 406 } 407 408 html += ' </span>'; 409 //html += ' <span class="tarteaucitronAlertBigBtnWrapper">'; 410 html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronAllow" id="tarteaucitronPersonalize2">'; 411 html += ' ✓ ' + tarteaucitron.lang.acceptAll; 412 html += ' </button>'; 413 414 415 if (tarteaucitron.parameters.DenyAllCta) { 416 html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2">'; 417 html += ' ✗ ' + tarteaucitron.lang.denyAll; 418 html += ' </button>'; 419 //html += ' <br/><br/>'; 420 } 421 422 html += ' <button type="button" id="tarteaucitronCloseAlert">'; 423 html += ' ' + tarteaucitron.lang.personalize; 424 html += ' </button>'; 425 426 if (tarteaucitron.parameters.privacyUrl !== "") { 427 html += ' <button type="button" id="tarteaucitronPrivacyUrl">'; 428 html += ' ' + tarteaucitron.lang.privacyUrl; 429 html += ' </button>'; 430 } 431 432 //html += ' </span>'; 433 //html += '</div>'; 434 html += '</div>'; 435 html += '<div id="tarteaucitronPercentage"></div>'; 436 } 437 438 if (tarteaucitron.parameters.showIcon === true) { 439 html += '<div id="tarteaucitronIcon" class="tarteaucitronIcon' + tarteaucitron.parameters.iconPosition + '">'; 440 html += ' <button type="button" id="tarteaucitronManager">'; 441 html += ' <img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWw6c3BhY2U9InByZXNlcnZlIiB3aWR0aD0iMTI5OXB4IiBoZWlnaHQ9IjEyOTlweCIgdmVyc2lvbj0iMS4xIiBzdHlsZT0ic2hhcGUtcmVuZGVyaW5nOmdlb21ldHJpY1ByZWNpc2lvbjsgdGV4dC1yZW5kZXJpbmc6Z2VvbWV0cmljUHJlY2lzaW9uOyBpbWFnZS1yZW5kZXJpbmc6b3B0aW1pemVRdWFsaXR5OyBmaWxsLXJ1bGU6ZXZlbm9kZDsgY2xpcC1ydWxlOmV2ZW5vZGQiDQp2aWV3Qm94PSIwIDAgMTI5OSAxMjk
4415Ig0KIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIg0KIGRhdGEtbmFtZT0iTGF5ZXIgMSI+DQogPGRlZnM+DQogIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+DQogICA8IVtDREFUQVsNCiAgICAuc3RyMCB7c3Ryb2tlOiM0OTM1Mjc7c3Ryb2tlLXdpZHRoOjQ4LjQ0O3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoyMi45MjU2fQ0KICAgIC5maWwxIHtmaWxsOm5vbmV9DQogICAgLmZpbDIge2ZpbGw6I0Q2QzE3NX0NCiAgICAuZmlsMCB7ZmlsbDojRUZFMkIyfQ0KICAgXV0+DQogIDwvc3R5bGU+DQogPC9kZWZzPg0KIDxnIGlkPSJQbGFuX3gwMDIwXzEiPg0KICA8bWV0YWRhdGEgaWQ9IkNvcmVsQ29ycElEXzBDb3JlbC1MYXllciIvPg0KICA8cGF0aCBjbGFzcz0iZmlsMCIgZD0iTTExOTEuOTggNjQ5LjVjMCwwLjE2IDAsMC40MyAwLDAuNTYgMCwyOTkuNTUgLTI0Mi45Myw1NDIuNDggLTU0Mi40OCw1NDIuNDggLTI2Ny45NiwwIC00OTUuODUsLTE5NS44NCAtNTM2LjI1LC00NjAuNjkgMCwtMC43MiAtMC4yNSwtMS40NSAtMC4yOSwtMi4xOCAtMy45NiwtMjYuNDYgLTUuOTUsLTUzLjMyIC01Ljk1LC04MC4xMSAwLC00NC4wOCA1LjM4LC04OC4xIDE1Ljk1LC0xMzAuODUgNC45NiwtMjAuNDIgMTEuMzcsLTQwLjYzIDE4Ljc2LC02MC4zMiA3OS41MywtMjExLjMgMjgxLjg1LC0zNTEuMzcgNTA3LjY5LC0zNTEuMzcgMCwwIDAuMDcsMCAwLjA3LDBsMS4wOSAwYzExLjEsMTYyLjQxIDE0Ni4xNCwyODguNDggMzA4LjkyLDI4OC40OCA5LjAxLDAgMTcuODcsLTAuMzggMjYuNjksLTEuMTYgMi4wOSwxNS43IDUuNTEsMzEuMjkgMTAuMDcsNDYuNDMgMjguNjIsOTUuNTUgMTAxLjQ2LDE3MS42MSAxOTUuNzIsMjA0LjI0IDAuMDEsMS40OSAwLjAxLDIuOTkgMC4wMSw0LjQ5eiIvPg0KICA8cGF0aCBjbGFzcz0iZmlsMSBzdHIwIiBkPSJNMTE5MS45OCA2NDkuNWMwLDI5OS41NSAtMjQyLjkzLDU0Mi40OCAtNTQyLjQ4LDU0Mi40OCAtMjk5LjU1LDAgLTU0Mi40OCwtMjQyLjkzIC01NDIuNDgsLTU0Mi40OCAwLC0yOTkuNTUgMjQyLjkzLC01NDIuNDggNTQyLjQ4LC01NDIuNDhsMS4wNyAwYzExLjEsMTYyLjQxIDE0Ni4xNCwyODguNDggMzA4LjkyLDI4OC40OCA5LjAxLDAgMTcuODcsLTAuMzggMjYuNjksLTEuMTYgMi4wOSwxNS43IDUuNTEsMzEuMjkgMTAuMDcsNDYuNDMgMjguNTMsOTUuNTkgMTAxLjQ2LDE3MS42NiAxOTUuNzMsMjA0LjI0IDAsMS40OSAwLDIuOTkgMCw0LjQ5eiIvPg0KICA8cGF0aCBjbGFzcz0iZmlsMiBzdHIwIiBkPSJNNDIwLjg4IDg2MS42Yy0yLjQ2LDAuMjIgLTQuOTYsMC4zMyAtNy40MywwLjMzIC00My4wMiwwIC03OS4xMiwtMzIuNDkgLTgzLjYzLC03NS4yNiAtMC4yOSwtMi40MiAtMC40NSwtNC44NSAtMC40NSwtNy4yOCAwLC00LjM4IDAuNDksLTguNzUgMS40NywtMTMuMDIgNC4yMiwtMTcuMjQgMTguMjIsLTMwLjcxIDMzLjkxLC0zOC43NSAxMy41MiwtNi45MSAyOC41MywtMTAuNTMgNDMuNzMsLTEwLjUzIDUzLjAzLDAgOTYuMDQsNDMuMDIgOTYuMDQsOTYuMDUgMCwyLjY1IC0wLjExLDUuMzMgLTAuMzIsNy45NmwwIDAuNTRjLTIuNDcsMjMuMzYgLTIyLjE4LDQxLjExIC00NS42Nyw0MS4xMSAtMC42LDAgLTEuMjEsLTAuMDEgLTEuODEsLTAuMDNsLTM1Ljg0IC0xLjEyeiIvPg0KICA8cGF0aCBjbGFzcz0iZmlsMiBzdHIwIiBkPSJNOTEwLjI4IDY5NC44OGMtMS43NiwtMC4xMSAtMy41NSwtMC4xOSAtNS4zMSwtMC4xOSAtOC4wNywwIC0xNi4xMSwxLjMyIC0yMy43NSwzLjg4IC0xNy4wNCw1LjcxIC0zMy44MiwxMi43IC00OS45MSwyMC42NyAtMTQuNTksNi42NCAtMjguMDQsMTUuNzEgLTM5LjY2LDI2Ljc1IC0yOS4wNiwyOS45NCAtMzIuODksNzcuNSAtMjEuMzYsMTE3LjY1IDAuOTUsNC4yOSAyLjg0LDguMzMgNS41MywxMS44MSAzLjQ5LDMuNDMgNy44Nyw1Ljg0IDEyLjY0LDYuOTMgNy4xOSwxLjk0IDE0LjYxLDIuOTIgMjIuMDUsMi45MiA4LjQzLDAgMTYuODMsLTEuMjcgMjQuODgsLTMuNzQgMjkuMDcsLTguNjMgNTcuNjgsLTE4LjMxIDg1LjgzLC0yOS4wNyAxMS42NSwtMy41OSAyMi40NywtOS41NiAzMS43MywtMTcuNDggOC4wOSwtOC43MiAxNC4wNCwtMTkuMjQgMTcuMzQsLTMwLjY2IDIuOTMsLTguNiA1LjE3LC0xNy40NyA2LjU1LC0yNi40NCAwLjUsLTMuNSAwLjc2LC03LjA2IDAuNzYsLTEwLjYgMCwtMzguMTQgLTI5LjQ4LC02OS43OSAtNjcuNTEsLTcyLjQ4bDAuMTkgMC4wNXoiLz4NCiAgPHBhdGggY2xhc3M9ImZpbDIgc3RyMCIgZD0iTTU5OC4xNiAzNTUuNjljLTQuMTksLTAuNDcgLTguNDIsLTAuNzEgLTEyLjY0LC0wLjcxIC0yMy40MywwIC00Ni4yOSw3LjM2IC02NS4zNCwyMS4wMWwtMC4zOCAwLjI5Yy0xOC40NiwxMy4yNyAtMzguMTcsMjkuNzQgLTM0LjY4LDU1LjA3IDEuOTUsMTIuMzEgOC42MSwyMy40MSAxOC41NCwzMC45NSAyMC43MywxNi41MSA0Ny4xOCwxOC40IDcyLjY2LDIwLjA1bDM2LjgxIDIuMzdjMTQuNTMsMC45NyAzMC44LDEuMzEgNDEuNTYsLTguNDMgNC45MiwtNC45NCA4LjY2LC0xMC45NyAxMC44OSwtMTcuNTggNS4wNCwtMTEuODUgNy42NCwtMjQuNTkgNy42NCwtMzcuNDYgMCwtMy44OSAtMC4yNSwtNy44IC0wLjcxLC0xMS42NSAtMi4xOCwtMTYuODIgLTExLjM0LC0zMS45NyAtMjUuMjQsLTQxLjcxIC0xMy44NSwtOS4wMSAtMzEuMDQsLTEwLjY1IC00Ny41MSwtMTIuMDZsLTEuNiAtMC4xNHoiLz4NCiA8L2c+DQo8L3N2Zz4NCg==" alt="Cookies">'; 442 html += ' </button>'; 443 html += '</div>'; 444 } 445 446 if (tarteaucitron.parameters.showAlertSmall === true) { 447 html += '<div id="tarteaucitronAlertSmall" class="tarteaucitronAlertSmall' + orientation + '">'; 448 html += ' <button type="button" id="tarteaucitronManager">'; 449 html += ' ' + tarteaucitron.lang.alertSmall;
450 html += ' <span id="tarteaucitronDot">'; 451 html += ' <span id="tarteaucitronDotGreen"></span>'; 452 html += ' <span id="tarteaucitronDotYellow"></span>'; 453 html += ' <span id="tarteaucitronDotRed"></span>'; 454 html += ' </span>'; 455 if (tarteaucitron.parameters.cookieslist === true) { 456 html += ' </button><!-- @whitespace'; 457 html += ' --><button type="button" id="tarteaucitronCookiesNumber">0</button>'; 458 html += ' <div id="tarteaucitronCookiesListContainer">'; 459 html += ' <button type="button" id="tarteaucitronClosePanelCookie">'; 460 html += ' ' + tarteaucitron.lang.close; 461 html += ' </button>'; 462 html += ' <div class="tarteaucitronCookiesListMain" id="tarteaucitronCookiesTitle">'; 463 html += ' <span class="tarteaucitronH2" role="heading" aria-level="2" id="tarteaucitronCookiesNumberBis">0 cookie</span>'; 464 html += ' </div>'; 465 html += ' <div id="tarteaucitronCookiesList"></div>'; 466 html += ' </div>'; 467 } else { 468 html += ' </div>'; 469 } 470 html += '</div>'; 471 } 472 473 tarteaucitron.addInternalScript(tarteaucitron.cdn + 'advertising.js?v=' + tarteaucitron.version, '', function () { 474 if (tarteaucitronNoAdBlocker === true || tarteaucitron.parameters.adblocker === false) { 475 476 // create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened 477 /*var wrapper = document.createElement('div'); 478 wrapper.id = "contentWrapper"; 479 480 while (document.body.firstChild) 481 { 482 wrapper.appendChild(document.body.firstChild); 483 } 484 485 // Append the wrapper to the body 486 document.body.appendChild(wrapper);*/ 487 488 div.id = 'tarteaucitronRoot'; 489 if (tarteaucitron.parameters.bodyPosition === 'top') { 490 // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility 491 var bodyFirstChild = body.firstChild; 492 body.insertBefore(div, bodyFirstChild); 493 } 494 else { 495 // Append tarteaucitron: #tarteaucitronRoot last-child of the body 496 body.appendChild(div, body); 497 } 498 div.innerHTML = html; 499 500 //ie compatibility 501 var tacRootAvailableEvent; 502 if(typeof(Event) === 'function') { 503 tacRootAvailableEvent = new Event("tac.root_available"); 504 }else{ 505 tacRootAvailableEvent = document.createEvent('Event'); 506 tacRootAvailableEvent.initEvent("tac.root_available", true, true); 507 } 508 //end ie compatibility 509 510 window.dispatchEvent(tacRootAvailableEvent); 511 512 if (tarteaucitron.job !== undefined) { 513 tarteaucitron.job = tarteaucitron.cleanArray(tarteaucitron.job); 514 for (index = 0; index < tarteaucitron.job.length; index += 1) { 515 tarteaucitron.addService(tarteaucitron.job[index]); 516 } 517 } else { 518 tarteaucitron.job = [] 519 } 520 521 tarteaucitron.isAjax = true; 522 523 tarteaucitron.job.push = function (id) { 524 525 // ie <9 hack 526 if (typeof tarteaucitron.job.indexOf === 'undefined') { 527 tarteaucitron.job.indexOf = function (obj, start) { 528 var i, 529 j = this.length; 530 for (i = (start || 0); i < j; i += 1) { 531 if (this[i] === obj) { return i; } 532 } 533 return -1; 534 }; 535 } 536 537 if (tarteaucitron.job.indexOf(id) === -1) { 538 Array.prototype.push.call(this, id); 539 }
540 tarteaucitron.launch[id] = false; 541 tarteaucitron.addService(id); 542 }; 543 544 if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') { 545 tarteaucitron.userInterface.openPanel(); 546 } 547 548 tarteaucitron.cookie.number(); 549 setInterval(tarteaucitron.cookie.number, 60000); 550 } 551 }, tarteaucitron.parameters.adblocker); 552 553 if (tarteaucitron.parameters.adblocker === true) { 554 setTimeout(function () { 555 if (tarteaucitronNoAdBlocker === false) { 556 html = '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + ' display-block" role="alert" aria-live="polite">'; 557 html += ' <p id="tarteaucitronDisclaimerAlert">'; 558 html += ' ' + tarteaucitron.lang.adblock + '<br/>'; 559 html += ' <strong>' + tarteaucitron.lang.adblock_call + '</strong>'; 560 html += ' </p>'; 561 html += ' <button type="button" class="tarteaucitronCTAButton" id="tarteaucitronCTAButton">'; 562 html += ' ' + tarteaucitron.lang.reload; 563 html += ' </button>'; 564 html += '</div>'; 565 html += '<div id="tarteaucitronPremium"></div>'; 566 567 div.id = 'tarteaucitronRoot'; 568 if (tarteaucitron.parameters.bodyPosition === 'top') { 569 // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility 570 var bodyFirstChild = body.firstChild; 571 body.insertBefore(div, bodyFirstChild); 572 } 573 else { 574 // Append tarteaucitron: #tarteaucitronRoot last-child of the body 575 body.appendChild(div, body); 576 } 577 div.innerHTML = html; 578 } 579 }, 1500); 580 } 581 582 // add a little timeout to be sure everything is accessible 583 setTimeout(function () { 584 585 // Setup events 586 tarteaucitron.addClickEventToId("tarteaucitronPersonalize", function () {
587 tarteaucitron.userInterface.openPanel(); 588 }); 589 tarteaucitron.addClickEventToId("tarteaucitronPersonalize2", function () { 590 tarteaucitron.userInterface.respondAll(true); 591 }); 592 tarteaucitron.addClickEventToId("tarteaucitronManager", function () { 593 tarteaucitron.userInterface.openPanel(); 594 }); 595 tarteaucitron.addClickEventToId("tarteaucitronBack", function () { 596 tarteaucitron.userInterface.closePanel(); 597 }); 598 tarteaucitron.addClickEventToId("tarteaucitronClosePanel", function () { 599 tarteaucitron.userInterface.closePanel(); 600 }); 601 tarteaucitron.addClickEventToId("tarteaucitronClosePanelCookie", function () { 602 tarteaucitron.userInterface.closePanel(); 603 }); 604 tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrl", function () { 605 document.location = tarteaucitron.parameters.privacyUrl; 606 }); 607 tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrlDialog", function () { 608 document.location = tarteaucitron.parameters.privacyUrl; 609 }); 610 tarteaucitron.addClickEventToId("tarteaucitronCookiesNumber", function () { 611 tarteaucitron.userInterface.toggleCookiesList(); 612 }); 613 tarteaucitron.addClickEventToId("tarteaucitronAllAllowed", function () { 614 tarteaucitron.userInterface.respondAll(true); 615 }); 616 tarteaucitron.addClickEventToId("tarteaucitronAllDenied", function () { 617 tarteaucitron.userInterface.respondAll(false); 618 }); 619 tarteaucitron.addClickEventToId("tarteaucitronAllDenied2", function () { 620 tarteaucitron.userInterface.respondAll(false); 621 }); 622 tarteaucitron.addClickEventToId("tarteaucitronCloseAlert", function () {
623 tarteaucitron.userInterface.openPanel(); 624 }); 625 tarteaucitron.addClickEventToId("tarteaucitronCTAButton", function () { 626 location.reload(); 627 }); 628 var toggleBtns = document.getElementsByClassName("catToggleBtn"); 629 for (let i = 0; i < toggleBtns.length; i++) { 630 tarteaucitron.addClickEventToElement(toggleBtns[i], function () { 631 tarteaucitron.userInterface.toggle('tarteaucitronDetails' + cat[i], 'tarteaucitronInfoBox'); 632 return false; 633 }); 634 } 635 var allowBtns = document.getElementsByClassName("tarteaucitronAllow"); 636 for (let i = 0; i < allowBtns.length; i++) { 637 tarteaucitron.addClickEventToElement(allowBtns[i], function () { 638 tarteaucitron.userInterface.respond(this, true); 639 }); 640 } 641 var denyBtns = document.getElementsByClassName("tarteaucitronDeny"); 642 for (let i = 0; i < denyBtns.length; i++) { 643 tarteaucitron.addClickEventToElement(denyBtns[i], function () { 644 tarteaucitron.userInterface.respond(this, false); 645 }); 646 } 647 }, 500); 648 649 }); 650 }); 651 652 if(tarteaucitron.events.load) { 653 tarteaucitron.events.load(); 654 } 655 }, 656 "addService": function (serviceId) { 657 "use strict"; 658 var html = '', 659 s = tarteaucitron.services, 660 service = s[serviceId], 661 cookie = tarteaucitron.cookie.read(), 662 hostname = document.location.hostname, 663 hostRef = document.referrer.split('/')[2], 664 isNavigating = (hostRef === hostname && window.location.href !== tarteaucitron.parameters.privacyUrl), 665 isAutostart = (!service.needConsent), 666 isWaiting = (cookie.indexOf(service.key + '=wait') >= 0), 667 isDenied = (cookie.indexOf(service.key + '=false') >= 0), 668 isAllowed = ((cookie.indexOf(service.key + '=true') >= 0) || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)), 669 isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0), 670 isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1"); 671 672 if (tarteaucitron.added[service.key] !== true) { 673 tarteaucitron.added[service.key] = true; 674 675 html += '<li id="' + service.key + 'Line" class="tarteaucitronLine">'; 676 html += ' <div class="tarteaucitronName">'; 677 html += ' <span class="tarteaucitronH3" role="heading" aria-level="3">' + service.name + '</span>'; 678 html += ' <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span><br/>'; 679 680 if (tarteaucitron.parameters.moreInfoLink == true) { 681 682 var link = 'https://tarteaucitron.io/service/' + service.key + '/'; 683 if (service.readmoreLink !== undefined && service.readmoreLink !== '') { 684 link = service.readmoreLink; 685 } 686 if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') { 687 link = tarteaucitron.parameters.readmoreLink; 688 } 689 html += ' <a href="' + link + '" target="_blank" rel="noreferrer noopener" title="'+ tarteaucitron.lang.cookieDetail + ' ' + service.name + ' ' + tarteaucitron.lang.ourSite + ' ' + tarteaucitron.lang.newWindow +'">'; 690 html += ' ' + tarteaucitron.lang.more; 691 html += ' </a>'; 692 html += ' - '; 693 html += ' <a href="' + service.uri + '" target="_blank" rel="noreferrer noopener" title="' + service.name + ' ' + tarteaucitron.lang.newWindow + '">'; 694 html += ' ' + tarteaucitron.lang.source; 695 html += ' </a>'; 696 } 697 698 html += ' </div>'; 699 html += ' <div class="tarteaucitronAsk">'; 700 html += ' <button type="button" id="' + service.key + 'Allowed" class="tarteaucitronAllow">'; 701 html += ' ✓ ' + tarteaucitron.lang.allow; 702 html += ' </button> '; 703 html += ' <button type="button" id="' + service.key + 'Denied" class="tarteaucitronDeny">'; 704 html += ' ✗ ' + tarteaucitron.lang.deny; 705 html += ' </button>'; 706 html += ' </div>'; 707 html += '</li>'; 708 709 tarteaucitron.userInterface.css('tarteaucitronServicesTitle_' + service.type, 'display', 'block'); 710 711 if (document.getElementById('tarteaucitronServices_' + service.type) !== null) { 712 document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html; 713 } 714 715 tarteaucitron.userInterface.css('tarteaucitronNoServicesTitle', 'display', 'none'); 716 717 tarteaucitron.userInterface.order(service.type); 718 } 719 720 tarteaucitron.pro('!' + service.key + '=' + isAllowed); 721 722 // allow by default for non EU 723 if (isResponded === false && tarteaucitron.user.bypass === true) { 724 isAllowed = true; 725 tarteaucitron.cookie.create(service.key, true); 726 } 727 728 if ((!isResponded && (isAutostart || (isNavigating && isWaiting)) && !tarteaucitron.highPrivacy) || isAllowed) { 729 if (!isAllowed) { 730 tarteaucitron.cookie.create(service.key, true); 731 }
732 if (tarteaucitron.launch[service.key] !== true) { 733 tarteaucitron.launch[service.key] = true; 734 service.js(); 735 tarteaucitron.sendEvent(service.key + '_loaded'); 736 } 737 tarteaucitron.state[service.key] = true; 738 tarteaucitron.userInterface.color(service.key, true); 739 } else if (isDenied) { 740 if (typeof service.fallback === 'function') { 741 service.fallback(); 742 } 743 tarteaucitron.state[service.key] = false; 744 tarteaucitron.userInterface.color(service.key, false); 745 } else if (!isResponded && isDNTRequested && tarteaucitron.handleBrowserDNTRequest) { 746 tarteaucitron.cookie.create(service.key, 'false'); 747 if (typeof service.fallback === 'function') { 748 service.fallback(); 749 } 750 tarteaucitron.state[service.key] = false; 751 tarteaucitron.userInterface.color(service.key, false); 752 } else if (!isResponded) { 753 tarteaucitron.cookie.create(service.key, 'wait'); 754 if (typeof service.fallback === 'function') { 755 service.fallback(); 756 } 757 tarteaucitron.userInterface.color(service.key, 'wait'); 758 tarteaucitron.userInterface.openAlert(); 759 } 760 761 tarteaucitron.cookie.checkCount(service.key); 762 tarteaucitron.sendEvent(service.key + '_added') 763 }, 764 "sendEvent" : function(event_key) { 765 if(event_key !== undefined) { 766 //ie compatibility 767 var send_event_item; 768 if(typeof(Event) === 'function') { 769 send_event_item = new Event(event_key); 770 }else{ 771 send_event_item = document.createEvent('Event'); 772 send_event_item.initEvent(event_key, true, true); 773 } 774 //end ie compatibility 775 776 document.dispatchEvent(send_event_item); 777 } 778 }, 779 "cleanArray": function cleanArray(arr) { 780 "use strict"; 781 var i, 782 len = arr.length, 783 out = [], 784 obj = {}, 785 s = tarteaucitron.services; 786 787 for (i = 0; i < len; i += 1) { 788 if (!obj[arr[i]]) { 789 obj[arr[i]] = {}; 790 if (tarteaucitron.services[arr[i]] !== undefined) { 791 out.push(arr[i]); 792 } 793 } 794 } 795 796 out = out.sort(function (a, b) { 797 if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; } 798 if (s[a].type + s[a].key < s[b].type + s[b].key) { return -1; } 799 return 0; 800 }); 801 802 return out; 803 }, 804 "userInterface": { 805 "css": function (id, property, value) { 806 "use strict"; 807 if (document.getElementById(id) !== null) { 808 document.getElementById(id).style[property] = value; 809 } 810 }, 811 "addClass": function (id, className) { 812 "use strict"; 813 if (document.getElementById(id) !== null) { 814 document.getElementById(id).classList.add(className); 815 } 816 }, 817 "removeClass": function (id, className) { 818 "use strict"; 819 if (document.getElementById(id) !== null) { 820 document.getElementById(id).classList.remove(className); 821 } 822 }, 823 "respondAll": function (status) { 824 "use strict"; 825 var s = tarteaucitron.services, 826 service, 827 key, 828 index = 0; 829 830 for (index = 0; index < tarteaucitron.job.length; index += 1) { 831 service = s[tarteaucitron.job[index]]; 832 key = service.key; 833 if (tarteaucitron.state[key] !== status) { 834 if (status === false && tarteaucitron.launch[key] === true) { 835 tarteaucitron.reloadThePage = true; 836 } 837 if (tarteaucitron.launch[key] !== true && status === true) { 838 839 tarteaucitron.pro('!' + key + '=engage'); 840
841 tarteaucitron.launch[key] = true; 842 tarteaucitron.services[key].js(); 843 } 844 tarteaucitron.state[key] = status; 845 tarteaucitron.cookie.create(key, status); 846 tarteaucitron.userInterface.color(key, status); 847 } 848 } 849 }, 850 "respond": function (el, status) { 851 "use strict"; 852 var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), ''); 853 854 if (key.substring(0, 13) == 'tarteaucitron') {return;} 855 856 // return if same state 857 if (tarteaucitron.state[key] === status) { 858 return; 859 } 860 861 if (status === false && tarteaucitron.launch[key] === true) { 862 tarteaucitron.reloadThePage = true; 863 } 864 865 // if not already launched... launch the service 866 if (status === true) { 867 if (tarteaucitron.launch[key] !== true) { 868 869 tarteaucitron.pro('!' + key + '=engage'); 870 871 tarteaucitron.launch[key] = true; 872 tarteaucitron.sendEvent(key + '_loaded'); 873 tarteaucitron.services[key].js(); 874 } 875 } 876 tarteaucitron.state[key] = status; 877 tarteaucitron.cookie.create(key, status); 878 tarteaucitron.userInterface.color(key, status); 879 }, 880 "color": function (key, status) { 881 "use strict"; 882 var c = 'tarteaucitron', 883 nbDenied = 0, 884 nbPending = 0, 885 nbAllowed = 0, 886 sum = tarteaucitron.job.length, 887 index; 888 889 if (status === true) { 890 document.getElementById(key + 'Line').classList.add('tarteaucitronIsAllowed'); 891 document.getElementById(key + 'Line').classList.remove('tarteaucitronIsDenied'); 892 } else if (status === false) { 893 document.getElementById(key + 'Line').classList.remove('tarteaucitronIsAllowed'); 894 document.getElementById(key + 'Line').classList.add('tarteaucitronIsDenied'); 895 } 896 897 // check if all services are allowed 898 for (index = 0; index < sum; index += 1) { 899 if (tarteaucitron.state[tarteaucitron.job[index]] === false) { 900 nbDenied += 1; 901 } else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) { 902 nbPending += 1; 903 } else if (tarteaucitron.state[tarteaucitron.job[index]] === true) { 904 nbAllowed += 1; 905 } 906 } 907 908 tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%'); 909 tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%'); 910 tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%'); 911 912 if (nbDenied === 0 && nbPending === 0) { 913 tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected'); 914 tarteaucitron.userInterface.addClass(c + 'AllAllowed', c + 'IsSelected'); 915 916 tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsAllowed'); 917 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied'); 918 } else if (nbAllowed === 0 && nbPending === 0) { 919 tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected'); 920 tarteaucitron.userInterface.addClass(c + 'AllDenied', c + 'IsSelected'); 921 922 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed'); 923 tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsDenied'); 924 } else { 925 tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected'); 926 tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected'); 927 928 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed'); 929 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied'); 930 } 931 932 // close the alert if all service have been reviewed 933 if (nbPending === 0) { 934 tarteaucitron.userInterface.closeAlert(); 935 } 936 937 if (tarteaucitron.services[key].cookies.length > 0 && status === false) { 938 tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies); 939 } 940 941 if (status === true) { 942 if (document.getElementById('tacCL' + key) !== null) { 943 document.getElementById('tacCL' + key).innerHTML = '...'; 944 } 945 setTimeout(function () { 946 tarteaucitron.cookie.checkCount(key); 947 }, 2500); 948 } else { 949 tarteaucitron.cookie.checkCount(key); 950 } 951 }, 952 "openPanel": function () { 953 "use strict"; 954 955 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block'); 956 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); 957 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); 958 959 document.getElementById('tarteaucitronClosePanel').focus(); 960 document.getElementsByTagName('body')[0].classList.add('modal-open'); 961 tarteaucitron.userInterface.focusTrap(); 962 tarteaucitron.userInterface.jsSizing('main'); 963 964 //ie compatibility 965 var tacOpenPanelEvent; 966 if(typeof(Event) === 'function') { 967 tacOpenPanelEvent = new Event("tac.open_panel"); 968 }else{ 969 tacOpenPanelEvent = document.createEvent('Event'); 970 tacOpenPanelEvent.initEvent("tac.open_panel", true, true); 971 } 972 //end ie compatibility 973 974 window.dispatchEvent(tacOpenPanelEvent); 975 }, 976 "closePanel": function () { 977 "use strict"; 978 979 if (document.location.hash === tarteaucitron.hashtag) { 980 if (window.history) { 981 window.history.replaceState('', document.title, window.location.pathname + window.location.search); 982 } else { 983 document.location.hash = ''; 984 } 985 } 986 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 987 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); 988 989 tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) { 990 elem.style.display = 'none'; 991 }, true); 992 993 if (tarteaucitron.reloadThePage === true) { 994 window.location.reload(); 995 } else { 996 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none'); 997 } 998 if (document.getElementById('tarteaucitronCloseAlert') !== null) { 999 document.getElementById('tarteaucitronCloseAlert').focus(); 1000 } 1001 document.getElementsByTagName('body')[0].classList.remove('modal-open'); 1002 1003 //ie compatibility 1004 var tacClosePanelEvent; 1005 if(typeof(Event) === 'function') { 1006 tacClosePanelEvent = new Event("tac.close_panel"); 1007 }else{ 1008 tacClosePanelEvent = document.createEvent('Event'); 1009 tacClosePanelEvent.initEvent("tac.close_panel", true, true); 1010 } 1011 //end ie compatibility 1012 1013 window.dispatchEvent(tacClosePanelEvent); 1014 }, 1015 "focusTrap": function() { 1016 "use strict"; 1017 1018 var focusableEls, 1019 firstFocusableEl, 1020 lastFocusableEl, 1021 filtered; 1022 1023 focusableEls = document.getElementById('tarteaucitron').querySelectorAll('a[href], button'); 1024 filtered = []; 1025 1026 // get only visible items
vendor: 5,763 bytes, lines 1027-1163
1027 for (var i = 0, max = focusableEls.length; i < max; i++) { 1028 if (focusableEls[i].offsetHeight > 0) { 1029 filtered.push(focusableEls[i]); 1030 } 1031 } 1032 1033 firstFocusableEl = filtered[0]; 1034 lastFocusableEl = filtered[filtered.length - 1]; 1035 1036 //loop focus inside tarteaucitron 1037 document.getElementById('tarteaucitron').addEventListener("keydown", function (evt) { 1038 1039 if ( evt.key === 'Tab' || evt.keyCode === 9 ) { 1040 1041 if ( evt.shiftKey ) /* shift + tab */ { 1042 if (document.activeElement === firstFocusableEl) { 1043 lastFocusableEl.focus(); 1044 evt.preventDefault(); 1045 } 1046 } else /* tab */ { 1047 if (document.activeElement === lastFocusableEl) { 1048 firstFocusableEl.focus(); 1049 evt.preventDefault(); 1050 } 1051 } 1052 } 1053 }) 1054 }, 1055 "openAlert": function () { 1056 "use strict"; 1057 var c = 'tarteaucitron'; 1058 tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block'); 1059 tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none'); 1060 tarteaucitron.userInterface.css(c + 'Icon', 'display', 'none'); 1061 tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'block'); 1062 tarteaucitron.userInterface.addClass(c + 'Root', 'tarteaucitronBeforeVisible'); 1063 1064 //ie compatibility 1065 var tacOpenAlertEvent; 1066 if(typeof(Event) === 'function') { 1067 tacOpenAlertEvent = new Event("tac.open_alert"); 1068 }else{ 1069 tacOpenAlertEvent = document.createEvent('Event'); 1070 tacOpenAlertEvent.initEvent("tac.open_alert", true, true); 1071 } 1072 //end ie compatibility 1073 1074 window.dispatchEvent(tacOpenAlertEvent); 1075 }, 1076 "closeAlert": function () { 1077 "use strict"; 1078 var c = 'tarteaucitron'; 1079 tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none'); 1080 tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block'); 1081 tarteaucitron.userInterface.css(c + 'Icon', 'display', 'block'); 1082 tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'none'); 1083 tarteaucitron.userInterface.removeClass(c + 'Root', 'tarteaucitronBeforeVisible'); 1084 tarteaucitron.userInterface.jsSizing('box'); 1085 1086 //ie compatibility 1087 var tacCloseAlertEvent; 1088 if(typeof(Event) === 'function') { 1089 tacCloseAlertEvent = new Event("tac.close_alert"); 1090 }else{ 1091 tacCloseAlertEvent = document.createEvent('Event'); 1092 tacCloseAlertEvent.initEvent("tac.close_alert", true, true); 1093 } 1094 //end ie compatibility 1095 1096 window.dispatchEvent(tacCloseAlertEvent); 1097 }, 1098 "toggleCookiesList": function () { 1099 "use strict"; 1100 var div = document.getElementById('tarteaucitronCookiesListContainer'); 1101 1102 if (div === null) { 1103 return; 1104 } 1105 1106 if (div.style.display !== 'block') { 1107 tarteaucitron.cookie.number(); 1108 div.style.display = 'block'; 1109 tarteaucitron.userInterface.jsSizing('cookie'); 1110 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 1111 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); 1112 tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) { 1113 elem.style.display = 'none'; 1114 }, true); 1115 } else { 1116 div.style.display = 'none'; 1117 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 1118 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none'); 1119 } 1120 }, 1121 "toggle": function (id, closeClass) { 1122 "use strict"; 1123 var div = document.getElementById(id); 1124 1125 if (div === null) { 1126 return; 1127 } 1128 1129 if (closeClass !== undefined) { 1130 tarteaucitron.fallback([closeClass], function (elem) { 1131 if (elem.id !== id) { 1132 elem.style.display = 'none'; 1133 } 1134 }, true); 1135 } 1136 1137 if (div.style.display !== 'block') { 1138 div.style.display = 'block'; 1139 } else { 1140 div.style.display = 'none'; 1141 } 1142 }, 1143 "order": function (id) { 1144 "use strict"; 1145 var main = document.getElementById('tarteaucitronServices_' + id), 1146 allDivs, 1147 store = [], 1148 i; 1149 1150 if (main === null) { 1151 return; 1152 } 1153 1154 allDivs = main.childNodes; 1155 1156 if (typeof Array.prototype.map === 'function' && typeof Enumerable === 'undefined') { 1157 Array.prototype.map.call(main.children, Object).sort(function (a, b) { 1158 //var mainChildren = Array.from(main.children); 1159 //mainChildren.sort(function (a, b) { 1160 if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; } 1161 if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; } 1162 return 0; 1163 }
1163).forEach(function (element) { 1164 main.appendChild(element); 1165 }); 1166 } 1167 }, 1168 "jsSizing": function (type) { 1169 "use strict"; 1170 var scrollbarMarginRight = 10, 1171 scrollbarWidthParent, 1172 scrollbarWidthChild, 1173 servicesHeight, 1174 e = window, 1175 a = 'inner', 1176 windowInnerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, 1177 mainTop, 1178 mainHeight, 1179 closeButtonHeight, 1180 headerHeight, 1181 cookiesListHeight, 1182 cookiesCloseHeight, 1183 cookiesTitleHeight, 1184 paddingBox, 1185 alertSmallHeight, 1186 cookiesNumberHeight; 1187 1188 if (type === 'box') { 1189 if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) { 1190 1191 // reset 1192 tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px'); 1193 1194 // calculate 1195 alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight; 1196 cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight; 1197 paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2; 1198 1199 // apply 1200 tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px'); 1201 } 1202 } else if (type === 'main') { 1203 1204 // get the real window width for media query 1205 if (window.innerWidth === undefined) { 1206 a = 'client'; 1207 e = document.documentElement || document.body; 1208 } 1209 1210 // height of the services list container 1211 if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) { 1212 1213 // reset 1214 tarteaucitron.userInterface.css('tarteaucitronServices', 'height', 'auto'); 1215 1216 // calculate 1217 mainHeight = document.getElementById('tarteaucitron').offsetHeight; 1218 closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight; 1219 1220 // apply 1221 servicesHeight = (mainHeight - closeButtonHeight + 2); 1222 tarteaucitron.userInterface.css('tarteaucitronServices', 'height', servicesHeight + 'px'); 1223 tarteaucitron.userInterface.css('tarteaucitronServices', 'overflow-x', 'auto'); 1224 } 1225 1226 // align the main allow/deny button depending on scrollbar width 1227 if (document.getElementById('tarteaucitronServices') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) { 1228 1229 // media query 1230 if (e[a + 'Width'] <= 479) { 1231 //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px'); 1232 } else if (e[a + 'Width'] <= 767) { 1233 scrollbarMarginRight = 12; 1234 } 1235 1236 scrollbarWidthParent = document.getElementById('tarteaucitronServices').offsetWidth; 1237 scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth; 1238 //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px'); 1239 } 1240 1241 // center the main panel 1242 if (document.getElementById('tarteaucitron') !== null) { 1243 1244 // media query 1245 if (e[a + 'Width'] <= 767) { 1246 mainTop = 0; 1247 } else { 1248 mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21; 1249 } 1250 1251 if (document.getElementById('tarteaucitronMainLineOffset') !== null) { 1252 if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) { 1253 mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight; 1254 } 1255 } 1256 1257 // correct 1258 if (mainTop < 0) { 1259 mainTop = 0; 1260 } 1261 1262 // apply 1263 tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px'); 1264 } 1265 1266 1267 } else if (type === 'cookie') { 1268 1269 // put cookies list at bottom 1270 if (document.getElementById('tarteaucitronAlertSmall') !== null) { 1271 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px'); 1272 } 1273 1274 // height of cookies list 1275 if (document.getElementById('tarteaucitronCookiesListContainer') !== null) { 1276 1277 // reset 1278 tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto'); 1279 1280 // calculate 1281 cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight; 1282 cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight; 1283 cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight; 1284 1285 // apply 1286 tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookie
vendor: 9,707 bytes, lines 1286-1485
1286sListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px'); 1287 } 1288 } 1289 } 1290 }, 1291 "cookie": { 1292 "owner": {}, 1293 "create": function (key, status) { 1294 "use strict"; 1295 1296 if (tarteaucitronForceExpire !== '') { 1297 // The number of day(s)/hour(s) can't be higher than 1 year 1298 if ((tarteaucitronExpireInDay && tarteaucitronForceExpire < 365) || (!tarteaucitronExpireInDay && tarteaucitronForceExpire < 8760)) { 1299 if (tarteaucitronExpireInDay) { 1300 // Multiplication to tranform the number of days to milliseconds 1301 timeExpire = tarteaucitronForceExpire * 86400000; 1302 } else { 1303 // Multiplication to tranform the number of hours to milliseconds 1304 timeExpire = tarteaucitronForceExpire * 3600000; 1305 } 1306 } 1307 } 1308 1309 var d = new Date(), 1310 time = d.getTime(), 1311 expireTime = time + timeExpire, // 365 days 1312 regex = new RegExp("!" + key + "=(wait|true|false)", "g"), 1313 cookie = tarteaucitron.cookie.read().replace(regex, ""), 1314 value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status, 1315 domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? '; domain=' + tarteaucitron.parameters.cookieDomain : '', 1316 secure = location.protocol === 'https:' ? '; Secure' : ''; 1317 1318 d.setTime(expireTime); 1319 document.cookie = value + '; expires=' + d.toGMTString() + '; path=/' + domain + secure + '; samesite=lax'; 1320 }, 1321 "read": function () { 1322 "use strict"; 1323 var nameEQ = tarteaucitron.parameters.cookieName + "=", 1324 ca = document.cookie.split(';'), 1325 i, 1326 c; 1327 1328 for (i = 0; i < ca.length; i += 1) { 1329 c = ca[i]; 1330 while (c.charAt(0) === ' ') { 1331 c = c.substring(1, c.length); 1332 } 1333 if (c.indexOf(nameEQ) === 0) { 1334 return c.substring(nameEQ.length, c.length); 1335 } 1336 } 1337 return ''; 1338 }, 1339 "purge": function (arr) { 1340 "use strict"; 1341 var i; 1342 1343 for (i = 0; i < arr.length; i += 1) { 1344 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;'; 1345 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';'; 1346 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';'; 1347 } 1348 }, 1349 "checkCount": function (key) { 1350 "use strict"; 1351 var arr = tarteaucitron.services[key].cookies, 1352 nb = arr.length, 1353 nbCurrent = 0, 1354 html = '', 1355 i, 1356 status = document.cookie.indexOf(key + '=true'); 1357 1358 if (status >= 0 && nb === 0) { 1359 html += tarteaucitron.lang.useNoCookie; 1360 } else if (status >= 0) { 1361 for (i = 0; i < nb; i += 1) { 1362 if (document.cookie.indexOf(arr[i] + '=') !== -1) { 1363 nbCurrent += 1; 1364 if (tarteaucitron.cookie.owner[arr[i]] === undefined) { 1365 tarteaucitron.cookie.owner[arr[i]] = []; 1366 } 1367 if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) { 1368 tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name); 1369 } 1370 } 1371 } 1372 1373 if (nbCurrent > 0) { 1374 html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' cookie'; 1375 if (nbCurrent > 1) { 1376 html += 's'; 1377 } 1378 html += '.'; 1379 } else { 1380 html += tarteaucitron.lang.useNoCookie; 1381 } 1382 } else if (nb === 0) { 1383 html = tarteaucitron.lang.noCookie; 1384 } else { 1385 html += tarteaucitron.lang.useCookie + ' ' + nb + ' cookie'; 1386 if (nb > 1) { 1387 html += 's'; 1388 } 1389 html += '.'; 1390 } 1391 1392 if (document.getElementById('tacCL' + key) !== null) { 1393 document.getElementById('tacCL' + key).innerHTML = html; 1394 } 1395 }, 1396 "crossIndexOf": function (arr, match) { 1397 "use strict"; 1398 var i; 1399 for (i = 0; i < arr.length; i += 1) { 1400 if (arr[i] === match) { 1401 return true; 1402 } 1403 } 1404 return false; 1405 }, 1406 "number": function () { 1407 "use strict"; 1408 var cookies = document.cookie.split(';'), 1409 nb = (document.cookie !== '') ? cookies.length : 0, 1410 html = '', 1411 i, 1412 name, 1413 namea, 1414 nameb, 1415 c, 1416 d, 1417 s = (nb > 1) ? 's' : '', 1418 savedname, 1419 regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i, 1420 regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn, 1421 host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain; 1422 1423 cookies = cookies.sort(function (a, b) { 1424 namea = a.split('=', 1).toString().replace(/ /g, ''); 1425 nameb = b.split('=', 1).toString().replace(/ /g, ''); 1426 c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0'; 1427 d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0'; 1428 if (c + a > d + b) { return 1; } 1429 if (c + a < d + b) { return -1; } 1430 return 0; 1431 }); 1432 1433 if (document.cookie !== '') { 1434 for (i = 0; i < nb; i += 1) { 1435 name = cookies[i].split('=', 1).toString().replace(/ /g, ''); 1436 if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) { 1437 savedname = tarteaucitron.cookie.owner[name].join(' // '); 1438 html += '<div class="tarteaucitronHidden">'; 1439 html += ' <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">'; 1440 html += ' ' + tarteaucitron.cookie.owner[name].join(' // '); 1441 html += ' </span>'; 1442 html += '</div><ul class="cookie-list">'; 1443 } else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) { 1444 savedname = host; 1445 html += '<div class="tarteaucitronHidden">'; 1446 html += ' <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">'; 1447 html += ' ' + host; 1448 html += ' </span>'; 1449 html += '</div><ul class="cookie-list">'; 1450 } 1451 html += '<li class="tarteaucitronCookiesListMain">'; 1452 html += ' <div class="tarteaucitronCookiesListLeft"><button type="button" class="purgeBtn" data-cookie="' + tarteaucitron.fixSelfXSS(cookies[i].split('=', 1)) + '"><strong>×</strong></button> <strong>' + tarteaucitron.fixSelfXSS(name) + '</strong>'; 1453 html += ' </div>'; 1454 html += ' <div class="tarteaucitronCookiesListRight">' + tarteaucitron.fixSelfXSS(cookies[i].split('=').slice(1).join('=')) + '</div>'; 1455 html += '</li>'; 1456 } 1457 html += '</ul>'; 1458 } else { 1459 html += '<div class="tarteaucitronCookiesListMain">'; 1460 html += ' <div class="tarteaucitronCookiesListLeft"><strong>-</strong></div>'; 1461 html += ' <div class="tarteaucitronCookiesListRight"></div>'; 1462 html += '</div>'; 1463 } 1464 1465 html += '<div class="tarteaucitronHidden spacer-20"></div>'; 1466 1467 if (document.getElementById('tarteaucitronCookiesList') !== null) { 1468 document.getElementById('tarteaucitronCookiesList').innerHTML = html; 1469 } 1470 1471 if (document.getElementById('tarteaucitronCookiesNumber') !== null) { 1472 document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb; 1473 } 1474 1475 if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) { 1476 document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s; 1477 } 1478 1479 var purgeBtns = document.getElementsByClassName("purgeBtn"); 1480 for (let i = 0; i < purgeBtns.length; i++) { 1481 tarteaucitron.addClickEventToElement(purgeBtns[i], function () { 1482 tarteaucitron.cookie.purge([this.dataset.cookie]); 1483 tarteaucitron.cookie.number(); 1484 tarteaucitron.userInterface.jsSizing('cookie'); 1485 return false;
1486 }); 1487 } 1488 1489 for (i = 0; i < tarteaucitron.job.length; i += 1) { 1490 tarteaucitron.cookie.checkCount(tarteaucitron.job[i]); 1491 } 1492 } 1493 }, 1494 "fixSelfXSS": function(html) { 1495 fixed = html.toString().replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"); 1496 return fixed; 1497 }, 1498 "getLanguage": function () { 1499 "use strict"; 1500 1501 var availableLanguages = 'bg,cn,cs,da,de,el,en,es,fi,fr,hu,it,ja,nl,oc,pl,pt,ro,ru,se,sk,tr,vi', 1502 defaultLanguage = 'en'; 1503 1504 if (tarteaucitronForceLanguage !== '') { 1505 if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) { 1506 return tarteaucitronForceLanguage; 1507 } 1508 } 1509 1510 if (!navigator) { return 'en'; } 1511 1512 var lang = navigator.language || navigator.browserLanguage || 1513 navigator.systemLanguage || navigator.userLang || null, 1514 userLanguage = lang ? lang.substr(0, 2) : null; 1515 1516 if (availableLanguages.indexOf(userLanguage) === -1) { 1517 return defaultLanguage; 1518 } 1519 return userLanguage; 1520 }, 1521 "getLocale": function () { 1522 "use strict"; 1523 if (!navigator) { return 'en_US'; } 1524 1525 var lang = navigator.language || navigator.browserLanguage || 1526 navigator.systemLanguage || navigator.userLang || null, 1527 userLanguage = lang ? lang.substr(0, 2) : null; 1528 1529 if (userLanguage === 'fr') { 1530 return 'fr_FR'; 1531 } else if (userLanguage === 'en') { 1532 return 'en_US'; 1533 } else if (userLanguage === 'de') { 1534 return 'de_DE'; 1535 } else if (userLanguage === 'es') { 1536 return 'es_ES'; 1537 } else if (userLanguage === 'it') { 1538 return 'it_IT'; 1539 } else if (userLanguage === 'pt') { 1540 return 'pt_PT'; 1541 } else if (userLanguage === 'nl') { 1542 return 'nl_NL'; 1543 } else if (userLanguage === 'el') { 1544 return 'el_EL'; 1545 } else { 1546 return 'en_US'; 1547 } 1548 }, 1549 "addScript": function (url, id, callback, execute, attrName, attrVal, internal) { 1550 "use strict"; 1551 var script, 1552 done = false; 1553 1554 if (execute === false) { 1555 if (typeof callback === 'function') { 1556 callback(); 1557 } 1558 } else { 1559 script = document.createElement('script'); 1560 script.type = 'text/javascript'; 1561 script.id = (id !== undefined) ? id : ''; 1562 script.async = true; 1563 script.src = url; 1564 1565 if (attrName !== undefined && attrVal !== undefined) { 1566 script.setAttribute(attrName, attrVal); 1567 } 1568 1569 if (typeof callback === 'function') { 1570 if ( !tarteaucitron.parameters.useExternalJs ) { 1571 script.onreadystatechange = script.onload = function () { 1572 var state = script.readyState; 1573 if (!done && (!state || /loaded|complete/.test(state))) { 1574 done = true; 1575 callback(); 1576 } 1577 }; 1578 } else { 1579 callback(); 1580 } 1581 } 1582 1583 if ( !tarteaucitron.parameters.useExternalJs || !internal ) { 1584 document.getElementsByTagName('head')[0].appendChild(script); 1585 } 1586 } 1587 }, 1588 "addInternalScript": function (url, id, callback, execute, attrName, attrVal) { 1589 tarteaucitron.addScript(url, id, callback, execute, attrName, attrVal, true); 1590 }, 1591 "makeAsync": { 1592 "antiGhost": 0, 1593 "buffer": '', 1594 "init": function (url, id) { 1595 "use strict"; 1596 var savedWrite = document.write, 1597 savedWriteln = document.writeln; 1598 1599 document.write = function (content) { 1600 tarteaucitron.makeAsync.buffer += content; 1601 }; 1602 document.writeln = function (content) { 1603 tarteaucitron.makeAsync.buffer += content.concat("\n"); 1604 }; 1605 1606 setTimeout(function () { 1607 document.write = savedWrite;
1608 document.writeln = savedWriteln; 1609 }, 20000); 1610 1611 tarteaucitron.makeAsync.getAndParse(url, id); 1612 }, 1613 "getAndParse": function (url, id) { 1614 "use strict"; 1615 if (tarteaucitron.makeAsync.antiGhost > 9) { 1616 tarteaucitron.makeAsync.antiGhost = 0; 1617 return; 1618 } 1619 tarteaucitron.makeAsync.antiGhost += 1; 1620 tarteaucitron.addInternalScript(url, '', function () { 1621 if (document.getElementById(id) !== null) { 1622 document.getElementById(id).innerHTML += "<span class='display-none'> </span>" + tarteaucitron.makeAsync.buffer; 1623 tarteaucitron.makeAsync.buffer = ''; 1624 tarteaucitron.makeAsync.execJS(id); 1625 } 1626 }); 1627 }, 1628 "execJS": function (id) { 1629 /* not strict because third party scripts may have errors */ 1630 var i, 1631 scripts, 1632 childId, 1633 type; 1634 1635 if (document.getElementById(id) === null) { 1636 return; 1637 } 1638 1639 scripts = document.getElementById(id).getElementsByTagName('script'); 1640 for (i = 0; i < scripts.length; i += 1) { 1641 type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : ''; 1642 if (type === '') { 1643 type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : ''; 1644 } 1645 if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') { 1646 childId = id + Math.floor(Math.random() * 99999999999); 1647 document.getElementById(id).innerHTML += '<div id="' + childId + '"></div>'; 1648 tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId); 1649 } else if (type.indexOf('javascript') !== -1 || type === '') { 1650 eval(scripts[i].innerHTML); 1651 } 1652 } 1653 } 1654 }, 1655 "fallback": function (matchClass, content, noInner) { 1656 "use strict"; 1657 var elems = document.getElementsByTagName('*'), 1658 i, 1659 index = 0; 1660 1661 for (i in elems) { 1662 if (elems[i] !== undefined) { 1663 for (index = 0; index < matchClass.length; index += 1) { 1664 if ((' ' + elems[i].className + ' ') 1665 .indexOf(' ' + matchClass[index] + ' ') > -1) { 1666 if (typeof content === 'function') { 1667 if (noInner === true) { 1668 content(elems[i]); 1669 } else { 1670 elems[i].innerHTML = content(elems[i]); 1671 } 1672 } else { 1673 elems[i].innerHTML = content; 1674 } 1675 } 1676 } 1677 } 1678 } 1679 }, 1680 "engage": function (id) { 1681 "use strict"; 1682 var html = '', 1683 r = Math.floor(Math.random() * 100000), 1684 engage = tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback; 1685 1686 if (tarteaucitron.lang['engage-' + id] !== undefined) { 1687 engage = tarteaucitron.lang['engage-' + id]; 1688 } 1689 1690 html += '<div class="tac_activate">'; 1691 html += ' <div class="tac_float">'; 1692 html += ' ' + engage; 1693 html += ' <button type="button" class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '">'; 1694 html += ' ✓ ' + tarteaucitron.lang.allow; 1695 html += ' </button>'; 1696 html += ' </div>'; 1697 html += '</div>'; 1698 1699 return html; 1700 }, 1701 "extend": function (a, b) { 1702 "use strict"; 1703 var prop; 1704 for (prop in b) { 1705 if (b.hasOwnProperty(prop)) { 1706 a[prop] = b[prop]; 1707 } 1708 } 1709 }, 1710 "proTemp": '', 1711 "proTimer": function () { 1712 "use strict"; 1713 setTimeout(tarteaucitron.proPing, 500); 1714 }, 1715 "pro": function (list) { 1716 "use strict"; 1717 tarteaucitron.proTemp += list; 1718 clearTimeout(tarteaucitron.proTimer); 1719 tarteaucitron.proTimer = setTimeout(tarteaucitron.proPing, 500); 1720 }, 1721 "proPing": function () { 1722 "use strict"; 1723 if (tarteaucitron.uuid !== '' && tarteaucitron.uuid !== undefined && tarteaucitron.proTemp !== '') { 1724 var div = document.getElementById('tarteaucitronPremium'), 1725 timestamp = new Date().getTime(), 1726 url = 'https://tarteaucitron.io/log/?'; 1727 1728 if (div === null) { 1729 return; 1730 } 1731 1732 url += 'account=' + tarteaucitron.uuid + '&'; 1733 url += 'domain=' + tarteaucitron.domain + '&'; 1734 url += 'status=' + encodeURIComponent(tarteaucitron.proTemp) + '&'; 1735 url += '_time=' + timestamp; 1736 1737 div.innerHTML = '<img src="' + url + '" class="display-none" />'; 1738 1739 tarteaucitron.proTemp = ''; 1740 } 1741 1742 tarteaucitron.cookie.number(); 1743 }, 1744 "AddOrUpdate" : function(source, custom){ 1745 /** 1746 Utility function to Add or update the fields of obj1 with the ones in obj2 1747 */ 1748 for(key in custom){ 1749 if(custom[key] instanceof Object){ 1750 source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]); 1751 }else{ 1752 source[key] = custom[key]; 1753 } 1754 } 1755 return source; 1756 }, 1757 "getElemWidth": function(elem) { 1758 return elem.getAttribute('width') || elem.clientWidth; 1759 }, 1760 "getElemHeight": function(elem) { 1761 return elem.getAttribute('height') || elem.clientHeight; 1762 }, 1763 "addClickEventToId": function (elemId, func) { 1764 tarteaucitron.addClickEventToElement(document.getElementById(elemId), func); 1765 }, 1766 "addClickEventToElement": function (e, func) { 1767 if (e) { 1768 if (e.addEventListener) { 1769 e.addEventListener("click", func); 1770 } else { 1771 e.attachEvent("onclick", func); 1772 } 1773 } 1774 } 1775};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.