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": 20201017, 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 += ' <span class="tarteaucitronCheck"></span> ' + tarteaucitron.lang.allowAll; 320 html += ' </button> '; 321 html += ' <button type="button" id="tarteaucitronAllDenied" class="tarteaucitronDeny">'; 322 html += ' <span class="tarteaucitronCross"></span> ' + 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" tabindex="-1"> ' + tarteaucitron.lang.mandatoryTitle + '</button>'; 334 html += '</div>'; 335 html += '<ul id="tarteaucitronServices_mandatory">'; 336 html += '<li class="tarteaucitronLine">'; 337 html += ' <div class="tarteaucitronName">';
vendor: 10,864 bytes, lines 338-446
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 += ' <span class="tarteaucitronCheck"></span> ' + tarteaucitron.lang.allow; 344 html += ' </button> '; 345 html += ' <button type="button" class="tarteaucitronDeny" style="visibility:hidden">'; 346 html += ' <span class="tarteaucitronCross"></span> ' + 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] + '"><span class="tarteaucitronPlus"></span> ' + 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 += ' <span class="tarteaucitronCheck"></span> ' + 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 += ' <span class="tarteaucitronCross"></span> ' + 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,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWw6c3BhY2U9InByZXNlcnZlIiB3aWR0aD0iMTI5OXB4IiBoZWlnaHQ9IjEyOTlweCIgdmVyc2lvbj0iMS4xIiBzdHlsZT0ic2hhcGUtcmVuZGVyaW5nOmdlb21ldHJpY1ByZWNpc2lvbjsgdGV4dC1yZW5kZXJpbmc6Z2VvbWV0cmljUHJlY2lzaW9uOyBpbWFnZS1yZW5kZXJpbmc6b3B0aW1pemVRdWFsaXR5OyBmaWxsLXJ1bGU6ZXZlbm9kZDsgY2xpcC1ydWxlOmV2ZW5vZGQiDQp2aWV3Qm94PSIwIDAgMTI5OSAxMjk5Ig0KIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIg0KIGRhdGEtbmFtZT0iTGF5ZXIgMSI+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">';
vendor: 6,366 bytes, lines 701-851
701 html += ' <span class="tarteaucitronCheck"></span> ' + tarteaucitron.lang.allow; 702 html += ' </button> '; 703 html += ' <button type="button" id="' + service.key + 'Denied" class="tarteaucitronDeny">'; 704 html += ' <span class="tarteaucitronCross"></span> ' + 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 || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)) { 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 809 if (property == "display" && value == "none" && (id == "tarteaucitron" || id == "tarteaucitronBack" || id == "tarteaucitronAlertBig")) { 810 document.getElementById(id).style["opacity"] = "0"; 811 812 setTimeout(function() {document.getElementById(id).style[property] = value;}, 200); 813 } else { 814 815 document.getElementById(id).style[property] = value; 816 817 if (property == "display" && value == "block" && (id == "tarteaucitron" || id == "tarteaucitronAlertBig")) { 818 document.getElementById(id).style["opacity"] = "0"; 819 setTimeout(function() {document.getElementById(id).style["opacity"] = "1";}, 1); 820 } 821 822 if (property == "display" && value == "block" && id == "tarteaucitronBack") { 823 document.getElementById(id).style["opacity"] = "0"; 824 setTimeout(function() {document.getElementById(id).style["opacity"] = "0.7";}, 1); 825 } 826 } 827 } 828 }, 829 "addClass": function (id, className) { 830 "use strict"; 831 if (document.getElementById(id) !== null) { 832 document.getElementById(id).classList.add(className); 833 } 834 }, 835 "removeClass": function (id, className) { 836 "use strict"; 837 if (document.getElementById(id) !== null) { 838 document.getElementById(id).classList.remove(className); 839 } 840 }, 841 "respondAll": function (status) { 842 "use strict"; 843 var s = tarteaucitron.services, 844 service, 845 key, 846 index = 0; 847 848 for (index = 0; index < tarteaucitron.job.length; index += 1) { 849 service = s[tarteaucitron.job[index]]; 850 key = service.key; 851 if (tarteaucitron.state[key] !== status) {
852 if (status === false && tarteaucitron.launch[key] === true) { 853 tarteaucitron.reloadThePage = true; 854 } 855 if (tarteaucitron.launch[key] !== true && status === true) { 856 857 tarteaucitron.pro('!' + key + '=engage'); 858 859 tarteaucitron.launch[key] = true; 860 tarteaucitron.services[key].js(); 861 } 862 tarteaucitron.state[key] = status; 863 tarteaucitron.cookie.create(key, status); 864 tarteaucitron.userInterface.color(key, status); 865 } 866 } 867 }, 868 "respond": function (el, status) { 869 "use strict"; 870 if (el.id === '') { 871 return; 872 } 873 var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), ''); 874 875 if (key.substring(0, 13) === 'tarteaucitron' || key === '') {return;} 876 877 // return if same state 878 if (tarteaucitron.state[key] === status) { 879 return; 880 } 881 882 if (status === false && tarteaucitron.launch[key] === true) { 883 tarteaucitron.reloadThePage = true; 884 } 885 886 // if not already launched... launch the service 887 if (status === true) { 888 if (tarteaucitron.launch[key] !== true) { 889 890 tarteaucitron.pro('!' + key + '=engage'); 891 892 tarteaucitron.launch[key] = true; 893 tarteaucitron.sendEvent(key + '_loaded'); 894 tarteaucitron.services[key].js(); 895 } 896 } 897 tarteaucitron.state[key] = status; 898 tarteaucitron.cookie.create(key, status); 899 tarteaucitron.userInterface.color(key, status); 900 }, 901 "color": function (key, status) { 902 "use strict"; 903 var c = 'tarteaucitron', 904 nbDenied = 0, 905 nbPending = 0, 906 nbAllowed = 0, 907 sum = tarteaucitron.job.length, 908 index; 909 910 if (status === true) { 911 document.getElementById(key + 'Line').classList.add('tarteaucitronIsAllowed'); 912 document.getElementById(key + 'Line').classList.remove('tarteaucitronIsDenied'); 913 } else if (status === false) { 914 document.getElementById(key + 'Line').classList.remove('tarteaucitronIsAllowed'); 915 document.getElementById(key + 'Line').classList.add('tarteaucitronIsDenied'); 916 } 917 918 // check if all services are allowed 919 for (index = 0; index < sum; index += 1) { 920 if (tarteaucitron.state[tarteaucitron.job[index]] === false) { 921 nbDenied += 1; 922 } else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) { 923 nbPending += 1; 924 } else if (tarteaucitron.state[tarteaucitron.job[index]] === true) { 925 nbAllowed += 1; 926 } 927 } 928 929 tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%'); 930 tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%'); 931 tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%'); 932 933 if (nbDenied === 0 && nbPending === 0) { 934 tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected'); 935 tarteaucitron.userInterface.addClass(c + 'AllAllowed', c + 'IsSelected'); 936 937 tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsAllowed'); 938 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied'); 939 } else if (nbAllowed === 0 && nbPending === 0) { 940 tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected'); 941 tarteaucitron.userInterface.addClass(c + 'AllDenied', c + 'IsSelected'); 942 943 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed'); 944 tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsDenied'); 945 } else { 946 tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected'); 947 tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected'); 948 949 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed'); 950 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied'); 951 } 952 953 // close the alert if all service have been reviewed 954 if (nbPending === 0) { 955 tarteaucitron.userInterface.closeAlert(); 956 } 957 958 if (tarteaucitron.services[key].cookies.length > 0 && status === false) { 959 tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies); 960 } 961 962 if (status === true) { 963 if (document.getElementById('tacCL' + key) !== null) { 964 document.getElementById('tacCL' + key).innerHTML = '...'; 965 } 966 setTimeout(function () { 967 tarteaucitron.cookie.checkCount(key); 968 }, 2500); 969 } else { 970 tarteaucitron.cookie.checkCount(key); 971 } 972 }, 973 "openPanel": function () { 974 "use strict"; 975 976 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block'); 977 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); 978 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); 979 980 document.getElementById('tarteaucitronClosePanel').focus(); 981 document.getElementsByTagName('body')[0].classList.add('modal-open'); 982 tarteaucitron.userInterface.focusTrap(); 983 tarteaucitron.userInterface.jsSizing('main'); 984 985 //ie compatibility 986 var tacOpenPanelEvent; 987 if(typeof(Event) === 'function') { 988 tacOpenPanelEvent = new Event("tac.open_panel"); 989 }else{ 990 tacOpenPanelEvent = document.createEvent('Event'); 991 tacOpenPanelEvent.initEvent("tac.open_panel", true, true); 992 } 993 //end ie compatibility 994 995 window.dispatchEvent(tacOpenPanelEvent); 996 }, 997 "closePanel": function () { 998 "use strict"; 999 1000 if (document.location.hash === tarteaucitron.hashtag) { 1001 if (window.history) { 1002 window.history.replaceState('', document.title, window.location.pathname + window.location.search); 1003 } else { 1004 document.location.hash = ''; 1005 } 1006 } 1007 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 1008 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); 1009 1010 tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) { 1011 elem.style.display = 'none'; 1012 }, true); 1013 1014 if (tarteaucitron.reloadThePage === true) { 1015 window.location.reload(); 1016 } else { 1017 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none'); 1018 } 1019 if (document.getElementById('tarteaucitronCloseAlert') !== null) { 1020 document.getElementById('tarteaucitronCloseAlert').focus(); 1021 } 1022 document.getElementsByTagName('body')[0].classList.remove('modal-open'); 1023 1024 //ie compatibility 1025 var tacClosePanelEvent; 1026 if(typeof(Event) === 'function') { 1027 tacClosePanelEvent = new Event("tac.close_panel"); 1028 }else{ 1029 tacClosePanelEvent = document.createEvent('Event'); 1030 tacClosePanelEvent.initEvent("tac.close_panel", true, true); 1031 } 1032 //end ie compatibility 1033 1034 window.dispatchEvent(tacClosePanelEvent); 1035 }, 1036 "focusTrap": function() { 1037 "use strict"; 1038 1039 var focusableEls, 1040 firstFocusableEl, 1041 lastFocusableEl, 1042 filtered; 1043 1044 focusableEls = document.getElementById('tarteaucitron').querySelectorAll('a[href], button'); 1045 filtered = []; 1046 1047 // get only visible items
vendor: 5,763 bytes, lines 1048-1184
1048 for (var i = 0, max = focusableEls.length; i < max; i++) { 1049 if (focusableEls[i].offsetHeight > 0) { 1050 filtered.push(focusableEls[i]); 1051 } 1052 } 1053 1054 firstFocusableEl = filtered[0]; 1055 lastFocusableEl = filtered[filtered.length - 1]; 1056 1057 //loop focus inside tarteaucitron 1058 document.getElementById('tarteaucitron').addEventListener("keydown", function (evt) { 1059 1060 if ( evt.key === 'Tab' || evt.keyCode === 9 ) { 1061 1062 if ( evt.shiftKey ) /* shift + tab */ { 1063 if (document.activeElement === firstFocusableEl) { 1064 lastFocusableEl.focus(); 1065 evt.preventDefault(); 1066 } 1067 } else /* tab */ { 1068 if (document.activeElement === lastFocusableEl) { 1069 firstFocusableEl.focus(); 1070 evt.preventDefault(); 1071 } 1072 } 1073 } 1074 }) 1075 }, 1076 "openAlert": function () { 1077 "use strict"; 1078 var c = 'tarteaucitron'; 1079 tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block'); 1080 tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none'); 1081 tarteaucitron.userInterface.css(c + 'Icon', 'display', 'none'); 1082 tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'block'); 1083 tarteaucitron.userInterface.addClass(c + 'Root', 'tarteaucitronBeforeVisible'); 1084 1085 //ie compatibility 1086 var tacOpenAlertEvent; 1087 if(typeof(Event) === 'function') { 1088 tacOpenAlertEvent = new Event("tac.open_alert"); 1089 }else{ 1090 tacOpenAlertEvent = document.createEvent('Event'); 1091 tacOpenAlertEvent.initEvent("tac.open_alert", true, true); 1092 } 1093 //end ie compatibility 1094 1095 window.dispatchEvent(tacOpenAlertEvent); 1096 }, 1097 "closeAlert": function () { 1098 "use strict"; 1099 var c = 'tarteaucitron'; 1100 tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none'); 1101 tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block'); 1102 tarteaucitron.userInterface.css(c + 'Icon', 'display', 'block'); 1103 tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'none'); 1104 tarteaucitron.userInterface.removeClass(c + 'Root', 'tarteaucitronBeforeVisible'); 1105 tarteaucitron.userInterface.jsSizing('box'); 1106 1107 //ie compatibility 1108 var tacCloseAlertEvent; 1109 if(typeof(Event) === 'function') { 1110 tacCloseAlertEvent = new Event("tac.close_alert"); 1111 }else{ 1112 tacCloseAlertEvent = document.createEvent('Event'); 1113 tacCloseAlertEvent.initEvent("tac.close_alert", true, true); 1114 } 1115 //end ie compatibility 1116 1117 window.dispatchEvent(tacCloseAlertEvent); 1118 }, 1119 "toggleCookiesList": function () { 1120 "use strict"; 1121 var div = document.getElementById('tarteaucitronCookiesListContainer'); 1122 1123 if (div === null) { 1124 return; 1125 } 1126 1127 if (div.style.display !== 'block') { 1128 tarteaucitron.cookie.number(); 1129 div.style.display = 'block'; 1130 tarteaucitron.userInterface.jsSizing('cookie'); 1131 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 1132 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); 1133 tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) { 1134 elem.style.display = 'none'; 1135 }, true); 1136 } else { 1137 div.style.display = 'none'; 1138 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 1139 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none'); 1140 } 1141 }, 1142 "toggle": function (id, closeClass) { 1143 "use strict"; 1144 var div = document.getElementById(id); 1145 1146 if (div === null) { 1147 return; 1148 } 1149 1150 if (closeClass !== undefined) { 1151 tarteaucitron.fallback([closeClass], function (elem) { 1152 if (elem.id !== id) { 1153 elem.style.display = 'none'; 1154 } 1155 }, true); 1156 } 1157 1158 if (div.style.display !== 'block') { 1159 div.style.display = 'block'; 1160 } else { 1161 div.style.display = 'none'; 1162 } 1163 }, 1164 "order": function (id) { 1165 "use strict"; 1166 var main = document.getElementById('tarteaucitronServices_' + id), 1167 allDivs, 1168 store = [], 1169 i; 1170 1171 if (main === null) { 1172 return; 1173 } 1174 1175 allDivs = main.childNodes; 1176 1177 if (typeof Array.prototype.map === 'function' && typeof Enumerable === 'undefined') { 1178 Array.prototype.map.call(main.children, Object).sort(function (a, b) { 1179 //var mainChildren = Array.from(main.children); 1180 //mainChildren.sort(function (a, b) { 1181 if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; } 1182 if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; } 1183 return 0; 1184 }
1184).forEach(function (element) { 1185 main.appendChild(element); 1186 }); 1187 } 1188 }, 1189 "jsSizing": function (type) { 1190 "use strict"; 1191 var scrollbarMarginRight = 10, 1192 scrollbarWidthParent, 1193 scrollbarWidthChild, 1194 servicesHeight, 1195 e = window, 1196 a = 'inner', 1197 windowInnerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, 1198 mainTop, 1199 mainHeight, 1200 closeButtonHeight, 1201 headerHeight, 1202 cookiesListHeight, 1203 cookiesCloseHeight, 1204 cookiesTitleHeight, 1205 paddingBox, 1206 alertSmallHeight, 1207 cookiesNumberHeight; 1208 1209 if (type === 'box') { 1210 if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) { 1211 1212 // reset 1213 tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px'); 1214 1215 // calculate 1216 alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight; 1217 cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight; 1218 paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2; 1219 1220 // apply 1221 tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px'); 1222 } 1223 } else if (type === 'main') { 1224 1225 // get the real window width for media query 1226 if (window.innerWidth === undefined) { 1227 a = 'client'; 1228 e = document.documentElement || document.body; 1229 } 1230 1231 // height of the services list container 1232 if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) { 1233 1234 // reset 1235 tarteaucitron.userInterface.css('tarteaucitronServices', 'height', 'auto'); 1236 1237 // calculate 1238 mainHeight = document.getElementById('tarteaucitron').offsetHeight; 1239 closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight; 1240 1241 // apply 1242 servicesHeight = (mainHeight - closeButtonHeight + 2); 1243 tarteaucitron.userInterface.css('tarteaucitronServices', 'height', servicesHeight + 'px'); 1244 tarteaucitron.userInterface.css('tarteaucitronServices', 'overflow-x', 'auto'); 1245 } 1246 1247 // align the main allow/deny button depending on scrollbar width 1248 if (document.getElementById('tarteaucitronServices') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) { 1249 1250 // media query 1251 if (e[a + 'Width'] <= 479) { 1252 //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px'); 1253 } else if (e[a + 'Width'] <= 767) { 1254 scrollbarMarginRight = 12; 1255 } 1256 1257 scrollbarWidthParent = document.getElementById('tarteaucitronServices').offsetWidth; 1258 scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth; 1259 //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px'); 1260 } 1261 1262 // center the main panel 1263 if (document.getElementById('tarteaucitron') !== null) { 1264 1265 // media query 1266 if (e[a + 'Width'] <= 767) { 1267 mainTop = 0; 1268 } else { 1269 mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21; 1270 } 1271 1272 if (document.getElementById('tarteaucitronMainLineOffset') !== null) { 1273 if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) { 1274 mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight; 1275 } 1276 } 1277 1278 // correct 1279 if (mainTop < 0) { 1280 mainTop = 0; 1281 } 1282 1283 // apply 1284 tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px'); 1285 } 1286 1287 1288 } else if (type === 'cookie') { 1289 1290 // put cookies list at bottom 1291 if (document.getElementById('tarteaucitronAlertSmall') !== null) { 1292 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px'); 1293 } 1294 1295 // height of cookies list 1296 if (document.getElementById('tarteaucitronCookiesListContainer') !== null) { 1297 1298 // reset 1299 tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto'); 1300 1301 // calculate 1302 cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight; 1303 cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight; 1304 cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight; 1305 1306 // apply 1307 tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookie
vendor: 9,707 bytes, lines 1307-1506
1307sListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px'); 1308 } 1309 } 1310 } 1311 }, 1312 "cookie": { 1313 "owner": {}, 1314 "create": function (key, status) { 1315 "use strict"; 1316 1317 if (tarteaucitronForceExpire !== '') { 1318 // The number of day(s)/hour(s) can't be higher than 1 year 1319 if ((tarteaucitronExpireInDay && tarteaucitronForceExpire < 365) || (!tarteaucitronExpireInDay && tarteaucitronForceExpire < 8760)) { 1320 if (tarteaucitronExpireInDay) { 1321 // Multiplication to tranform the number of days to milliseconds 1322 timeExpire = tarteaucitronForceExpire * 86400000; 1323 } else { 1324 // Multiplication to tranform the number of hours to milliseconds 1325 timeExpire = tarteaucitronForceExpire * 3600000; 1326 } 1327 } 1328 } 1329 1330 var d = new Date(), 1331 time = d.getTime(), 1332 expireTime = time + timeExpire, // 365 days 1333 regex = new RegExp("!" + key + "=(wait|true|false)", "g"), 1334 cookie = tarteaucitron.cookie.read().replace(regex, ""), 1335 value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status, 1336 domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? '; domain=' + tarteaucitron.parameters.cookieDomain : '', 1337 secure = location.protocol === 'https:' ? '; Secure' : ''; 1338 1339 d.setTime(expireTime); 1340 document.cookie = value + '; expires=' + d.toGMTString() + '; path=/' + domain + secure + '; samesite=lax'; 1341 }, 1342 "read": function () { 1343 "use strict"; 1344 var nameEQ = tarteaucitron.parameters.cookieName + "=", 1345 ca = document.cookie.split(';'), 1346 i, 1347 c; 1348 1349 for (i = 0; i < ca.length; i += 1) { 1350 c = ca[i]; 1351 while (c.charAt(0) === ' ') { 1352 c = c.substring(1, c.length); 1353 } 1354 if (c.indexOf(nameEQ) === 0) { 1355 return c.substring(nameEQ.length, c.length); 1356 } 1357 } 1358 return ''; 1359 }, 1360 "purge": function (arr) { 1361 "use strict"; 1362 var i; 1363 1364 for (i = 0; i < arr.length; i += 1) { 1365 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;'; 1366 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';'; 1367 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';'; 1368 } 1369 }, 1370 "checkCount": function (key) { 1371 "use strict"; 1372 var arr = tarteaucitron.services[key].cookies, 1373 nb = arr.length, 1374 nbCurrent = 0, 1375 html = '', 1376 i, 1377 status = document.cookie.indexOf(key + '=true'); 1378 1379 if (status >= 0 && nb === 0) { 1380 html += tarteaucitron.lang.useNoCookie; 1381 } else if (status >= 0) { 1382 for (i = 0; i < nb; i += 1) { 1383 if (document.cookie.indexOf(arr[i] + '=') !== -1) { 1384 nbCurrent += 1; 1385 if (tarteaucitron.cookie.owner[arr[i]] === undefined) { 1386 tarteaucitron.cookie.owner[arr[i]] = []; 1387 } 1388 if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) { 1389 tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name); 1390 } 1391 } 1392 } 1393 1394 if (nbCurrent > 0) { 1395 html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' cookie'; 1396 if (nbCurrent > 1) { 1397 html += 's'; 1398 } 1399 html += '.'; 1400 } else { 1401 html += tarteaucitron.lang.useNoCookie; 1402 } 1403 } else if (nb === 0) { 1404 html = tarteaucitron.lang.noCookie; 1405 } else { 1406 html += tarteaucitron.lang.useCookie + ' ' + nb + ' cookie'; 1407 if (nb > 1) { 1408 html += 's'; 1409 } 1410 html += '.'; 1411 } 1412 1413 if (document.getElementById('tacCL' + key) !== null) { 1414 document.getElementById('tacCL' + key).innerHTML = html; 1415 } 1416 }, 1417 "crossIndexOf": function (arr, match) { 1418 "use strict"; 1419 var i; 1420 for (i = 0; i < arr.length; i += 1) { 1421 if (arr[i] === match) { 1422 return true; 1423 } 1424 } 1425 return false; 1426 }, 1427 "number": function () { 1428 "use strict"; 1429 var cookies = document.cookie.split(';'), 1430 nb = (document.cookie !== '') ? cookies.length : 0, 1431 html = '', 1432 i, 1433 name, 1434 namea, 1435 nameb, 1436 c, 1437 d, 1438 s = (nb > 1) ? 's' : '', 1439 savedname, 1440 regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i, 1441 regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn, 1442 host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain; 1443 1444 cookies = cookies.sort(function (a, b) { 1445 namea = a.split('=', 1).toString().replace(/ /g, ''); 1446 nameb = b.split('=', 1).toString().replace(/ /g, ''); 1447 c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0'; 1448 d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0'; 1449 if (c + a > d + b) { return 1; } 1450 if (c + a < d + b) { return -1; } 1451 return 0; 1452 }); 1453 1454 if (document.cookie !== '') { 1455 for (i = 0; i < nb; i += 1) { 1456 name = cookies[i].split('=', 1).toString().replace(/ /g, ''); 1457 if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) { 1458 savedname = tarteaucitron.cookie.owner[name].join(' // '); 1459 html += '<div class="tarteaucitronHidden">'; 1460 html += ' <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">'; 1461 html += ' ' + tarteaucitron.cookie.owner[name].join(' // '); 1462 html += ' </span>'; 1463 html += '</div><ul class="cookie-list">'; 1464 } else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) { 1465 savedname = host; 1466 html += '<div class="tarteaucitronHidden">'; 1467 html += ' <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">'; 1468 html += ' ' + host; 1469 html += ' </span>'; 1470 html += '</div><ul class="cookie-list">'; 1471 } 1472 html += '<li class="tarteaucitronCookiesListMain">'; 1473 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>'; 1474 html += ' </div>'; 1475 html += ' <div class="tarteaucitronCookiesListRight">' + tarteaucitron.fixSelfXSS(cookies[i].split('=').slice(1).join('=')) + '</div>'; 1476 html += '</li>'; 1477 } 1478 html += '</ul>'; 1479 } else { 1480 html += '<div class="tarteaucitronCookiesListMain">'; 1481 html += ' <div class="tarteaucitronCookiesListLeft"><strong>-</strong></div>'; 1482 html += ' <div class="tarteaucitronCookiesListRight"></div>'; 1483 html += '</div>'; 1484 } 1485 1486 html += '<div class="tarteaucitronHidden spacer-20"></div>'; 1487 1488 if (document.getElementById('tarteaucitronCookiesList') !== null) { 1489 document.getElementById('tarteaucitronCookiesList').innerHTML = html; 1490 } 1491 1492 if (document.getElementById('tarteaucitronCookiesNumber') !== null) { 1493 document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb; 1494 } 1495 1496 if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) { 1497 document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s; 1498 } 1499 1500 var purgeBtns = document.getElementsByClassName("purgeBtn"); 1501 for (let i = 0; i < purgeBtns.length; i++) { 1502 tarteaucitron.addClickEventToElement(purgeBtns[i], function () { 1503 tarteaucitron.cookie.purge([this.dataset.cookie]); 1504 tarteaucitron.cookie.number(); 1505 tarteaucitron.userInterface.jsSizing('cookie'); 1506 return false;
1507 }); 1508 } 1509 1510 for (i = 0; i < tarteaucitron.job.length; i += 1) { 1511 tarteaucitron.cookie.checkCount(tarteaucitron.job[i]); 1512 } 1513 } 1514 }, 1515 "fixSelfXSS": function(html) { 1516 fixed = html.toString().replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"); 1517 return fixed; 1518 }, 1519 "getLanguage": function () { 1520 "use strict"; 1521 1522 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', 1523 defaultLanguage = 'en'; 1524 1525 if (tarteaucitronForceLanguage !== '') { 1526 if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) { 1527 return tarteaucitronForceLanguage; 1528 } 1529 } 1530 1531 if (!navigator) { return 'en'; } 1532 1533 var lang = navigator.language || navigator.browserLanguage || 1534 navigator.systemLanguage || navigator.userLang || null, 1535 userLanguage = lang ? lang.substr(0, 2) : null; 1536 1537 if (availableLanguages.indexOf(userLanguage) === -1) { 1538 return defaultLanguage; 1539 } 1540 return userLanguage; 1541 }, 1542 "getLocale": function () { 1543 "use strict"; 1544 if (!navigator) { return 'en_US'; } 1545 1546 var lang = navigator.language || navigator.browserLanguage || 1547 navigator.systemLanguage || navigator.userLang || null, 1548 userLanguage = lang ? lang.substr(0, 2) : null; 1549 1550 if (userLanguage === 'fr') { 1551 return 'fr_FR'; 1552 } else if (userLanguage === 'en') { 1553 return 'en_US'; 1554 } else if (userLanguage === 'de') { 1555 return 'de_DE'; 1556 } else if (userLanguage === 'es') { 1557 return 'es_ES'; 1558 } else if (userLanguage === 'it') { 1559 return 'it_IT'; 1560 } else if (userLanguage === 'pt') { 1561 return 'pt_PT'; 1562 } else if (userLanguage === 'nl') { 1563 return 'nl_NL'; 1564 } else if (userLanguage === 'el') { 1565 return 'el_EL'; 1566 } else { 1567 return 'en_US'; 1568 } 1569 }, 1570 "addScript": function (url, id, callback, execute, attrName, attrVal, internal) { 1571 "use strict"; 1572 var script, 1573 done = false; 1574 1575 if (execute === false) { 1576 if (typeof callback === 'function') { 1577 callback(); 1578 } 1579 } else { 1580 script = document.createElement('script'); 1581 script.type = 'text/javascript'; 1582 script.id = (id !== undefined) ? id : ''; 1583 script.async = true; 1584 script.src = url; 1585 1586 if (attrName !== undefined && attrVal !== undefined) { 1587 script.setAttribute(attrName, attrVal); 1588 } 1589 1590 if (typeof callback === 'function') { 1591 if ( !tarteaucitron.parameters.useExternalJs ) { 1592 script.onreadystatechange = script.onload = function () { 1593 var state = script.readyState; 1594 if (!done && (!state || /loaded|complete/.test(state))) { 1595 done = true; 1596 callback(); 1597 } 1598 }; 1599 } else { 1600 callback(); 1601 } 1602 } 1603 1604 if ( !tarteaucitron.parameters.useExternalJs || !internal ) { 1605 document.getElementsByTagName('head')[0].appendChild(script); 1606 } 1607 } 1608 }, 1609 "addInternalScript": function (url, id, callback, execute, attrName, attrVal) { 1610 tarteaucitron.addScript(url, id, callback, execute, attrName, attrVal, true); 1611 }, 1612 "makeAsync": { 1613 "antiGhost": 0, 1614 "buffer": '', 1615 "init": function (url, id) { 1616 "use strict"; 1617 var savedWrite = document.write, 1618 savedWriteln = document.writeln; 1619 1620 document.write = function (content) { 1621 tarteaucitron.makeAsync.buffer += content; 1622 }; 1623 document.writeln = function (content) { 1624 tarteaucitron.makeAsync.buffer += content.concat("\n"); 1625 }; 1626 1627 setTimeout(function () { 1628 document.write = savedWrite;
1629 document.writeln = savedWriteln; 1630 }, 20000); 1631 1632 tarteaucitron.makeAsync.getAndParse(url, id); 1633 }, 1634 "getAndParse": function (url, id) { 1635 "use strict"; 1636 if (tarteaucitron.makeAsync.antiGhost > 9) { 1637 tarteaucitron.makeAsync.antiGhost = 0; 1638 return; 1639 } 1640 tarteaucitron.makeAsync.antiGhost += 1; 1641 tarteaucitron.addInternalScript(url, '', function () { 1642 if (document.getElementById(id) !== null) { 1643 document.getElementById(id).innerHTML += "<span class='display-none'> </span>" + tarteaucitron.makeAsync.buffer; 1644 tarteaucitron.makeAsync.buffer = ''; 1645 tarteaucitron.makeAsync.execJS(id); 1646 } 1647 }); 1648 }, 1649 "execJS": function (id) { 1650 /* not strict because third party scripts may have errors */ 1651 var i, 1652 scripts, 1653 childId, 1654 type; 1655 1656 if (document.getElementById(id) === null) { 1657 return; 1658 } 1659 1660 scripts = document.getElementById(id).getElementsByTagName('script'); 1661 for (i = 0; i < scripts.length; i += 1) { 1662 type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : ''; 1663 if (type === '') { 1664 type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : ''; 1665 } 1666 if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') { 1667 childId = id + Math.floor(Math.random() * 99999999999); 1668 document.getElementById(id).innerHTML += '<div id="' + childId + '"></div>'; 1669 tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId); 1670 } else if (type.indexOf('javascript') !== -1 || type === '') { 1671 eval(scripts[i].innerHTML); 1672 } 1673 } 1674 } 1675 }, 1676 "fallback": function (matchClass, content, noInner) { 1677 "use strict"; 1678 var elems = document.getElementsByTagName('*'), 1679 i, 1680 index = 0; 1681 1682 for (i in elems) { 1683 if (elems[i] !== undefined) { 1684 for (index = 0; index < matchClass.length; index += 1) { 1685 if ((' ' + elems[i].className + ' ') 1686 .indexOf(' ' + matchClass[index] + ' ') > -1) { 1687 if (typeof content === 'function') { 1688 if (noInner === true) { 1689 content(elems[i]); 1690 } else { 1691 elems[i].innerHTML = content(elems[i]); 1692 } 1693 } else { 1694 elems[i].innerHTML = content; 1695 } 1696 } 1697 } 1698 } 1699 } 1700 }, 1701 "engage": function (id) { 1702 "use strict"; 1703 var html = '', 1704 r = Math.floor(Math.random() * 100000), 1705 engage = tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback; 1706 1707 if (tarteaucitron.lang['engage-' + id] !== undefined) { 1708 engage = tarteaucitron.lang['engage-' + id]; 1709 } 1710 1711 html += '<div class="tac_activate tac_activate_' + id + '">'; 1712 html += ' <div class="tac_float">'; 1713 html += ' ' + engage; 1714 html += ' <button type="button" class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '">'; 1715 html += ' <span class="tarteaucitronCheck"></span> ' + tarteaucitron.lang.allow; 1716 html += ' </button>'; 1717 html += ' </div>'; 1718 html += '</div>'; 1719 1720 return html; 1721 }, 1722 "extend": function (a, b) { 1723 "use strict"; 1724 var prop; 1725 for (prop in b) { 1726 if (b.hasOwnProperty(prop)) { 1727 a[prop] = b[prop]; 1728 } 1729 } 1730 }, 1731 "proTemp": '', 1732 "proTimer": function () { 1733 "use strict"; 1734 setTimeout(tarteaucitron.proPing, 500); 1735 }, 1736 "pro": function (list) { 1737 "use strict"; 1738 tarteaucitron.proTemp += list; 1739 clearTimeout(tarteaucitron.proTimer); 1740 tarteaucitron.proTimer = setTimeout(tarteaucitron.proPing, 500); 1741 }, 1742 "proPing": function () { 1743 "use strict"; 1744 if (tarteaucitron.uuid !== '' && tarteaucitron.uuid !== undefined && tarteaucitron.proTemp !== '') { 1745 var div = document.getElementById('tarteaucitronPremium'), 1746 timestamp = new Date().getTime(), 1747 url = 'https://tarteaucitron.io/log/?'; 1748 1749 if (div === null) { 1750 return; 1751 } 1752 1753 url += 'account=' + tarteaucitron.uuid + '&'; 1754 url += 'domain=' + tarteaucitron.domain + '&'; 1755 url += 'status=' + encodeURIComponent(tarteaucitron.proTemp) + '&'; 1756 url += '_time=' + timestamp; 1757 1758 div.innerHTML = '<img src="' + url + '" class="display-none" />'; 1759 1760 tarteaucitron.proTemp = ''; 1761 } 1762 1763 tarteaucitron.cookie.number(); 1764 }, 1765 "AddOrUpdate" : function(source, custom){ 1766 /** 1767 Utility function to Add or update the fields of obj1 with the ones in obj2 1768 */ 1769 for(key in custom){ 1770 if(custom[key] instanceof Object){ 1771 source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]); 1772 }else{ 1773 source[key] = custom[key]; 1774 } 1775 } 1776 return source; 1777 }, 1778 "getElemWidth": function(elem) { 1779 return elem.getAttribute('width') || elem.clientWidth; 1780 }, 1781 "getElemHeight": function(elem) { 1782 return elem.getAttribute('height') || elem.clientHeight; 1783 }, 1784 "addClickEventToId": function (elemId, func) { 1785 tarteaucitron.addClickEventToElement(document.getElementById(elemId), func); 1786 }, 1787 "addClickEventToElement": function (e, func) { 1788 if (e) { 1789 if (e.addEventListener) { 1790 e.addEventListener("click", func); 1791 } else { 1792 e.attachEvent("onclick", func); 1793 } 1794 } 1795 } 1796};
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.