1/*jslint browser: true, evil: true */ 2/* min ready */ 3 4var scripts = document.getElementsByTagName('script'), 5 tarteaucitronPath = (document.currentScript || scripts[scripts.length - 1]).src.split('?')[0], 6 tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN, 7 tarteaucitronUseMin = (tarteaucitronUseMin === undefined) ? '' : tarteaucitronUseMin, 8 cdn = (tarteaucitronForceCDN === '') ? tarteaucitronPath.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN, 9 alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch, 10 tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage, 11 tarteaucitronForceExpire = (tarteaucitronForceExpire === undefined) ? '' : tarteaucitronForceExpire, 12 tarteaucitronCustomText = (tarteaucitronCustomText === undefined) ? '' : tarteaucitronCustomText, 13 // tarteaucitronExpireInDay: true for day(s) value - false for hour(s) value 14 tarteaucitronExpireInDay = (tarteaucitronExpireInDay === undefined || typeof tarteaucitronExpireInDay !== "boolean") ? true : tarteaucitronExpireInDay, 15 timeExpire = 31536000000, 16 tarteaucitronProLoadServices, 17 tarteaucitronNoAdBlocker = false, 18 tarteaucitronIsLoaded = false; 19 20 21 22var tarteaucitron = { 23 "version": 1.19, 24 "cdn": cdn, 25 "user": {}, 26 "lang": {}, 27 "services": {}, 28 "added": [], 29 "idprocessed": [], 30 "state": {}, 31 "launch": [], 32 "parameters": {}, 33 "isAjax": false, 34 "reloadThePage": false, 35 "events": { 36 "init": function () {}, 37 "load": function () {}, 38 }, 39 "init": function (params) { 40 "use strict"; 41 var origOpen; 42 43 tarteaucitron.parameters = params; 44 if (alreadyLaunch === 0) { 45 alreadyLaunch = 1; 46 if (window.addEventListener) { 47 window.addEventListener("load", function () { 48 tarteaucitron.initEvents.loadEvent(false); 49 }, false); 50 window.addEventListener("scroll", function () { 51 tarteaucitron.initEvents.scrollEvent(); 52 }, false); 53 54 window.addEventListener("keydown", function (evt) { 55 tarteaucitron.initEvents.keydownEvent(false, evt); 56 }, false); 57 window.addEventListener("hashchange", function () { 58 tarteaucitron.initEvents.hashchangeEvent(); 59 }, false); 60 window.addEventListener("resize", function () { 61 tarteaucitron.initEvents.resizeEvent(); 62 }, false); 63 } else { 64 window.attachEvent("onload", function () { 65 tarteaucitron.initEvents.loadEvent(true); 66 });
vendor: 5,913 bytes, lines 66-207
66 67 window.attachEvent("onscroll", function () { 68 tarteaucitron.initEvents.scrollEvent(); 69 }); 70 window.attachEvent("onkeydown", function (evt) { 71 tarteaucitron.initEvents.keydownEvent(true, evt); 72 73 }); 74 window.attachEvent("onhashchange", function () { 75 tarteaucitron.initEvents.hashchangeEvent(); 76 }); 77 window.attachEvent("onresize", function () { 78 tarteaucitron.initEvents.resizeEvent(); 79 }); 80 } 81 82 if (typeof XMLHttpRequest !== 'undefined') { 83 origOpen = XMLHttpRequest.prototype.open; 84 XMLHttpRequest.prototype.open = function () { 85 86 if (window.addEventListener) { 87 this.addEventListener("load", function () { 88 if (typeof tarteaucitronProLoadServices === 'function') { 89 tarteaucitronProLoadServices(); 90 } 91 }, false); 92 } else if (typeof this.attachEvent !== 'undefined') { 93 this.attachEvent("onload", function () { 94 if (typeof tarteaucitronProLoadServices === 'function') { 95 tarteaucitronProLoadServices(); 96 } 97 }); 98 } else { 99 if (typeof tarteaucitronProLoadServices === 'function') { 100 setTimeout(tarteaucitronProLoadServices, 1000); 101 } 102 } 103 104 try { 105 origOpen.apply(this, arguments); 106 } catch (err) {} 107 }; 108 } 109 } 110 111 if(tarteaucitron.events.init) { 112 tarteaucitron.events.init(); 113 } 114 }, 115 "initEvents": { 116 "loadEvent": function (isOldBrowser) { 117 tarteaucitron.load(); 118 tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) { 119 if (isOldBrowser) { 120 elem.attachEvent("onclick", function (event) { 121 tarteaucitron.userInterface.openPanel(); 122 event.preventDefault(); 123 }); 124 } else { 125 elem.addEventListener("click", function (event) { 126 tarteaucitron.userInterface.openPanel(); 127 event.preventDefault(); 128 }, false); 129 } 130 }, true); 131 }, 132 "keydownEvent": function (isOldBrowser, evt) { 133 if (evt.keyCode === 27) { 134 tarteaucitron.userInterface.closePanel(); 135 } 136 137 if (isOldBrowser) { 138 if ( evt.keyCode === 9 && focusableEls.indexOf(evt.target) >= 0) { 139 if ( evt.shiftKey ) /* shift + tab */ { 140 if (document.activeElement === firstFocusableEl) { 141 lastFocusableEl.focus(); 142 evt.preventDefault(); 143 } 144 } else /* tab */ { 145 if (document.activeElement === lastFocusableEl) { 146 firstFocusableEl.focus(); 147 evt.preventDefault(); 148 } 149 } 150 } 151 } 152 }, 153 "hashchangeEvent": function () { 154 if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') { 155 tarteaucitron.userInterface.openPanel(); 156 } 157 }, 158 "resizeEvent": function () { 159 var tacElem = document.getElementById('tarteaucitron'); 160 var tacCookieContainer = document.getElementById('tarteaucitronCookiesListContainer'); 161 162 if (tacElem && tacElem.style.display === 'block') { 163 tarteaucitron.userInterface.jsSizing('main'); 164 } 165 166 if (tacCookieContainer && tacCookieContainer.style.display === 'block') { 167 tarteaucitron.userInterface.jsSizing('cookie'); 168 } 169 }, 170 "scrollEvent": function () { 171 var scrollPos = window.pageYOffset || document.documentElement.scrollTop; 172 var heightPosition; 173 var tacPercentage = document.getElementById('tarteaucitronPercentage'); 174 var tacAlertBig = document.getElementById('tarteaucitronAlertBig'); 175 176 if (tacAlertBig && !tarteaucitron.highPrivacy) { 177 if (tacAlertBig.style.display === 'block') { 178 heightPosition = tacAlertBig.offsetHeight + 'px'; 179 180 if (scrollPos > (screen.height * 2)) { 181 tarteaucitron.userInterface.respondAll(true); 182 } else if (scrollPos > (screen.height / 2)) { 183 document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '<strong>' + tarteaucitron.lang.alertBigScroll + '</strong> ' + tarteaucitron.lang.alertBig; 184 } 185 186 if (tacPercentage) { 187 if (tarteaucitron.orientation === 'top') { 188 tacPercentage.style.top = heightPosition; 189 } else { 190 tacPercentage.style.bottom = heightPosition; 191 } 192 tacPercentage.style.width = ((100 / (screen.height * 2)) * scrollPos) + '%'; 193 } 194 } 195 } 196 }, 197 }, 198 "load": function () { 199 "use strict"; 200 201 if (tarteaucitronIsLoaded === true) { 202 return; 203 } 204 205 var cdn = tarteaucitron.cdn, 206 language = tarteaucitron.getLanguage(), 207 useMinifiedJS = ((
vendor: 9,906 bytes, lines 207-423
207cdn.indexOf('cdn.jsdelivr.net') >= 0) || (tarteaucitronPath.indexOf('.min.') >= 0) || (tarteaucitronUseMin !== '')), 208 pathToLang = cdn + 'lang/tarteaucitron.' + language + (useMinifiedJS ? '.min' : '') + '.js', 209 pathToServices = cdn + 'tarteaucitron.services' + (useMinifiedJS ? '.min' : '') + '.js', 210 linkElement = document.createElement('link'), 211 defaults = { 212 "adblocker": false, 213 "hashtag": '#tarteaucitron', 214 "cookieName": 'tarteaucitron', 215 "highPrivacy": true, 216 "orientation": "middle", 217 "bodyPosition": "bottom", 218 "removeCredit": false, 219 "showAlertSmall": false, 220 "showDetailsOnClick": true, 221 "showIcon": true, 222 "iconPosition": "BottomRight", 223 "cookieslist": false, 224 "handleBrowserDNTRequest": false, 225 "DenyAllCta": true, 226 "AcceptAllCta" : true, 227 "moreInfoLink": true, 228 "privacyUrl": "", 229 "useExternalCss": false, 230 "useExternalJs": false, 231 "mandatory": true, 232 "mandatoryCta": true, 233 "closePopup": false, 234 "groupServices": false, 235 "serviceDefaultState": 'wait', 236 "googleConsentMode": true, 237 "partnersList": false, 238 "alwaysNeedConsent": false 239 }, 240 params = tarteaucitron.parameters; 241 242 // flag the tac load 243 tarteaucitronIsLoaded = true; 244 245 // Don't show the middle bar if we are on the privacy policy or more page 246 if (((tarteaucitron.parameters.readmoreLink !== undefined && window.location.href == tarteaucitron.parameters.readmoreLink) || window.location.href == tarteaucitron.parameters.privacyUrl) && tarteaucitron.parameters.orientation == "middle") { 247 tarteaucitron.parameters.orientation = "bottom"; 248 } 249 250 // Step -1 251 if (typeof tarteaucitronCustomPremium !== 'undefined') { 252 tarteaucitronCustomPremium(); 253 } 254 255 // Step 0: get params 256 if (params !== undefined) { 257 258 for (var k in defaults) { 259 if(!tarteaucitron.parameters.hasOwnProperty(k)) { 260 tarteaucitron.parameters[k] = defaults[k]; 261 } 262 } 263 } 264 265 // global 266 tarteaucitron.orientation = tarteaucitron.parameters.orientation; 267 tarteaucitron.hashtag = tarteaucitron.parameters.hashtag; 268 tarteaucitron.highPrivacy = tarteaucitron.parameters.highPrivacy; 269 tarteaucitron.handleBrowserDNTRequest = tarteaucitron.parameters.handleBrowserDNTRequest; 270 tarteaucitron.customCloserId = tarteaucitron.parameters.customCloserId; 271 272 // google consent mode 273 if (tarteaucitron.parameters.googleConsentMode === true) { 274 275 // set the dataLayer and a function to update 276 window.dataLayer = window.dataLayer || []; 277 window.tac_gtag = function tac_gtag() { 278 dataLayer.push(arguments); 279 }; 280 281 // default consent to denied 282 window.tac_gtag('consent', 'default', { 283 ad_storage: 'denied', 284 analytics_storage: 'denied', 285 ad_user_data: 'denied', 286 ad_personalization: 'denied', 287 wait_for_update: 800 288 }); 289 290 // if google ads, add a service for personalized ads 291 document.addEventListener('googleads_added', function() { 292 293 // skip if already added 294 if (tarteaucitron.added["gcmads"] === true) { 295 return; 296 } 297 298 // simple service to control gcm with event 299 tarteaucitron.services.gcmads = { 300 "key": "gcmads", 301 "type": "ads", 302 "name": "Google Ads (personalized ads)", 303 "uri": "https://support.google.com/analytics/answer/9976101", 304 "needConsent": true, 305 "cookies": [], 306 "js": function() {}, 307 "fallback": function() {} 308 }; 309 tarteaucitron.job.push('gcmads'); 310 311 // fix the event handler on the buttons 312 var i, 313 allowBtns = document.getElementsByClassName("tarteaucitronAllow"), 314 denyBtns = document.getElementsByClassName("tarteaucitronDeny"); 315 for (i = 0; i < allowBtns.length; i++) { 316 tarteaucitron.addClickEventToElement(allowBtns[i], function() { 317 tarteaucitron.userInterface.respond(this, true); 318 }); 319 } 320 for (i = 0; i < denyBtns.length; i++) { 321 tarteaucitron.addClickEventToElement(denyBtns[i], function() { 322 tarteaucitron.userInterface.respond(this, false); 323 }); 324 } 325 }); 326 327 // when personalized ads are accepted, accept googleads 328 document.addEventListener('gcmads_allowed', function() { 329 tarteaucitron.setConsent('googleads', true); 330 }); 331 332 // personalized ads loaded/allowed, set gcm to granted 333 document.addEventListener('gcmads_loaded', function() { 334 window.tac_gtag('consent', 'update', { 335 ad_user_data: 'granted', 336 ad_personalization: 'granted' 337 }); 338 }); 339 document.addEventListener('gcmads_allowed', function() { 340 window.tac_gtag('consent', 'update', { 341 ad_user_data: 'granted', 342 ad_personalization: 'granted' 343 }); 344 }); 345 346 // personalized ads disallowed, set gcm to denied 347 document.addEventListener('gcmads_disallowed', function() { 348 window.tac_gtag('consent', 'update', { 349 ad_user_data: 'denied', 350 ad_personalization: 'denied' 351 }); 352 }); 353 354 // google ads loaded/allowed, set gcm to granted 355 document.addEventListener('googleads_loaded', function() { 356 window.tac_gtag('consent', 'update', { 357 ad_storage: 'granted' 358 }); 359 }); 360 document.addEventListener('googleads_allowed', function() { 361 window.tac_gtag('consent', 'update', { 362 ad_storage: 'granted' 363 }); 364 }); 365 366 // google ads disallowed, disable personalized ads and update gcm 367 document.addEventListener('googleads_disallowed', function() { 368 tarteaucitron.setConsent('gcmads', false); 369 window.tac_gtag('consent', 'update', { 370 ad_storage: 'denied' 371 }); 372 }); 373 374 // ga4 loaded/allowed, set gcm to granted 375 document.addEventListener('gtag_loaded', function() { 376 window.tac_gtag('consent', 'update', { 377 analytics_storage: 'granted' 378 }); 379 }); 380 document.addEventListener('gtag_allowed', function() { 381 window.tac_gtag('consent', 'update', { 382 analytics_storage: 'granted' 383 }); 384 }); 385 386 // ga4 disallowed, update gcm 387 document.addEventListener('gtag_disallowed', function() { 388 window.tac_gtag('consent', 'update', { 389 analytics_storage: 'denied' 390 }); 391 }); 392 393 // allow gtag/googleads by default if consent mode is on 394 window.addEventListener('tac.root_available', function() { 395 if (typeof tarteaucitron_block !== 'undefined') { 396 tarteaucitron_block.unblock(/www\.googletagmanager\.com\/gtag\/js/); 397 tarteaucitron_block.unblock(/www\.googleadservices\.com\/pagead\/conversion/); 398 tarteaucitron_block.unblock(/AW-/); 399 tarteaucitron_block.unblock(/google-analytics\.com\/analytics\.js/); 400 tarteaucitron_block.unblock(/google-analytics\.com\/ga\.js/); 401 } 402 }); 403 } 404 405 // Step 1: load css 406 if ( !tarteaucitron.parameters.useExternalCss ) { 407 linkElement.rel = 'stylesheet'; 408 linkElement.type = 'text/css'; 409 linkElement.href = cdn + 'css/tarteaucitron' + (useMinifiedJS ? '.min' : '') + '.css'; 410 document.getElementsByTagName('head')[0].appendChild(linkElement); 411 } 412 // Step 2: load language and services 413 tarteaucitron.addInternalScript(pathToLang, '', function () { 414 415 if(tarteaucitronCustomText !== ''){ 416 tarteaucitron.lang = tarteaucitron.AddOrUpdate(tarteaucitron.lang, tarteaucitronCustomText); 417 } 418 tarteaucitron.addInternalScript(pathToServices, '', function () { 419 420 // css for the middle bar TODO: add it on the css file 421 if (tarteaucitron.orientation === 'middle') { 422 var customThemeMiddle = document.createElement('style'), 423 cssRuleMiddle = 'div#tarteaucitronRoot.tarteaucitronBeforeVisible:before {content: \'\';position: fixed;width: 100%;height: 100%;background: white;top: 0;left: 0;z-index: 999;opacity: 0.5;}div#tarteaucitronAlertBig:before {content: \'' + tarteaucitron.lang.middleBarHead + '\';font-size: 35px;}body #tarteaucitronRoot div#tarteaucitronAlertBig {width: 60%;min-width: 285px;height: auto;margin: auto;left: 50%;top: 50%;transform: translate(-50%, -50%);box-shadow: 0 0 9000px #000;border-radius: 20px;padding: 35px 25px;}
423span#tarteaucitronDisclaimerAlert {padding: 0 30px;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 10px 0 30px;display: block;text-align: center;font-size: 21px;}@media screen and (max-width: 900px) {div#tarteaucitronAlertBig button {margin: 0 auto 10px!important;display: block!important;}}'; 424 425 customThemeMiddle.type = 'text/css'; 426 if (customThemeMiddle.styleSheet) { 427 customThemeMiddle.styleSheet.cssText = cssRuleMiddle; 428 } else { 429 customThemeMiddle.appendChild(document.createTextNode(cssRuleMiddle)); 430 } 431 document.getElementsByTagName('head')[0].appendChild(customThemeMiddle); 432 } 433 434 // disable the expand option if services grouped by category 435 if (tarteaucitron.parameters.groupServices == true) { 436 tarteaucitron.parameters.showDetailsOnClick = true; 437 } 438 439 // css for the popup bar TODO: add it on the css file 440 if (tarteaucitron.orientation === 'popup') { 441 var customThemePopup = document.createElement('style'), 442 cssRulePopup = 'div#tarteaucitronAlertBig:before {content: \'' + tarteaucitron.lang.middleBarHead + '\';font-size: 22px;}body #tarteaucitronRoot div#tarteaucitronAlertBig {bottom: 0;top: auto!important;left: 8px!important;right: auto!important;transform: initial!important;border-radius: 5px 5px 0 0!important;max-width: 250px!important;width: calc(100% - 16px)!important;min-width: 0!important;padding: 25px 0;}span#tarteaucitronDisclaimerAlert {padding: 0 30px;font-size: 15px!important;}#tarteaucitronRoot span#tarteaucitronDisclaimerAlert {margin: 10px 0 30px;display: block;text-align: center;font-size: 21px;}div#tarteaucitronAlertBig button {margin: 0 auto 10px!important;display: block!important;width: calc(100% - 60px);box-sizing: border-box;}'; 443 444 customThemePopup.type = 'text/css'; 445 if (customThemePopup.styleSheet) { 446 customThemePopup.styleSheet.cssText = cssRulePopup; 447 } else { 448 customThemePopup.appendChild(document.createTextNode(cssRulePopup)); 449 } 450 document.getElementsByTagName('head')[0].appendChild(customThemePopup); 451 } 452 453 var body = document.body, 454 div = document.createElement('div'), 455 html = '', 456 index, 457 orientation = 'Top', 458 modalAttrs = '', 459 cat = ['ads', 'analytic', 'api', 'comment', 'social', 'support', 'video', 'other', 'google'], 460 i; 461 462 cat = cat.sort(function (a, b) { 463 if (tarteaucitron.lang[a].title > tarteaucitron.lang[b].title) { return 1; } 464 if (tarteaucitron.lang[a].title < tarteaucitron.lang[b].title) { return -1; } 465 return 0; 466 }); 467 468 // Step 3: prepare the html 469 html += '<div role="heading" aria-level="1" id="tac_title" class="tac_visually-hidden">' + tarteaucitron.lang.title + '</div>'; 470 html += '<div id="tarteaucitronPremium"></div>'; 471 if (tarteaucitron.reloadThePage) { 472 html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')"></button>'; 473 } else { 474 html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron.lang.close + '" title="' + tarteaucitron.lang.close + '"></button>'; 475 } 476 html += '<div id="tarteaucitron" role="dialog" aria-modal="true" aria-labelledby="dialogTitle" tabindex="-1">'; 477 if (tarteaucitron.reloadThePage) { 478 html += ' <button type="button" id="tarteaucitronClosePanel" aria-label="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')">'; 479 } else { 480 html += ' <button type="button" id="tarteaucitronClosePanel">'; 481 } 482 html += ' ' + tarteaucitron.lang.close; 483 html += ' </button>'; 484 html += ' <div id="tarteaucitronServices">'; 485 html += ' <div class="tarteaucitronLine tarteaucitronMainLine" id="tarteaucitronMainLineOffset">';
vendor: 10,104 bytes, lines 486-607
486 html += ' <span class="tarteaucitronH1" role="heading" aria-level="1" id="dialogTitle">'+ tarteaucitron.lang.title + '</span>'; 487 html += ' <div id="tarteaucitronInfo">'; 488 html += ' ' + tarteaucitron.lang.disclaimer; 489 if (tarteaucitron.parameters.privacyUrl !== "") { 490 html += ' <br/><br/>'; 491 html += ' <button type="button" id="tarteaucitronPrivacyUrlDialog" role="link">'; 492 html += ' ' + tarteaucitron.lang.privacyUrl; 493 html += ' </button>'; 494 } 495 html += ' </div>'; 496 html += ' <div class="tarteaucitronName">'; 497 html += ' <span class="tarteaucitronH2" role="heading" aria-level="2">' + tarteaucitron.lang.all + '</span>'; 498 html += ' </div>'; 499 html += ' <div class="tarteaucitronAsk" id="tarteaucitronScrollbarAdjust">'; 500 html += ' <button type="button" id="tarteaucitronAllAllowed" class="tarteaucitronAllow">'; 501 html += ' <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allowAll; 502 html += ' </button> '; 503 html += ' <button type="button" id="tarteaucitronAllDenied" class="tarteaucitronDeny">'; 504 html += ' <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.denyAll; 505 html += ' </button>'; 506 html += ' </div>'; 507 html += ' </div>'; 508 html += ' <div class="tarteaucitronBorder">'; 509 html += ' <div class="clear"></div><ul>'; 510 511 512 if (tarteaucitron.parameters.mandatory == true) { 513 html += '<li id="tarteaucitronServicesTitle_mandatory">'; 514 html += '<div class="tarteaucitronTitle">'; 515 if(tarteaucitron.parameters.showDetailsOnClick){ 516 html += ' <button type="button" tabindex="-1"><span class="tarteaucitronPlus" aria-hidden="true"></span> ' + tarteaucitron.lang.mandatoryTitle + '</button>'; 517 }else{ 518 html += ' <span class="asCatToggleBtn">' + tarteaucitron.lang.mandatoryTitle + '</span>'; 519 } 520 html += '</div>'; 521 html += '<ul id="tarteaucitronServices_mandatory">'; 522 html += '<li class="tarteaucitronLine">'; 523 html += ' <div class="tarteaucitronName">'; 524 html += ' <span class="tarteaucitronH3" role="heading" aria-level="3">' + tarteaucitron.lang.mandatoryText + '</span>'; 525 html += ' <span class="tarteaucitronListCookies" aria-hidden="true"></span><br/>'; 526 html += ' </div>'; 527 if (tarteaucitron.parameters.mandatoryCta == true) { 528 html += ' <div class="tarteaucitronAsk">'; 529 html += ' <button type="button" class="tarteaucitronAllow" tabindex="-1" disabled>'; 530 html += ' <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow; 531 html += ' </button> '; 532 html += ' <button type="button" class="tarteaucitronDeny" tabindex="-1">'; 533 html += ' <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny; 534 html += ' </button> '; 535 html += ' </div>'; 536 } 537 html += '</li>'; 538 html += '</ul></li>'; 539 } 540 541 for (i = 0; i < cat.length; i += 1) { 542 html += ' <li id="tarteaucitronServicesTitle_' + cat[i] + '" class="tarteaucitronHidden">'; 543 html += ' <div class="tarteaucitronTitle" role="heading" aria-level="2">'; 544 if(tarteaucitron.parameters.showDetailsOnClick) 545 { 546 html += ' <button type="button" class="catToggleBtn" aria-expanded="false" data-cat="tarteaucitronDetails' + cat[i] + '"><span class="tarteaucitronPlus" aria-hidden="true"></span> ' + tarteaucitron.lang[cat[i]].title + '</button>'; 547 }else{ 548 html += ' <span class="asCatToggleBtn" data-cat="tarteaucitronInlineDetails' + cat[i] + '">' + tarteaucitron.lang[cat[i]].title + '</span>'; 549 } 550 html += ' </div>'; 551 html += ' <div id="tarteaucitronDetails' + cat[i] + '" class="tarteaucitronDetails '+ (tarteaucitron.parameters.showDetailsOnClick ? 'tarteaucitronInfoBox' : 'tarteaucitronDetailsInline')+'">'; 552 html += ' ' + tarteaucitron.lang[cat[i]].details; 553 html += ' </div>'; 554 html += ' <ul id="tarteaucitronServices_' + cat[i] + '"></ul></li>'; 555 } 556 html += ' <li id="tarteaucitronNoServicesTitle" class="tarteaucitronLine">' + tarteaucitron.lang.noServices + '</li>'; 557 html += ' </ul>'; 558 html += ' <div class="tarteaucitronHidden tarteaucitron-spacer-20" id="tarteaucitronScrollbarChild"></div>'; 559 if (tarteaucitron.parameters.removeCredit === false) { 560 html += ' <a class="tarteaucitronSelfLink" href="https://tarteaucitron.io/" rel="nofollow noreferrer noopener" target="_blank" title="tarteaucitron ' + tarteaucitron.lang.newWindow + '"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHcAAAAeCAYAAAAWwoEYAAADl0lEQVRoge1Y0W3bQAx9CjKARlC+9GVUmqDJBHEmiDyB6wkcTxBngtgTxJ0gzgQW4C/9aYOmE6g4lTQo+k6y3Rb94QOERNQd+cjj8XiGwWAwGAwGg8FgMBgMBoPB8F8RNRXe+whEKe7c36ZCAeCRxC9Rig2PUd8kPgAsoxSfQ3YAzAA8D/HwYYCb05kBKKO0teFkmbC1jlKsAnq/Abjn+QBqAIsoRS30ttwG/HNz1wH/XIxWTicLdvtW7xTAGEAMtP685CNsBTe2d/BLydfXAG57SEnMAST0zgYZSUCPk02bCvkJduIzuJzDLfPolbY+tLKmar+/8+IRePy4qdpE03qHuH8fipFb4N2+XdA3AJ/0vaQxt7s9FvkIS2XvtqnwM0rxpOQfbnE5G2LhTCmUO2fHIngOmcv+KG3HafDchB6ntwjYqenR2PqC7sOZ3E7FXHB0vqxoFyUyLh7OEH7LOGouvhhN3eIBeKXv0n5MsufdHqXcwYR5U2EbpV35lSspVPJmQj4TcgRK7jTg5IzmPUhhwM5a2WHUFCx+NgiDucmgh7idikLovHFlL0pxQ9xzX+IIP9Y6FrJsqhjlQpZRAkFVDCjZfcCHt6bqJDmuh5ylCWx0RVnk3oumaknqTH5sqrY0fBWyULaHUIgAgxb46MxV3DbieAhxOxUxjSuljig9lMQ/Bcfoi9BTEv9aLORSndVxYOH525sUDC6u2gWxcNzBNRxPanyh3ktKinOgy3WoxPbtUM0t6RkbQnzBnFPgi9GCOEubY9UffIryz9iKRe8s/FUfEWosJJGxagp85bpUO3VywQ46lOtAWfNxKwa4JXQ+628+bpxYGXXMzp5rXH401VEyXwIdowXFaKWSMFHvMTVmGnc+P3oXV2QOiBCfgex8QtcQCbcQE/H+eoHzrkFo1KM7zVO4jVVj5s6lRiWF7zyXyfRMc97J3tzj87mYqZ7E2YjzUct9GUi4tjHLR8dVkBLjQcuHFleWvQfRNEhFR7uX7pkctOwvZXsft7sAtyldEUIN2UTeLxnEfxKYswzdi88BdbZ8hifUoSMftQvP+muRwN6+Q3DeqqRExP9QmTtcheiHh0Ot1x2i2km1bP9pbufw5zZdyWsOrh7vQae5OZWbsMv30pi7cd/CKj3coPEVaCP4Zhx4eQWhOZ1Y9MTXGyP8/iGjEyfa1T4fO/4Lea9vBoPBYDAYDAaDwWAwGAwGwz8GgF8siXCCbrSRhgAAAABJRU5ErkJggg==" alt="tarteaucitron.io" /></a>'; 561 } 562 html += ' </div>'; 563 html += ' </div>'; 564 html += '</div>'; 565 566 if (tarteaucitron.parameters.orientation === 'bottom') { 567 orientation = 'Bottom'; 568 } 569 570 if (tarteaucitron.parameters.orientation === 'middle' || tarteaucitron.parameters.orientation === 'popup') { 571 modalAttrs = ' role="dialog" aria-modal="true" aria-labelledby="tac_title"'; 572 } 573 574 if (tarteaucitron.parameters.highPrivacy && !tarteaucitron.parameters.AcceptAllCta) { 575 html += '<div tabindex="-1" id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '"' + modalAttrs + '>'; 576 //html += '<div class="tarteaucitronAlertBigWrapper">'; 577 html += ' <span id="tarteaucitronDisclaimerAlert" role="paragraph">'; 578 html += ' ' + tarteaucitron.lang.alertBigPrivacy; 579 html += ' </span>'; 580 //html += ' <span class="tarteaucitronAlertBigBtnWrapper">'; 581 html += ' <button type="button" id="tarteaucitronPersonalize" aria-label="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '">'; 582 html += ' ' + tarteaucitron.lang.personalize; 583 html += ' </button>'; 584 585 if (tarteaucitron.parameters.privacyUrl !== "") { 586 html += ' <button role="link" type="button" id="tarteaucitronPrivacyUrl">'; 587 html += ' ' + tarteaucitron.lang.privacyUrl; 588 html += ' </button>'; 589 } 590 591 //html += ' </span>'; 592 //html += '</div>'; 593 html += '</div>'; 594 } else { 595 html += '<div tabindex="-1" id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '"' + modalAttrs + '>'; 596 //html += '<div class="tarteaucitronAlertBigWrapper">'; 597 html += ' <span id="tarteaucitronDisclaimerAlert" role="paragraph">'; 598 599 if (tarteaucitron.parameters.highPrivacy) { 600 html += ' ' + tarteaucitron.lang.alertBigPrivacy; 601 } else { 602 html += ' ' + tarteaucitron.lang.alertBigClick + ' ' + tarteaucitron.lang.alertBig; 603 } 604 605 html += ' </span>'; 606 //html += ' <span class="tarteaucitronAlertBigBtnWrapper">'; 607 html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronAllow" id="tarteaucitronPersonalize2">';
608 html += ' <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.acceptAll; 609 html += ' </button>'; 610 611 612 if (tarteaucitron.parameters.DenyAllCta) { 613 if (tarteaucitron.reloadThePage) { 614 html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2" aria-label="' + tarteaucitron.lang.denyAll + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.denyAll + ' (' + tarteaucitron.lang.reload + ')">'; 615 } else { 616 html += ' <button type="button" class="tarteaucitronCTAButton tarteaucitronDeny" id="tarteaucitronAllDenied2">'; 617 } 618 html += ' <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.denyAll; 619 html += ' </button>'; 620 //html += ' <br/><br/>'; 621 } 622 623 html += ' <button type="button" id="tarteaucitronClose
vendor: 5,924 bytes, lines 623-668
623Alert" aria-label="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.personalize + ' ' + tarteaucitron.lang.modalWindow + '">'; 624 html += ' ' + tarteaucitron.lang.personalize; 625 html += ' </button>'; 626 627 if (tarteaucitron.parameters.privacyUrl !== "") { 628 html += ' <button type="button" id="tarteaucitronPrivacyUrl" role="link">'; 629 html += ' ' + tarteaucitron.lang.privacyUrl; 630 html += ' </button>'; 631 } 632 633 //html += ' </span>'; 634 //html += '</div>'; 635 html += '</div>'; 636 html += '<div id="tarteaucitronPercentage"></div>'; 637 } 638 639 if (tarteaucitron.parameters.showIcon === true) { 640 html += '<div id="tarteaucitronIcon" class="tarteaucitronIcon' + tarteaucitron.parameters.iconPosition + '">'; 641 html += ' <button type="button" id="tarteaucitronManager" aria-label="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '">'; 642 html += ' <img src="' + (tarteaucitron.parameters.iconSrc ? tarteaucitron.parameters.iconSrc : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGA0lEQVRoge1a207bWBRdBtJwLYZhKDMVmlSK1LxNkPo+ZH6g8B6p5AuALwC+APoFoVLeoT8whPeRSt+CZKmZVu3AiIsRlEtCktGyjy8xzuXYhvahS0JJHJ/4rLP3XnuffcAPfGdQ7mM6jRLSAF4BxqsbewB2lRS2o35mpEQaJcwCyANIdLi1DGBNSWEzqmdHRqRRwjqAJclhtExOSUEP+/xIiDRKhhUWfL7ShTtBuJnqcw+/z4Ql0xNmMEwSSz4kuNIzSgpjSsqYJP/GeE185wYJroedRyiLNEpGLLzzrHSuk+83SgbxvOcyyRaDziWsRVZkSRDinpzPbwVGWIucuohsKynMS47fAQyls/BMSRmKJo3AFhG5wm2N1wF+Zs3zebbFfR0RxrXcJHQlgH+LMW616pR/WiIMEXfW3mtzXyeEGWsjKot8c4TOI98L+iKaR5PS6IUk88RLAO9F8UjrbYoYMOosNavpfmODIiwRXRR/G3ohaWVo1RU/c30jV8ab2mV8qVGzHWBOLyTLZiWs5Rolg/C3ySOi0tXP/k4aEwOwSBKPJs7Rp16ABJTe+p1xVX0It/owqqdDEMRoqd3RFxqDPh20Ig6VEPVC0i5RSCD+6wl6HlW7GksSlUMV11/GrUs5NasFLusDE9ELSVphXemtJwaT/8JyIRvxNNCfBmIiNdR04LII3DSrbe0yjqvyJF/ppptqVlt+MCLCEh/oOkPPP6N38Mb5cnQBGFsEqmXg5j3QMwoMzwGnr4HYbybBq13gZAOom/FO63zdf2qQArCsZrUN2TlJy69eSDKYV+6Q4MpP75ivHzPA53ngaBW4eGuSOt0A/lsGPmXMz0+3TFJcTfFbPfFbfnwlhON+iQhlWmA82CQ4ocQ7c6KcfL3DHuls0yT6Sx4YnLXJDCQOIRRv5yGIJBgP8Sdisj2qubpc5UGJmo+W49ifVmzL8HcpGhQPvZCUKiCliIhEN0tr2OCqHuSA8gwQ/92MkU7gxEmeVqGrTTgpxPXbUrtGWYus0I9thRIraagRQUIDf7Qn4yZhKRiFQIyhfMfUr3yblokVWSJ6k8xSnc7eNN/RjowfCYiFoDUFer1S3gW6JiJ8Nt30EMbEhU+vzSIztuRYjRLsR8IHLjlf7HZ+MrWWEXxNmbvapt4jGSqZRYSkGUetSNTPzHsui5YMQ2ajJUNks6mw4wT54Ok2ShnzzIPCUGshzawCRKy5FqvrTZe0RWzQGvw79m67XZjKmxJrLsICjtZa55gxXy+6F4sYsEtxTqhXdRTLC8ulSDaWoCLsolfN+8YUhOsJV709H7Cudr0LlVEtzqBcN+shEyThdR941OnAbF8pirKJqXyupTRTtQSReiVmXW1j7oBErB0d9xM2WEd5J9ZKYtuR4WKwwBSoORbpGrJ5ZI9lt71irJmGX1px0JYE26uNErawr2zfIcP4OHEKXm66PA3wjpCNEfpJunI4muifPjKvsFCkGjExTq63yxMJsZNMYF/J4HmDC5A3Yq36jy0ClePHVhwuu/b1HSFlEfHD5ZtD1bEK44Qu1mWys6tbWmZyPWckzlPTGiRw/XHCuk+q4Rek+mVrVL/UppwrdDEGNV2kpyuhccgc5Oxm9vWnn+19vJrVpLor0kTUrGacMplb1CfOFyTD4o9uNrHqr2Z+ZMSp1c2XcVSORnh9Q81q3k599ETgkNnjg0nGzi10K7rX+bZpHbrblPcY5A4Zxk2xcjzCvTpd9027Aa0QtouyyrKFRR6D/04DwkFGvHPXM3Qda/Jb4nPgI7hQLVM1q5HIBt2MzQNa57Z1DiiLAGa5Mi+O4Sz3Mpp6laPHO6InII3ITnX1QtI+EOX+m9ZxleOZ/j9PiuKoLi3aqXPuEoSye/Vhkm+LalbLtHhMS0R6zu7aZ3vP2jOjL7QVv4McxhcDnZIelAQibGIbULOapf3PuE1Vs9qeaOTdkVKr00gCQiw4NlBzDvf1Lxx+uP5r3Dgv5KQZRzWn+GRwz8jmDS8itUg7iB6vLuJCF5Uty4A9mVKkFR6MiJDachST/oHvHgD+B4SoUIitpF05AAAAAElFTkSuQmCC') + '" alt="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '">'; 643 html += ' </button>'; 644 html += '</div>'; 645 } 646 647 if (tarteaucitron.parameters.showAlertSmall === true) { 648 html += '<div id="tarteaucitronAlertSmall" class="tarteaucitronAlertSmall' + orientation + '">'; 649 html += ' <button type="button" id="tarteaucitronManager" aria-label="' + tarteaucitron.lang.alertSmall + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.alertSmall + ' ' + tarteaucitron.lang.modalWindow + '">'; 650 html += ' ' + tarteaucitron.lang.alertSmall; 651 html += ' <span id="tarteaucitronDot">'; 652 html += ' <span id="tarteaucitronDotGreen"></span>'; 653 html += ' <span id="tarteaucitronDotYellow"></span>'; 654 html += ' <span id="tarteaucitronDotRed"></span>'; 655 html += ' </span>'; 656 if (tarteaucitron.parameters.cookieslist === true) { 657 html += ' </button><!-- @whitespace'; 658 html += ' --><button type="button" id="tarteaucitronCookiesNumber" aria-expanded="false" aria-controls="tarteaucitronCookiesListContainer">0</button>'; 659 html += ' <div id="tarteaucitronCookiesListContainer">'; 660 if (tarteaucitron.reloadThePage) { 661 html += ' <button type="button" id="tarteaucitronClosePanelCookie" aria-label="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')" title="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')">'; 662 } else { 663 html += ' <button type="button" id="tarteaucitronClosePanelCookie">'; 664 } 665 html += ' ' + tarteaucitron.lang.close; 666 html += ' </button>'; 667 html += ' <div class="tarteaucitronCookiesListMain" id="tarteaucitronCookiesTitle">'; 668 html += ' <span class="tarteaucitronH2" role="heading" aria-level="
vendor: 8,780 bytes, lines 668-825
6682" id="tarteaucitronCookiesNumberBis">0 cookie</span>'; 669 html += ' </div>'; 670 html += ' <div id="tarteaucitronCookiesList"></div>'; 671 html += ' </div>'; 672 } else { 673 html += ' </div>'; 674 } 675 html += '</div>'; 676 } 677 678 tarteaucitron.addInternalScript(tarteaucitron.cdn + 'advertising' + (useMinifiedJS ? '.min' : '') + '.js', '', function () { 679 if (tarteaucitronNoAdBlocker === true || tarteaucitron.parameters.adblocker === false) { 680 681 // create a wrapper container at the same level than tarteaucitron so we can add an aria-hidden when tarteaucitron is opened 682 /*var wrapper = document.createElement('div'); 683 wrapper.id = "tarteaucitronContentWrapper"; 684 685 while (document.body.firstChild) 686 { 687 wrapper.appendChild(document.body.firstChild); 688 } 689 690 // Append the wrapper to the body 691 document.body.appendChild(wrapper);*/ 692 693 div.id = 'tarteaucitronRoot'; 694 if (tarteaucitron.parameters.bodyPosition === 'top') { 695 // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility 696 var bodyFirstChild = body.firstChild; 697 body.insertBefore(div, bodyFirstChild); 698 } 699 else { 700 // Append tarteaucitron: #tarteaucitronRoot last-child of the body 701 body.appendChild(div, body); 702 } 703 704 div.setAttribute('data-nosnippet', 'true'); 705 div.setAttribute('lang', language); 706 div.setAttribute('role', 'region'); 707 div.setAttribute('aria-labelledby', 'tac_title'); 708 709 div.innerHTML = html; 710 711 //ie compatibility 712 var tacRootAvailableEvent; 713 if(typeof(Event) === 'function') { 714 tacRootAvailableEvent = new Event("tac.root_available"); 715 }else if (typeof(document.createEvent) === 'function'){ 716 tacRootAvailableEvent = document.createEvent('Event'); 717 tacRootAvailableEvent.initEvent("tac.root_available", true, true); 718 } 719 //end ie compatibility 720 721 if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacRootAvailableEvent);} 722 723 if (tarteaucitron.job !== undefined) { 724 tarteaucitron.job = tarteaucitron.cleanArray(tarteaucitron.job); 725 for (index = 0; index < tarteaucitron.job.length; index += 1) { 726 tarteaucitron.addService(tarteaucitron.job[index]); 727 } 728 } else { 729 tarteaucitron.job = []; 730 } 731 732 if (tarteaucitron.job.length === 0) { 733 tarteaucitron.userInterface.closeAlert(); 734 } 735 736 tarteaucitron.isAjax = true; 737 738 tarteaucitron.job.push = function (id) { 739 740 // ie <9 hack 741 if (typeof tarteaucitron.job.indexOf === 'undefined') { 742 tarteaucitron.job.indexOf = function (obj, start) { 743 var i, 744 j = this.length; 745 for (i = (start || 0); i < j; i += 1) { 746 if (this[i] === obj) { return i; } 747 } 748 return -1; 749 }; 750 } 751 752 if (tarteaucitron.job.indexOf(id) === -1) { 753 Array.prototype.push.call(this, id); 754 } 755 tarteaucitron.launch[id] = false; 756 tarteaucitron.addService(id); 757 }; 758 759 if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') { 760 tarteaucitron.userInterface.openPanel(); 761 } 762 763 tarteaucitron.cookie.number(); 764 setInterval(tarteaucitron.cookie.number, 60000); 765 } 766 }, tarteaucitron.parameters.adblocker); 767 768 if (tarteaucitron.parameters.adblocker === true) { 769 setTimeout(function () { 770 if (tarteaucitronNoAdBlocker === false) { 771 html = '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + ' tarteaucitron-display-block" role="alert" aria-live="polite">'; 772 html += ' <p id="tarteaucitronDisclaimerAlert">'; 773 html += ' ' + tarteaucitron.lang.adblock + '<br/>'; 774 html += ' <strong>' + tarteaucitron.lang.adblock_call + '</strong>'; 775 html += ' </p>'; 776 html += ' <button type="button" class="tarteaucitronCTAButton" id="tarteaucitronCTAButton">'; 777 html += ' ' + tarteaucitron.lang.reload; 778 html += ' </button>'; 779 html += '</div>'; 780 html += '<div role="heading" aria-level="1" id="tac_title" class="tac_visually-hidden">' + tarteaucitron.lang.title + '</div>'; 781 html += '<div id="tarteaucitronPremium"></div>'; 782 783 div.id = 'tarteaucitronRoot'; 784 if (tarteaucitron.parameters.bodyPosition === 'top') { 785 // Prepend tarteaucitron: #tarteaucitronRoot first-child of the body for better accessibility 786 var bodyFirstChild = body.firstChild; 787 body.insertBefore(div, bodyFirstChild); 788 } 789 else { 790 // Append tarteaucitron: #tarteaucitronRoot last-child of the body 791 body.appendChild(div, body); 792 } 793 794 div.setAttribute('data-nosnippet', 'true'); 795 div.setAttribute('lang', language); 796 div.setAttribute('role', 'region'); 797 div.setAttribute('aria-labelledby', 'tac_title'); 798 799 div.innerHTML = html; 800 } 801 }, 1500); 802 } 803 if(tarteaucitron.parameters.closePopup === true){ 804 setTimeout(function() { 805 var closeElement = document.getElementById('tarteaucitronAlertBig'), 806 closeButton = document.createElement('button'); 807 if (closeElement) { 808 closeButton.innerHTML = '<span aria-hidden="true">X</span><span class="tac_visually-hidden">' + tarteaucitron.lang.closeBanner + '</span>'; 809 closeButton.setAttribute('id', 'tarteaucitronCloseCross'); 810 closeElement.insertAdjacentElement('beforeend', closeButton); 811 } 812 }, 100); 813 } 814 815 if(tarteaucitron.parameters.groupServices === true) { 816 var tac_group_style = document.createElement('style'); 817 tac_group_style.innerHTML = '.tarteaucitronTitle{display:none}'; 818 document.head.appendChild(tac_group_style); 819 var cats = document.querySelectorAll('[id^="tarteaucitronServicesTitle_"]') 820 Array.prototype.forEach.call(cats, function(item) { 821 var cat = item.getAttribute('id').replace(/^(tarteaucitronServicesTitle_)/, ""); 822 if (cat !== "mandatory") { 823 var html = ''; 824 html += '<li class="tarteaucitronLine">'; 825 html += ' <div class="tarteaucitronName">';
826 html += ' <span class="tarteaucitronH3" role="heading" aria-level="2">'+tarteaucitron.lang[cat].title+'</span>'; 827 html += ' <span>'+tarteaucitron.lang[cat].details+'</span>'; 828 html += ' <button type="button" aria-expanded="false" class="tarteaucitron-toggle-group" id="tarteaucitron-toggle-group-'+cat+'">'+tarteaucitron.lang.alertSmall+' ('+document.getElementById("tarteaucitronServices_"+cat).childElementCount+')</button>'; 829 html += ' </div>'; 830 html += ' <div class="tarteaucitronAsk" id="tarteaucitron-group-'+cat+'">'; 831 html += ' <button type="button" aria-label="' + tarteaucitron.lang.allow + ' ' + tarteaucitron.lang[cat].title + '" class="tarteaucitronAllow" id="tarteaucitron-accept-group-'+cat+'">'; 832 html += ' <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow; 833 html += ' </button> '; 834 html += ' <button type="button" aria-label="' + tarteaucitron.lang.deny + ' ' + tarteaucitron.lang[cat].title + '" class="tarteaucitronDeny" id="tarteaucitron-reject-group-'+cat+'">'; 835 html += ' <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny; 836 html += ' </button>'; 837 html += ' </div>'; 838 html += '</li>'; 839 var ul = document.createElement('ul'); 840 ul.innerHTML = html; 841 item.insertBefore(ul, item.querySelector('#tarteaucitronServices_'+cat+'')); 842 document.querySelector('#tarteaucitronServices_' + cat).style.display = 'none'; 843 tarteaucitron.addClickEventToId("tarteaucitron-toggle-group-" + cat, function () { 844 tarteaucitron.userInterface.toggle('tarteaucitronServices_' + cat); 845 if (document.getElementById('tarteaucitronServices_' + cat).style.display == 'block') { 846 tarteaucitron.userInterface.addClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded'); 847 document.getElementById('tarteaucitron-toggle-group-'+cat).setAttribute('aria-expanded', 'true'); 848 } else { 849 tarteaucitron.userInterface.removeClass('tarteaucitronServicesTitle_' + cat, 'tarteaucitronIsExpanded'); 850 document.getElementById('tarteaucitron-toggle-group-'+cat).setAttribute('aria-expanded', 'false'); 851 } 852 //tarteaucitron.initEvents.resizeEvent(); 853 }); 854 tarteaucitron.addClickEventToId("tarteaucitron-accept-group-" + cat, function () { 855 tarteaucitron.userInterface.respondAll(true, cat); 856 }); 857 tarteaucitron.addClickEventToId("tarteaucitron-reject-group-" + cat, function () { 858 tarteaucitron.userInterface.respondAll(false, cat); 859 }); 860 } 861 }); 862 } 863 864 // add info about the services on the main banner 865 if (tarteaucitron.parameters.partnersList === true && (tarteaucitron.parameters.orientation === "middle" || tarteaucitron.parameters.orientation === "popup")) { 866 setTimeout(function() { 867 var liPartners = ""; 868 var tarteaucitronPartnersCat = []; 869 tarteaucitron.job.forEach(function (id) { 870 if (tarteaucitronPartnersCat[tarteaucitron.services[id].type] === undefined) { 871 tarteaucitronPartnersCat[tarteaucitron.services[id].type] = true; 872 liPartners += "<li>" + tarteaucitron.lang[tarteaucitron.services[id].type].title + "</li>"; 873 } 874 }); 875 var tacPartnersInfoParent = document.getElementById('tarteaucitronDisclaimerAlert'); 876 if (tacPartnersInfoParent !== null) { 877 tacPartnersInfoParent.insertAdjacentHTML('beforeend', '<div class="tarteaucitronPartnersList"><b>
877' + tarteaucitron.lang.ourpartners + ' (' + tarteaucitron.job.length + ')</b> <ul>' + liPartners + '</ul></div>'); 878 } 879 }, 100); 880 } 881 882 // add a save button 883 setTimeout(function() { 884 var tacSaveButtonParent = document.getElementById('tarteaucitronServices'); 885 if (tacSaveButtonParent !== null) { 886 tacSaveButtonParent.insertAdjacentHTML('beforeend', '<div id="tarteaucitronSave"><button class="tarteaucitronAllow" id="tarteaucitronSaveButton">' + tarteaucitron.lang.save + '</button></div>'); 887 } 888 }, 100); 889 890 tarteaucitron.userInterface.color("", true); 891 892 // add a little timeout to be sure everything is accessible 893 setTimeout(function () { 894 895 // Setup events 896 tarteaucitron.addClickEventToId("tarteaucitronCloseCross", function () { 897 tarteaucitron.userInterface.closeAlert(); 898 }); 899 tarteaucitron.addClickEventToId("tarteaucitronPersonalize", function () {
900 tarteaucitron.userInterface.openPanel(); 901 }); 902 tarteaucitron.addClickEventToId("tarteaucitronPersonalize2", function () { 903 tarteaucitron.userInterface.respondAll(true); 904 }); 905 tarteaucitron.addClickEventToId("tarteaucitronManager", function () { 906 tarteaucitron.userInterface.openPanel(); 907 }); 908 tarteaucitron.addClickEventToId("tarteaucitronBack", function () { 909 tarteaucitron.userInterface.closePanel(); 910 }); 911 tarteaucitron.addClickEventToId("tarteaucitronClosePanel", function () { 912 tarteaucitron.userInterface.closePanel(); 913 }); 914 tarteaucitron.addClickEventToId("tarteaucitronClosePanelCookie", function () { 915 tarteaucitron.userInterface.closePanel(); 916 }); 917 tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrl", function () { 918 document.location = tarteaucitron.parameters.privacyUrl; 919 }); 920 tarteaucitron.addClickEventToId("tarteaucitronPrivacyUrlDialog", function () { 921 document.location = tarteaucitron.parameters.privacyUrl; 922 }); 923 tarteaucitron.addClickEventToId("tarteaucitronCookiesNumber", function () { 924 tarteaucitron.userInterface.toggleCookiesList(); 925 }); 926 tarteaucitron.addClickEventToId("tarteaucitronAllAllowed", function () { 927 tarteaucitron.userInterface.respondAll(true); 928 }); 929 tarteaucitron.addClickEventToId("tarteaucitronAllDenied", function () { 930 tarteaucitron.userInterface.respondAll(false); 931 }); 932 tarteaucitron.addClickEventToId("tarteaucitronAllDenied2", function () { 933 tarteaucitron.userInterface.respondAll(false, '', true); 934 if (tarteaucitron.reloadThePage === true) { 935 window.location.reload(); 936 } 937 }); 938 tarteaucitron.addClickEventToId("tarteaucitronCloseAlert", function () {
vendor: 38,815 bytes, lines 939-1701
939 tarteaucitron.userInterface.openPanel(); 940 }); 941 tarteaucitron.addClickEventToId("tarteaucitronCTAButton", function () { 942 location.reload(); 943 }); 944 tarteaucitron.addClickEventToId("tarteaucitronSaveButton", function () { 945 var timeoutSaveButton = 0; 946 tarteaucitron.job.forEach(function(id) { 947 if (tarteaucitron.state[id] !== true && tarteaucitron.state[id] !== false) { 948 timeoutSaveButton = 500; 949 tarteaucitron.setConsent(id, false); 950 } 951 }); 952 setTimeout(tarteaucitron.userInterface.closePanel, timeoutSaveButton); 953 }); 954 var toggleBtns = document.getElementsByClassName("catToggleBtn"), i; 955 for (i = 0; i < toggleBtns.length; i++) { 956 toggleBtns[i].dataset.index = i; 957 tarteaucitron.addClickEventToElement(toggleBtns[i], function () { 958 if(!tarteaucitron.parameters.showDetailsOnClick) return false; 959 tarteaucitron.userInterface.toggle('tarteaucitronDetails' + cat[this.dataset.index], 'tarteaucitronInfoBox'); 960 if (document.getElementById('tarteaucitronDetails' + cat[this.dataset.index]).style.display === 'block') { 961 this.setAttribute('aria-expanded', 'true'); 962 } else { 963 this.setAttribute('aria-expanded', 'false'); 964 } 965 return false; 966 }); 967 } 968 969 // accessibility: on click on "Allow" in the site (not in TAC module), move focus to the loaded service's parent 970 var allowBtnsInSite = document.querySelectorAll(".tac_activate .tarteaucitronAllow"); 971 for (i = 0; i < allowBtnsInSite.length; i++) { 972 tarteaucitron.addClickEventToElement(allowBtnsInSite[i], function () { 973 if(this.closest('.tac_activate') !== null && this.closest('.tac_activate').parentNode !== null) { 974 this.closest('.tac_activate').parentNode.setAttribute("tabindex", "-1"); 975 this.closest('.tac_activate').parentNode.focus(); 976 } 977 }); 978 } 979 980 var allowBtns = document.getElementsByClassName("tarteaucitronAllow"); 981 for (i = 0; i < allowBtns.length; i++) { 982 tarteaucitron.addClickEventToElement(allowBtns[i], function () { 983 tarteaucitron.userInterface.respond(this, true); 984 }); 985 } 986 var denyBtns = document.getElementsByClassName("tarteaucitronDeny"); 987 for (i = 0; i < denyBtns.length; i++) { 988 tarteaucitron.addClickEventToElement(denyBtns[i], function () { 989 tarteaucitron.userInterface.respond(this, false); 990 }); 991 } 992 if(tarteaucitron.events.load) { 993 tarteaucitron.events.load(); 994 } 995 }, 500); 996 997 }); 998 }); 999 }, 1000 "addService": function (serviceId) { 1001 "use strict"; 1002 var html = '', 1003 s = tarteaucitron.services, 1004 service = s[serviceId]; 1005 1006 if (tarteaucitron.parameters.alwaysNeedConsent === true) { 1007 service.needConsent = true; 1008 } 1009 1010 var cookie = tarteaucitron.cookie.read(), 1011 hostname = document.location.hostname, 1012 hostRef = document.referrer.split('/')[2], 1013 isNavigating = (hostRef === hostname && window.location.href !== tarteaucitron.parameters.privacyUrl), 1014 isAutostart = (!service.needConsent), 1015 isWaiting = (cookie.indexOf(service.key + '=wait') >= 0), 1016 isDenied = (cookie.indexOf(service.key + '=false') >= 0), 1017 isAllowed = ((cookie.indexOf(service.key + '=true') >= 0) || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)), 1018 isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0), 1019 isDNTRequested = (navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1" || window.doNotTrack === "1"), 1020 currentStatus = (isAllowed) ? tarteaucitron.lang.allowed : tarteaucitron.lang.disallowed, 1021 state = (undefined !== service.defaultState) ? service.defaultState : 1022 (undefined !== tarteaucitron.parameters.serviceDefaultState ? tarteaucitron.parameters.serviceDefaultState : 'wait'); 1023 1024 1025 if (tarteaucitron.added[service.key] !== true) { 1026 tarteaucitron.added[service.key] = true; 1027 1028 html += '<li id="' + service.key + 'Line" class="tarteaucitronLine">'; 1029 html += ' <div class="tarteaucitronName">'; 1030 html += ' <span class="tarteaucitronH3" role="heading" aria-level="3">' + service.name + '</span>'; 1031 html += ' <div class="tarteaucitronStatusInfo">'; 1032 html += ' <span class="tacCurrentStatus" id="tacCurrentStatus' + service.key + '">'+currentStatus+'</span>'; 1033 html += ' <span class="tarteaucitronReadmoreSeparator"> - </span>'; 1034 html += ' <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span>'; 1035 html += ' </div>'; 1036 if (tarteaucitron.parameters.moreInfoLink == true) { 1037 1038 var link = 'https://tarteaucitron.io/service/' + service.key + '/'; 1039 if (service.readmoreLink !== undefined && service.readmoreLink !== '') { 1040 link = service.readmoreLink; 1041 } 1042 if (tarteaucitron.parameters.readmoreLink !== undefined && tarteaucitron.parameters.readmoreLink !== '') { 1043 link = tarteaucitron.parameters.readmoreLink; 1044 } 1045 html += ' <a href="' + link + '" target="_blank" rel="noreferrer noopener nofollow" title="' + tarteaucitron.lang.more + ' : '+ tarteaucitron.lang.cookieDetail + ' ' + service.name + ' ' + tarteaucitron.lang.ourSite + ' ' + tarteaucitron.lang.newWindow +'" class="tarteaucitronReadmoreInfo">' + tarteaucitron.lang.more + '</a>'; 1046 html += ' <span class="tarteaucitronReadmoreSeparator"> - </span>'; 1047 html += ' <a href="' + service.uri + '" target="_blank" rel="noreferrer noopener" title="' + tarteaucitron.lang.source + ' ' + service.name + ' ' + tarteaucitron.lang.newWindow + '" class="tarteaucitronReadmoreOfficial">' + tarteaucitron.lang.source + '</a>'; 1048 } 1049 1050 html += ' </div>'; 1051 html += ' <div class="tarteaucitronAsk">'; 1052 html += ' <button type="button" aria-label="' + tarteaucitron.lang.allow + ' ' + service.name + '" id="' + service.key + 'Allowed" class="tarteaucitronAllow">'; 1053 html += ' <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow; 1054 html += ' </button> '; 1055 html += ' <button type="button" aria-label="' + tarteaucitron.lang.deny + ' ' + service.name + '" id="' + service.key + 'Denied" class="tarteaucitronDeny">'; 1056 html += ' <span class="tarteaucitronCross" aria-hidden="true"></span> ' + tarteaucitron.lang.deny; 1057 html += ' </button>'; 1058 html += ' </div>'; 1059 html += '</li>'; 1060 1061 tarteaucitron.userInterface.css('tarteaucitronServicesTitle_' + service.type, 'display', 'block'); 1062 1063 if (document.getElementById('tarteaucitronServices_' + service.type) !== null) { 1064 document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html; 1065 } 1066 1067 tarteaucitron.userInterface.css('tarteaucitronNoServicesTitle', 'display', 'none'); 1068 1069 tarteaucitron.userInterface.order(service.type); 1070 1071 tarteaucitron.addClickEventToId(service.key + 'Allowed', function () { 1072 tarteaucitron.userInterface.respond(this, true); 1073 }); 1074 1075 tarteaucitron.addClickEventToId(service.key + 'Denied', function () { 1076 tarteaucitron.userInterface.respond(this, false); 1077 }); 1078 } 1079 1080 tarteaucitron.pro('!' + service.key + '=' + isAllowed); 1081 1082 // allow by default for non EU 1083 if (isResponded === false && tarteaucitron.user.bypass === true) { 1084 isAllowed = true; 1085 tarteaucitron.cookie.create(service.key, true); 1086 } 1087 1088 if ((!isResponded && (isAutostart || (isNavigating && isWaiting)) && !tarteaucitron.highPrivacy) || isAllowed) { 1089 if (!isAllowed || (!service.needConsent && cookie.indexOf(service.key + '=false') < 0)) { 1090 tarteaucitron.cookie.create(service.key, true); 1091 } 1092 if (tarteaucitron.launch[service.key] !== true) { 1093 tarteaucitron.launch[service.key] = true; 1094 if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.js(); } 1095 tarteaucitron.sendEvent(service.key + '_loaded'); 1096 } 1097 tarteaucitron.state[service.key] = true; 1098 tarteaucitron.userInterface.color(service.key, true); 1099 } else if (isDenied) { 1100 if (typeof service.fallback === 'function') { 1101 if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.fallback(); } 1102 } 1103 tarteaucitron.state[service.key] = false; 1104 tarteaucitron.userInterface.color(service.key, false); 1105 } else if (!isResponded && isDNTRequested && tarteaucitron.handleBrowserDNTRequest) { 1106 tarteaucitron.cookie.create(service.key, 'false'); 1107 if (typeof service.fallback === 'function') { 1108 if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { service.fallback(); } 1109 } 1110 tarteaucitron.state[service.key] = false; 1111 tarteaucitron.userInterface.color(service.key, false); 1112 } else if (!isResponded) { 1113 tarteaucitron.cookie.create(service.key, state); 1114 if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + service.key + "_") < 0) { 1115 if(true === state && typeof service.js === 'function') { 1116 service.js(); 1117 tarteaucitron.sendEvent(service.key + '_loaded'); 1118 } else if (typeof service.fallback === 'function') { 1119 service.fallback(); 1120 } 1121 } 1122 1123 tarteaucitron.userInterface.color(service.key, state); 1124 1125 if( 'wait' === state ) { 1126 tarteaucitron.userInterface.openAlert(); 1127 } 1128 } 1129 1130 tarteaucitron.cookie.checkCount(service.key); 1131 tarteaucitron.sendEvent(service.key + '_added'); 1132 }, 1133 "sendEvent" : function(event_key) { 1134 if(event_key !== undefined) { 1135 //ie compatibility 1136 var send_event_item; 1137 if(typeof(Event) === 'function') { 1138 send_event_item = new Event(event_key); 1139 }else if (typeof(document.createEvent) === 'function'){ 1140 send_event_item = document.createEvent('Event'); 1141 send_event_item.initEvent(event_key, true, true); 1142 } 1143 //end ie compatibility 1144 1145 document.dispatchEvent(send_event_item); 1146 } 1147 }, 1148 "cleanArray": function cleanArray(arr) { 1149 "use strict"; 1150 var i, 1151 len = arr.length, 1152 out = [], 1153 obj = {}, 1154 s = tarteaucitron.services; 1155 1156 for (i = 0; i < len; i += 1) { 1157 if (!obj[arr[i]]) { 1158 obj[arr[i]] = {}; 1159 if (tarteaucitron.services[arr[i]] !== undefined) { 1160 out.push(arr[i]); 1161 } 1162 } 1163 } 1164 1165 out = out.sort(function (a, b) { 1166 if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; } 1167 if (s[a].type + s[a].key < s[b].type + s[b].key) { return -1; } 1168 return 0; 1169 }); 1170 1171 return out; 1172 }, 1173 "setConsent": function (id, status) { 1174 if (status === true) { 1175 tarteaucitron.userInterface.respond(document.getElementById(id + 'Allowed'), true); 1176 } else if (status === false) { 1177 tarteaucitron.userInterface.respond(document.getElementById(id + 'Denied'), false); 1178 } 1179 }, 1180 "userInterface": { 1181 "css": function (id, property, value) { 1182 "use strict"; 1183 if (document.getElementById(id) !== null) { 1184 1185 if (property == "display" && value == "none" && (id == "tarteaucitron" || id == "tarteaucitronBack" || id == "tarteaucitronAlertBig")) { 1186 document.getElementById(id).style["opacity"] = "0"; 1187 1188 /*setTimeout(function() {*/document.getElementById(id).style[property] = value;/*}, 200);*/ 1189 } else { 1190 1191 document.getElementById(id).style[property] = value; 1192 1193 if (property == "display" && value == "block" && (id == "tarteaucitron" || id == "tarteaucitronAlertBig")) { 1194 document.getElementById(id).style["opacity"] = "1"; 1195 } 1196 1197 if (property == "display" && value == "block" && id == "tarteaucitronBack") { 1198 document.getElementById(id).style["opacity"] = "0.7"; 1199 } 1200 1201 if (property == "display" && value == "block" && id == "tarteaucitronAlertBig" && (tarteaucitron.parameters.orientation == "middle"|| tarteaucitron.parameters.orientation == "popup")) { 1202 tarteaucitron.userInterface.focusTrap('tarteaucitronAlertBig'); 1203 } 1204 } 1205 } 1206 }, 1207 "addClass": function (id, className) { 1208 "use strict"; 1209 if (document.getElementById(id) !== null && document.getElementById(id).classList !== undefined) { 1210 document.getElementById(id).classList.add(className); 1211 } 1212 }, 1213 "removeClass": function (id, className) { 1214 "use strict"; 1215 if (document.getElementById(id) !== null && document.getElementById(id).classList !== undefined) { 1216 document.getElementById(id).classList.remove(className); 1217 } 1218 }, 1219 "respondAll": function (status, type, allowSafeAnalytics) { 1220 "use strict"; 1221 var s = tarteaucitron.services, 1222 service, 1223 key, 1224 index = 0; 1225 1226 for (index = 0; index < tarteaucitron.job.length; index += 1) { 1227 1228 if (typeof type !== 'undefined' && type !== '' && s[tarteaucitron.job[index]].type !== type) { 1229 continue; 1230 } 1231 1232 if (allowSafeAnalytics && typeof s[tarteaucitron.job[index]].safeanalytic !== "undefined" && s[tarteaucitron.job[index]].safeanalytic === true) { 1233 continue; 1234 } 1235 1236 service = s[tarteaucitron.job[index]]; 1237 key = service.key; 1238 if (tarteaucitron.state[key] !== status) { 1239 if (status === false && tarteaucitron.launch[key] === true) { 1240 tarteaucitron.reloadThePage = true; 1241 if (tarteaucitron.checkIfExist('tarteaucitronClosePanel')) { 1242 var ariaCloseValue = document.getElementById('tarteaucitronClosePanel').textContent.trim() + ' (' + tarteaucitron.lang.reload + ')'; 1243 document.getElementById('tarteaucitronClosePanel').setAttribute("aria-label", ariaCloseValue); 1244 document.getElementById('tarteaucitronClosePanel').setAttribute("title", ariaCloseValue); 1245 } 1246 } 1247 if (tarteaucitron.launch[key] !== true && status === true) { 1248 1249 tarteaucitron.pro('!' + key + '=engage'); 1250 1251 tarteaucitron.launch[key] = true; 1252 if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); } 1253 tarteaucitron.sendEvent(key + '_loaded'); 1254 } 1255 var itemStatusElem = document.getElementById('tacCurrentStatus'+key); 1256 tarteaucitron.state[key] = status; 1257 tarteaucitron.cookie.create(key, status); 1258 tarteaucitron.userInterface.color(key, status); 1259 if (status == true) { 1260 itemStatusElem.innerHTML = tarteaucitron.lang.allowed; 1261 tarteaucitron.sendEvent(key + '_allowed'); 1262 } else { 1263 itemStatusElem.innerHTML = tarteaucitron.lang.disallowed; 1264 tarteaucitron.sendEvent(key + '_disallowed'); 1265 } 1266 } 1267 } 1268 }, 1269 "respond": function (el, status) { 1270 "use strict"; 1271 if (el.id === '') { 1272 return; 1273 } 1274 var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), ''); 1275 1276 if (key.substring(0, 13) === 'tarteaucitron' || key === '') {return;} 1277 1278 // return if same state 1279 if (tarteaucitron.state[key] === status) { 1280 return; 1281 } 1282 1283 if (status === false && tarteaucitron.launch[key] === true) { 1284 tarteaucitron.reloadThePage = true; 1285 if (tarteaucitron.checkIfExist('tarteaucitronClosePanel')) { 1286 var ariaCloseValue = document.getElementById('tarteaucitronClosePanel').textContent.trim() + ' (' + tarteaucitron.lang.reload + ')'; 1287 document.getElementById('tarteaucitronClosePanel').setAttribute("aria-label", ariaCloseValue); 1288 document.getElementById('tarteaucitronClosePanel').setAttribute("title", ariaCloseValue); 1289 } 1290 } 1291 1292 // if not already launched... launch the service 1293 if (status === true) { 1294 if (tarteaucitron.launch[key] !== true) { 1295 1296 tarteaucitron.pro('!' + key + '=engage'); 1297 1298 tarteaucitron.launch[key] = true; 1299 if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); } 1300 tarteaucitron.sendEvent(key + '_loaded'); 1301 } 1302 } 1303 var itemStatusElem = document.getElementById('tacCurrentStatus'+key); 1304 tarteaucitron.state[key] = status; 1305 tarteaucitron.cookie.create(key, status); 1306 tarteaucitron.userInterface.color(key, status); 1307 if (status == true) { 1308 itemStatusElem.innerHTML = tarteaucitron.lang.allowed; 1309 tarteaucitron.sendEvent(key + '_allowed'); 1310 } else { 1311 itemStatusElem.innerHTML = tarteaucitron.lang.disallowed; 1312 tarteaucitron.sendEvent(key + '_disallowed'); 1313 } 1314 }, 1315 "color": function (key, status) { 1316 "use strict"; 1317 var c = 'tarteaucitron', 1318 nbDenied = 0, 1319 nbPending = 0, 1320 nbAllowed = 0, 1321 sum = tarteaucitron.job.length, 1322 index, 1323 s = tarteaucitron.services; 1324 1325 if (key !== "") { 1326 1327 if (status === true) { 1328 tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsAllowed'); 1329 tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsDenied'); 1330 document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'true'); 1331 document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'false'); 1332 } else if (status === false) { 1333 tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsAllowed'); 1334 tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsDenied'); 1335 document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'false'); 1336 document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'true'); 1337 } else { 1338 document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'false'); 1339 document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'false'); 1340 } 1341 1342 // check if all services are allowed 1343 var sumToRemove = 0; 1344 for (index = 0; index < sum; index += 1) { 1345 1346 if (typeof s[tarteaucitron.job[index]].safeanalytic !== "undefined" && s[tarteaucitron.job[index]].safeanalytic === true) { 1347 sumToRemove += 1; 1348 continue; 1349 } 1350 1351 if (tarteaucitron.state[tarteaucitron.job[index]] === false) { 1352 nbDenied += 1; 1353 } else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) { 1354 nbPending += 1; 1355 } else if (tarteaucitron.state[tarteaucitron.job[index]] === true) { 1356 nbAllowed += 1; 1357 } 1358 } 1359 sum -= sumToRemove; 1360 1361 tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%'); 1362 tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%'); 1363 tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%'); 1364 1365 if (nbDenied === 0 && nbPending === 0) { 1366 tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected'); 1367 tarteaucitron.userInterface.addClass(c + 'AllAllowed', c + 'IsSelected'); 1368 1369 tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsAllowed'); 1370 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied'); 1371 1372 document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false'); 1373 document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'true'); 1374 1375 } else if (nbAllowed === 0 && nbPending === 0) { 1376 tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected'); 1377 tarteaucitron.userInterface.addClass(c + 'AllDenied', c + 'IsSelected'); 1378 1379 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed'); 1380 tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsDenied'); 1381 1382 document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'true'); 1383 document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false'); 1384 1385 } else { 1386 tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected'); 1387 tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected'); 1388 1389 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed'); 1390 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied'); 1391 1392 document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false'); 1393 document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false'); 1394 } 1395 1396 // close the alert if all service have been reviewed 1397 if (nbPending === 0) { 1398 tarteaucitron.userInterface.closeAlert(); 1399 } 1400 1401 if (tarteaucitron.services[key].cookies.length > 0 && status === false) { 1402 tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies); 1403 } 1404 1405 if (status === true) { 1406 if (document.getElementById('tacCL' + key) !== null) { 1407 document.getElementById('tacCL' + key).innerHTML = '...'; 1408 } 1409 setTimeout(function () { 1410 tarteaucitron.cookie.checkCount(key); 1411 }, 2500); 1412 } else { 1413 tarteaucitron.cookie.checkCount(key); 1414 } 1415 1416 } 1417 1418 // groups 1419 var cats = document.querySelectorAll('[id^="tarteaucitronServicesTitle_"]') 1420 Array.prototype.forEach.call(cats, function(item) { 1421 var cat = item.getAttribute('id').replace(/^(tarteaucitronServicesTitle_)/, ""), 1422 total = document.getElementById("tarteaucitronServices_"+cat).childElementCount; 1423 var doc = document.getElementById("tarteaucitronServices_"+cat), 1424 groupdenied = 0, 1425 groupallowed = 0; 1426 for (var ii = 0; ii < doc.children.length; ii++) { 1427 if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsDenied") { 1428 groupdenied++; 1429 } 1430 if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsAllowed") { 1431 groupallowed++; 1432 } 1433 } 1434 if (total === groupallowed) { 1435 tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied'); 1436 tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed'); 1437 1438 if (document.getElementById('tarteaucitron-reject-group-'+cat)) { 1439 document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false'); 1440 document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'true'); 1441 } 1442 } 1443 if (total === groupdenied) { 1444 tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied'); 1445 tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed'); 1446 1447 if (document.getElementById('tarteaucitron-reject-group-'+cat)) { 1448 document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'true'); 1449 document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false'); 1450 } 1451 } 1452 if (total !== groupdenied && total !== groupallowed) { 1453 tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied'); 1454 tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed'); 1455 1456 if (document.getElementById('tarteaucitron-reject-group-'+cat)) { 1457 document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false'); 1458 document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false'); 1459 } 1460 } 1461 groupdenied = 0; 1462 groupallowed = 0; 1463 }); 1464 1465 }, 1466 "openPanel": function () { 1467 "use strict"; 1468 1469 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block'); 1470 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); 1471 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); 1472 1473 document.getElementById('tarteaucitronClosePanel').focus(); 1474 if (document.getElementsByTagName('body')[0].classList !== undefined) { 1475 document.getElementsByTagName('body')[0].classList.add('tarteaucitron-modal-open'); 1476 } 1477 tarteaucitron.userInterface.focusTrap('tarteaucitron'); 1478 tarteaucitron.userInterface.jsSizing('main'); 1479 1480 //ie compatibility 1481 var tacOpenPanelEvent; 1482 if(typeof(Event) === 'function') { 1483 tacOpenPanelEvent = new Event("tac.open_panel"); 1484 }else if (typeof(document.createEvent) === 'function'){ 1485 tacOpenPanelEvent = document.createEvent('Event'); 1486 tacOpenPanelEvent.initEvent("tac.open_panel", true, true); 1487 } 1488 //end ie compatibility 1489 1490 if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacOpenPanelEvent);} 1491 }, 1492 "closePanel": function () { 1493 "use strict"; 1494 1495 if (document.location.hash === tarteaucitron.hashtag) { 1496 if (window.history) { 1497 window.history.replaceState('', document.title, window.location.pathname + window.location.search); 1498 } else { 1499 document.location.hash = ''; 1500 } 1501 } 1502 if (tarteaucitron.checkIfExist('tarteaucitron')) { 1503 // accessibility: manage focus on close panel 1504 if (tarteaucitron.checkIfExist('tarteaucitronCloseAlert')) { 1505 document.getElementById('tarteaucitronCloseAlert').focus(); 1506 } else if (tarteaucitron.checkIfExist('tarteaucitronManager')) { 1507 document.getElementById('tarteaucitronManager').focus(); 1508 } else if (tarteaucitron.customCloserId && tarteaucitron.checkIfExist(tarteaucitron.customCloserId)) { 1509 document.getElementById(tarteaucitron.customCloserId).focus(); 1510 } 1511 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 1512 } 1513 1514 if (tarteaucitron.checkIfExist('tarteaucitronCookiesListContainer') && tarteaucitron.checkIfExist('tarteaucitronCookiesNumber')) { 1515 // accessibility: manage focus on close cookies list 1516 document.getElementById('tarteaucitronCookiesNumber').focus(); 1517 document.getElementById('tarteaucitronCookiesNumber').setAttribute("aria-expanded", "false"); 1518 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); 1519 } 1520 1521 tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) { 1522 elem.style.display = 'none'; 1523 }, true); 1524 1525 if (tarteaucitron.reloadThePage === true) { 1526 window.location.reload(); 1527 } else { 1528 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none'); 1529 } 1530 if (document.getElementsByTagName('body')[0].classList !== undefined) { 1531 document.getElementsByTagName('body')[0].classList.remove('tarteaucitron-modal-open'); 1532 } 1533 1534 //ie compatibility 1535 var tacClosePanelEvent; 1536 if(typeof(Event) === 'function') { 1537 tacClosePanelEvent = new Event("tac.close_panel"); 1538 }else if (typeof(document.createEvent) === 'function'){ 1539 tacClosePanelEvent = document.createEvent('Event'); 1540 tacClosePanelEvent.initEvent("tac.close_panel", true, true); 1541 } 1542 //end ie compatibility 1543 1544 if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacClosePanelEvent);} 1545 }, 1546 "focusTrap": function(parentElement) { 1547 "use strict"; 1548 1549 var focusableEls, 1550 firstFocusableEl, 1551 lastFocusableEl, 1552 filtered; 1553 1554 focusableEls = document.getElementById(parentElement).querySelectorAll('a[href], button'); 1555 filtered = []; 1556 1557 // get only visible items 1558 for (var i = 0, max = focusableEls.length; i < max; i++) { 1559 if (focusableEls[i].offsetHeight > 0) { 1560 filtered.push(focusableEls[i]); 1561 } 1562 } 1563 1564 firstFocusableEl = filtered[0]; 1565 lastFocusableEl = filtered[filtered.length - 1]; 1566 1567 //loop focus inside tarteaucitron 1568 document.getElementById(parentElement).addEventListener("keydown", function (evt) { 1569 1570 if ( evt.key === 'Tab' || evt.keyCode === 9 ) { 1571 1572 if ( evt.shiftKey ) /* shift + tab */ { 1573 if (document.activeElement === firstFocusableEl) { 1574 lastFocusableEl.focus(); 1575 evt.preventDefault(); 1576 } 1577 } else /* tab */ { 1578 if (document.activeElement === lastFocusableEl) { 1579 firstFocusableEl.focus(); 1580 evt.preventDefault(); 1581 } 1582 } 1583 } 1584 }) 1585 }, 1586 "openAlert": function () { 1587 "use strict"; 1588 var c = 'tarteaucitron'; 1589 tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block'); 1590 tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none'); 1591 tarteaucitron.userInterface.css(c + 'Icon', 'display', 'none'); 1592 tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'block'); 1593 tarteaucitron.userInterface.addClass(c + 'Root', 'tarteaucitronBeforeVisible'); 1594 1595 //ie compatibility 1596 var tacOpenAlertEvent; 1597 if(typeof(Event) === 'function') { 1598 tacOpenAlertEvent = new Event("tac.open_alert"); 1599 }else if (typeof(document.createEvent) === 'function'){ 1600 tacOpenAlertEvent = document.createEvent('Event'); 1601 tacOpenAlertEvent.initEvent("tac.open_alert", true, true); 1602 } 1603 //end ie compatibility 1604 1605 if (document.getElementById('tarteaucitronAlertBig') !== null && tarteaucitron.parameters.orientation === 'middle') { 1606 document.getElementById('tarteaucitronAlertBig').focus(); 1607 } 1608 1609 if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacOpenAlertEvent);} 1610 }, 1611 "closeAlert": function () { 1612 "use strict"; 1613 var c = 'tarteaucitron'; 1614 tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none'); 1615 tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block'); 1616 tarteaucitron.userInterface.css(c + 'Icon', 'display', 'block'); 1617 tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'none'); 1618 tarteaucitron.userInterface.removeClass(c + 'Root', 'tarteaucitronBeforeVisible'); 1619 tarteaucitron.userInterface.jsSizing('box'); 1620 1621 //ie compatibility 1622 var tacCloseAlertEvent; 1623 if(typeof(Event) === 'function') { 1624 tacCloseAlertEvent = new Event("tac.close_alert"); 1625 }else if (typeof(document.createEvent) === 'function'){ 1626 tacCloseAlertEvent = document.createEvent('Event'); 1627 tacCloseAlertEvent.initEvent("tac.close_alert", true, true); 1628 } 1629 //end ie compatibility 1630 1631 if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacCloseAlertEvent);} 1632 }, 1633 "toggleCookiesList": function () { 1634 "use strict"; 1635 var div = document.getElementById('tarteaucitronCookiesListContainer'), 1636 togglediv = document.getElementById('tarteaucitronCookiesNumber'); 1637 1638 if (div === null) { 1639 return; 1640 } 1641 1642 if (div.style.display !== 'block') { 1643 tarteaucitron.cookie.number(); 1644 div.style.display = 'block'; 1645 togglediv.setAttribute("aria-expanded", "true"); 1646 tarteaucitron.userInterface.jsSizing('cookie'); 1647 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 1648 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); 1649 tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) { 1650 elem.style.display = 'none'; 1651 }, true); 1652 } else { 1653 div.style.display = 'none'; 1654 togglediv.setAttribute("aria-expanded", "false"); 1655 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 1656 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none'); 1657 } 1658 }, 1659 "toggle": function (id, closeClass) { 1660 "use strict"; 1661 var div = document.getElementById(id); 1662 1663 if (div === null) { 1664 return; 1665 } 1666 1667 if (closeClass !== undefined) { 1668 tarteaucitron.fallback([closeClass], function (elem) { 1669 if (elem.id !== id) { 1670 elem.style.display = 'none'; 1671 } 1672 }, true); 1673 } 1674 1675 if (div.style.display !== 'block') { 1676 div.style.display = 'block'; 1677 } else { 1678 div.style.display = 'none'; 1679 } 1680 }, 1681 "order": function (id) { 1682 "use strict"; 1683 var main = document.getElementById('tarteaucitronServices_' + id), 1684 allDivs, 1685 store = [], 1686 i; 1687 1688 if (main === null) { 1689 return; 1690 } 1691 1692 allDivs = main.childNodes; 1693 1694 if (typeof Array.prototype.map === 'function' && typeof Enumerable === 'undefined') { 1695 Array.prototype.map.call(main.children, Object).sort(function (a, b) { 1696 //var mainChildren = Array.from(main.children); 1697 //mainChildren.sort(function (a, b) { 1698 if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; } 1699 if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; } 1700 return 0; 1701 }
1701).forEach(function (element) { 1702 main.appendChild(element); 1703 }); 1704 } 1705 }, 1706 "jsSizing": function (type) { 1707 "use strict"; 1708 var scrollbarMarginRight = 10, 1709 scrollbarWidthParent, 1710 scrollbarWidthChild, 1711 servicesHeight, 1712 e = window, 1713 a = 'inner', 1714 windowInnerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, 1715 mainTop, 1716 mainHeight, 1717 closeButtonHeight, 1718 headerHeight, 1719 cookiesListHeight, 1720 cookiesCloseHeight, 1721 cookiesTitleHeight, 1722 paddingBox, 1723 alertSmallHeight, 1724 cookiesNumberHeight; 1725 1726 if (type === 'box') { 1727 if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) { 1728 1729 // reset 1730 tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px'); 1731 1732 // calculate 1733 alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight; 1734 cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight; 1735 paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2; 1736 1737 // apply 1738 tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px'); 1739 } 1740 } else if (type === 'main') { 1741 1742 // get the real window width for media query 1743 if (window.innerWidth === undefined) { 1744 a = 'client'; 1745 e = document.documentElement || document.body; 1746 } 1747 1748 // height of the services list container 1749 if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) { 1750 1751 // reset 1752 tarteaucitron.userInterface.css('tarteaucitronServices', 'height', 'auto'); 1753 1754 // calculate 1755 mainHeight = document.getElementById('tarteaucitron').offsetHeight; 1756 closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight; 1757 1758 // apply 1759 servicesHeight = (mainHeight - closeButtonHeight + 4); 1760 tarteaucitron.userInterface.css('tarteaucitronServices', 'height', servicesHeight + 'px'); 1761 tarteaucitron.userInterface.css('tarteaucitronServices', 'overflow-x', 'auto'); 1762 } 1763 1764 // align the main allow/deny button depending on scrollbar width 1765 if (document.getElementById('tarteaucitronServices') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) { 1766 1767 // media query 1768 if (e[a + 'Width'] <= 479) { 1769 //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px'); 1770 } else if (e[a + 'Width'] <= 767) { 1771 scrollbarMarginRight = 12; 1772 } 1773 1774 scrollbarWidthParent = document.getElementById('tarteaucitronServices').offsetWidth; 1775 scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth; 1776 //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px'); 1777 } 1778 1779 // center the main panel 1780 if (document.getElementById('tarteaucitron') !== null) { 1781 1782 // media query 1783 if (e[a + 'Width'] <= 767) { 1784 mainTop = 0; 1785 } else { 1786 mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21; 1787 } 1788 1789 if (document.getElementById('tarteaucitronMainLineOffset') !== null) { 1790 if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) { 1791 mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight; 1792 } 1793 } 1794 1795 // correct 1796 if (mainTop < 0) { 1797 mainTop = 0; 1798 } 1799 1800 // apply 1801 tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px'); 1802 } 1803 1804 1805 } else if (type === 'cookie') { 1806 1807 // put cookies list at bottom 1808 if (document.getElementById('tarteaucitronAlertSmall') !== null) { 1809 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px'); 1810 } 1811 1812 // height of cookies list 1813 if (document.getElementById('tarteaucitronCookiesListContainer') !== null) { 1814 1815 // reset 1816 tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto'); 1817 1818 // calculate 1819 cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight; 1820 cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight; 1821 cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight; 1822 1823 // apply 1824 tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookie
vendor: 15,028 bytes, lines 1824-2163
1824sListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px'); 1825 } 1826 } 1827 } 1828 }, 1829 "cookie": { 1830 "owner": {}, 1831 "create": function (key, status) { 1832 "use strict"; 1833 1834 if (tarteaucitronForceExpire !== '') { 1835 // The number of day(s)/hour(s) can't be higher than 1 year 1836 if ((tarteaucitronExpireInDay && tarteaucitronForceExpire < 365) || (!tarteaucitronExpireInDay && tarteaucitronForceExpire < 8760)) { 1837 if (tarteaucitronExpireInDay) { 1838 // Multiplication to tranform the number of days to milliseconds 1839 timeExpire = tarteaucitronForceExpire * 86400000; 1840 } else { 1841 // Multiplication to tranform the number of hours to milliseconds 1842 timeExpire = tarteaucitronForceExpire * 3600000; 1843 } 1844 } 1845 } 1846 1847 var d = new Date(), 1848 time = d.getTime(), 1849 expireTime = time + timeExpire, // 365 days 1850 regex = new RegExp("!" + key + "=(wait|true|false)", "g"), 1851 cookie = tarteaucitron.cookie.read().replace(regex, ""), 1852 value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status, 1853 domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? '; domain=' + tarteaucitron.parameters.cookieDomain : '', 1854 secure = location.protocol === 'https:' ? '; Secure' : ''; 1855 1856 d.setTime(expireTime); 1857 document.cookie = value + '; expires=' + d.toGMTString() + '; path=/' + domain + secure + '; samesite=lax'; 1858 1859 tarteaucitron.sendEvent('tac.consent_updated'); 1860 }, 1861 "read": function () { 1862 "use strict"; 1863 var nameEQ = tarteaucitron.parameters.cookieName + "=", 1864 ca = document.cookie.split(';'), 1865 i, 1866 c; 1867 1868 for (i = 0; i < ca.length; i += 1) { 1869 c = ca[i]; 1870 while (c.charAt(0) === ' ') { 1871 c = c.substring(1, c.length); 1872 } 1873 if (c.indexOf(nameEQ) === 0) { 1874 return c.substring(nameEQ.length, c.length); 1875 } 1876 } 1877 return ''; 1878 }, 1879 "purge": function (arr) { 1880 "use strict"; 1881 var i; 1882 1883 for (i = 0; i < arr.length; i += 1) { 1884 1885 var rgxpCookie = new RegExp("^(.*;)?\\s*" + arr[i] + "\\s*=\\s*[^;]+(.*)?$"); 1886 if (document.cookie.match(rgxpCookie)) { 1887 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;'; 1888 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';'; 1889 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';'; 1890 } 1891 } 1892 }, 1893 "checkCount": function (key) { 1894 "use strict"; 1895 var arr = tarteaucitron.services[key].cookies, 1896 nb = arr.length, 1897 nbCurrent = 0, 1898 html = '', 1899 i, 1900 status = document.cookie.indexOf(key + '=true'); 1901 1902 if (status >= 0 && nb === 0) { 1903 html += tarteaucitron.lang.useNoCookie; 1904 } else if (status >= 0) { 1905 for (i = 0; i < nb; i += 1) { 1906 if (document.cookie.indexOf(arr[i] + '=') !== -1) { 1907 nbCurrent += 1; 1908 if (tarteaucitron.cookie.owner[arr[i]] === undefined) { 1909 tarteaucitron.cookie.owner[arr[i]] = []; 1910 } 1911 if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) { 1912 tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name); 1913 } 1914 } 1915 } 1916 1917 if (nbCurrent > 0) { 1918 html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' cookie'; 1919 if (nbCurrent > 1) { 1920 html += 's'; 1921 } 1922 html += '.'; 1923 } else { 1924 html += tarteaucitron.lang.useNoCookie; 1925 } 1926 } else if (nb === 0) { 1927 html = tarteaucitron.lang.noCookie; 1928 } else { 1929 html += tarteaucitron.lang.useCookie + ' ' + nb + ' cookie'; 1930 if (nb > 1) { 1931 html += 's'; 1932 } 1933 html += '.'; 1934 } 1935 1936 if (document.getElementById('tacCL' + key) !== null) { 1937 document.getElementById('tacCL' + key).innerHTML = html; 1938 } 1939 }, 1940 "crossIndexOf": function (arr, match) { 1941 "use strict"; 1942 var i; 1943 for (i = 0; i < arr.length; i += 1) { 1944 if (arr[i] === match) { 1945 return true; 1946 } 1947 } 1948 return false; 1949 }, 1950 "number": function () { 1951 "use strict"; 1952 var cookies = document.cookie.split(';'), 1953 nb = (document.cookie !== '') ? cookies.length : 0, 1954 html = '', 1955 i, 1956 name, 1957 namea, 1958 nameb, 1959 c, 1960 d, 1961 s = (nb > 1) ? 's' : '', 1962 savedname, 1963 regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i, 1964 regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn, 1965 host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain; 1966 1967 cookies = cookies.sort(function (a, b) { 1968 namea = a.split('=', 1).toString().replace(/ /g, ''); 1969 nameb = b.split('=', 1).toString().replace(/ /g, ''); 1970 c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0'; 1971 d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0'; 1972 if (c + a > d + b) { return 1; } 1973 if (c + a < d + b) { return -1; } 1974 return 0; 1975 }); 1976 1977 if (document.cookie !== '') { 1978 for (i = 0; i < nb; i += 1) { 1979 name = cookies[i].split('=', 1).toString().replace(/ /g, ''); 1980 if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) { 1981 savedname = tarteaucitron.cookie.owner[name].join(' // '); 1982 html += '<div class="tarteaucitronHidden">'; 1983 html += ' <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">'; 1984 html += ' ' + tarteaucitron.cookie.owner[name].join(' // '); 1985 html += ' </span>'; 1986 html += '</div><ul class="cookie-list">'; 1987 } else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) { 1988 savedname = host; 1989 html += '<div class="tarteaucitronHidden">'; 1990 html += ' <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">'; 1991 html += ' ' + host; 1992 html += ' </span>'; 1993 html += '</div><ul class="cookie-list">'; 1994 } 1995 html += '<li class="tarteaucitronCookiesListMain">'; 1996 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>'; 1997 html += ' </div>'; 1998 html += ' <div class="tarteaucitronCookiesListRight">' + tarteaucitron.fixSelfXSS(cookies[i].split('=').slice(1).join('=')) + '</div>'; 1999 html += '</li>'; 2000 } 2001 html += '</ul>'; 2002 } else { 2003 html += '<div class="tarteaucitronCookiesListMain">'; 2004 html += ' <div class="tarteaucitronCookiesListLeft"><strong>-</strong></div>'; 2005 html += ' <div class="tarteaucitronCookiesListRight"></div>'; 2006 html += '</div>'; 2007 } 2008 2009 html += '<div class="tarteaucitronHidden tarteaucitron-spacer-20"></div>'; 2010 2011 if (document.getElementById('tarteaucitronCookiesList') !== null) { 2012 document.getElementById('tarteaucitronCookiesList').innerHTML = html; 2013 } 2014 2015 if (document.getElementById('tarteaucitronCookiesNumber') !== null) { 2016 document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb; 2017 document.getElementById('tarteaucitronCookiesNumber').setAttribute("aria-label", nb + ' cookie' + s + " - " + tarteaucitron.lang.toggleInfoBox); 2018 document.getElementById('tarteaucitronCookiesNumber').setAttribute("title", nb + ' cookie' + s + " - " + tarteaucitron.lang.toggleInfoBox); 2019 } 2020 2021 if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) { 2022 document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s; 2023 } 2024 2025 var purgeBtns = document.getElementsByClassName("purgeBtn"); 2026 for (i = 0; i < purgeBtns.length; i++) { 2027 tarteaucitron.addClickEventToElement(purgeBtns[i], function () { 2028 tarteaucitron.cookie.purge([this.dataset.cookie]); 2029 tarteaucitron.cookie.number(); 2030 tarteaucitron.userInterface.jsSizing('cookie'); 2031 return false; 2032 }); 2033 } 2034 2035 for (i = 0; i < tarteaucitron.job.length; i += 1) { 2036 tarteaucitron.cookie.checkCount(tarteaucitron.job[i]); 2037 } 2038 } 2039 }, 2040 "fixSelfXSS": function(html) { 2041 return html.toString().replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"); 2042 }, 2043 "getLanguage": function () { 2044 "use strict"; 2045 2046 var availableLanguages = 'ar,bg,ca,cn,cs,da,de,et,el,en,es,fi,fr,hr,hu,it,ja,kr,lb,lt,lv,nl,no,oc,pl,pt,ro,ru,se,sk,sv,tr,uk,vi,zh', 2047 defaultLanguage = 'en'; 2048 2049 if (tarteaucitronForceLanguage !== '') { 2050 if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) { 2051 return tarteaucitronForceLanguage; 2052 } 2053 } 2054 2055 // get the html lang 2056 if (availableLanguages.indexOf(document.documentElement.getAttribute("lang").substr(0, 2)) !== -1) { 2057 return document.documentElement.getAttribute("lang").substr(0, 2); 2058 } 2059 2060 if (!navigator) { return defaultLanguage; } 2061 2062 var lang = navigator.language || navigator.browserLanguage || 2063 navigator.systemLanguage || navigator.userLang || null, 2064 userLanguage = lang ? lang.substr(0, 2) : null; 2065 2066 if (availableLanguages.indexOf(userLanguage) !== -1) { 2067 return userLanguage; 2068 } 2069 2070 return defaultLanguage; 2071 }, 2072 "getLocale": function () { 2073 "use strict"; 2074 if (!navigator) { return 'en_US'; } 2075 2076 var lang = navigator.language || navigator.browserLanguage || 2077 navigator.systemLanguage || navigator.userLang || null, 2078 userLanguage = lang ? lang.substr(0, 2) : null; 2079 2080 if (userLanguage === 'fr') { 2081 return 'fr_FR'; 2082 } else if (userLanguage === 'en') { 2083 return 'en_US'; 2084 } else if (userLanguage === 'de') { 2085 return 'de_DE'; 2086 } else if (userLanguage === 'es') { 2087 return 'es_ES'; 2088 } else if (userLanguage === 'it') { 2089 return 'it_IT'; 2090 } else if (userLanguage === 'pt') { 2091 return 'pt_PT'; 2092 } else if (userLanguage === 'nl') { 2093 return 'nl_NL'; 2094 } else if (userLanguage === 'el') { 2095 return 'el_EL'; 2096 } else { 2097 return 'en_US'; 2098 } 2099 }, 2100 "addScript": function (url, id, callback, execute, attrName, attrVal, internal) { 2101 "use strict"; 2102 var script, 2103 done = false; 2104 2105 if (execute === false) { 2106 if (typeof callback === 'function') { 2107 callback(); 2108 } 2109 } else { 2110 script = document.createElement('script'); 2111 if (id !== undefined) { 2112 script.id = id; 2113 } 2114 script.async = true; 2115 script.src = url; 2116 2117 if (attrName !== undefined && attrVal !== undefined) { 2118 script.setAttribute(attrName, attrVal); 2119 } 2120 2121 if (typeof callback === 'function') { 2122 if ( !tarteaucitron.parameters.useExternalJs || !internal ) { 2123 script.onreadystatechange = script.onload = function () { 2124 var state = script.readyState; 2125 if (!done && (!state || /loaded|complete/.test(state))) { 2126 done = true; 2127 callback(); 2128 } 2129 }; 2130 } else { 2131 callback(); 2132 } 2133 } 2134 2135 if ( !tarteaucitron.parameters.useExternalJs || !internal ) { 2136 document.getElementsByTagName('head')[0].appendChild(script); 2137 } 2138 } 2139 }, 2140 "addInternalScript": function (url, id, callback, execute, attrName, attrVal) { 2141 tarteaucitron.addScript(url, id, callback, execute, attrName, attrVal, true); 2142 }, 2143 "checkIfExist": function (elemId) { 2144 "use strict"; 2145 return document.getElementById(elemId) !== null && document.getElementById(elemId).offsetWidth !== 0 && document.getElementById(elemId).offsetHeight !== 0; 2146 }, 2147 "makeAsync": { 2148 "antiGhost": 0, 2149 "buffer": '', 2150 "init": function (url, id) { 2151 "use strict"; 2152 var savedWrite = document.write, 2153 savedWriteln = document.writeln; 2154 2155 document.write = function (content) { 2156 tarteaucitron.makeAsync.buffer += content; 2157 }; 2158 document.writeln = function (content) { 2159 tarteaucitron.makeAsync.buffer += content.concat("\n"); 2160 }; 2161 2162 setTimeout(function () { 2163 document.write = savedWrite;
2164 document.writeln = savedWriteln; 2165 }, 20000); 2166 2167 tarteaucitron.makeAsync.getAndParse(url, id); 2168 }, 2169 "getAndParse": function (url, id) { 2170 "use strict"; 2171 if (tarteaucitron.makeAsync.antiGhost > 9) { 2172 tarteaucitron.makeAsync.antiGhost = 0; 2173 return; 2174 } 2175 tarteaucitron.makeAsync.antiGhost += 1; 2176 tarteaucitron.addInternalScript(url, '', function () { 2177 if (document.getElementById(id) !== null) { 2178 document.getElementById(id).innerHTML += "<span class='tarteaucitron-display-none'> </span>" + tarteaucitron.makeAsync.buffer; 2179 tarteaucitron.makeAsync.buffer = ''; 2180 tarteaucitron.makeAsync.execJS(id); 2181 } 2182 }); 2183 }, 2184 "execJS": function (id) { 2185 /* not strict because third party scripts may have errors */ 2186 var i, 2187 scripts, 2188 childId, 2189 type; 2190 2191 if (document.getElementById(id) === null) { 2192 return; 2193 } 2194 2195 scripts = document.getElementById(id).getElementsByTagName('script'); 2196 for (i = 0; i < scripts.length; i += 1) { 2197 type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : ''; 2198 if (type === '') { 2199 type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : ''; 2200 } 2201 if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') { 2202 childId = id + Math.floor(Math.random() * 99999999999); 2203 document.getElementById(id).innerHTML += '<div id="' + childId + '"></div>'; 2204 tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId); 2205 } else if (type.indexOf('javascript') !== -1 || type === '') { 2206 eval(scripts[i].innerHTML); 2207 } 2208 } 2209 } 2210 }, 2211 "fallback": function (matchClass, content, noInner) { 2212 "use strict"; 2213 var elems = document.getElementsByTagName('*'), 2214 i, 2215 index = 0; 2216 2217 for (i in elems) { 2218 if (elems[i] !== undefined) { 2219 for (index = 0; index < matchClass.length; index += 1) { 2220 if ((' ' + elems[i].className + ' ') 2221 .indexOf(' ' + matchClass[index] + ' ') > -1) { 2222 if (typeof content === 'function') { 2223 if (noInner === true) { 2224 content(elems[i]); 2225 } else { 2226 elems[i].innerHTML = content(elems[i]); 2227 } 2228 } else { 2229 elems[i].innerHTML = content; 2230 } 2231 } 2232 } 2233 } 2234 } 2235 }, 2236 "engage": function (id) { 2237 "use strict"; 2238 var html = '', 2239 r = Math.floor(Math.random() * 100000), 2240 engage = tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback; 2241 2242 if (tarteaucitron.lang['engage-' + id] !== undefined) { 2243 engage = tarteaucitron.lang['engage-' + id]; 2244 } 2245 2246 html += '<div class="tac_activate tac_activate_' + id + '">'; 2247 html += ' <div class="tac_float">'; 2248 html += ' ' + engage; 2249 html += ' <button type="button" class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '">'; 2250 html += ' <span class="tarteaucitronCheck" aria-hidden="true"></span> ' + tarteaucitron.lang.allow; 2251 html += ' </button>'; 2252 html += ' </div>'; 2253 html += '</div>'; 2254 2255 return html; 2256 }, 2257 "extend": function (a, b) { 2258 "use strict"; 2259 var prop; 2260 for (prop in b) { 2261 if (b.hasOwnProperty(prop)) { 2262 a[prop] = b[prop]; 2263 } 2264 } 2265 }, 2266 "proTemp": '', 2267 "proTimer": function () { 2268 "use strict"; 2269 setTimeout(tarteaucitron.proPing, (Math.floor(Math.random() * (1200 - 500 + 1)) + 500)); 2270 }, 2271 "pro": function (list) { 2272 "use strict"; 2273 tarteaucitron.proTemp += list; 2274 clearTimeout(tarteaucitron.proTimer); 2275 tarteaucitron.proTimer = setTimeout(tarteaucitron.proPing, (Math.floor(Math.random() * (1200 - 500 + 1)) + 500)); 2276 }, 2277 "proPing": function () { 2278 "use strict"; 2279 if (tarteaucitron.uuid !== '' && tarteaucitron.uuid !== undefined && tarteaucitron.proTemp !== '' && tarteaucitronStatsEnabled) { 2280 var div = document.getElementById('tarteaucitronPremium'), 2281 timestamp = new Date().getTime(), 2282 url = 'https://tarteaucitron.io/log/?'; 2283 2284 if (div === null) { 2285 return; 2286 } 2287 2288 url += 'account=' + tarteaucitron.uuid + '&'; 2289 url += 'domain=' + tarteaucitron.domain + '&'; 2290 url += 'status=' + encodeURIComponent(tarteaucitron.proTemp) + '&'; 2291 url += '_time=' + timestamp; 2292 2293 div.innerHTML = '<img src="' + url + '" class="tarteaucitron-display-none" alt="" />'; 2294 2295 tarteaucitron.proTemp = ''; 2296 } 2297 2298 tarteaucitron.cookie.number(); 2299 }, 2300 "AddOrUpdate" : function(source, custom){ 2301 /** 2302 Utility function to Add or update the fields of obj1 with the ones in obj2 2303 */ 2304 for(var key in custom){ 2305 if(custom[key] instanceof Object){ 2306 source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]); 2307 }else{ 2308 source[key] = custom[key]; 2309 } 2310 } 2311 return source; 2312 }, 2313 "getElemWidth": function(elem) { 2314 return tarteaucitron.getElemAttr(elem, 'width') || elem.clientWidth; 2315 }, 2316 "getElemHeight": function(elem) { 2317 return tarteaucitron.getElemAttr(elem, 'height') || elem.clientHeight; 2318 }, 2319 "getElemAttr": function (elem, attr) { 2320 var attribute = elem.getAttribute('data-' + attr) || elem.getAttribute(attr); 2321 2322 if (typeof attribute === 'string') { 2323 return tarteaucitron.fixSelfXSS(attribute); 2324 } 2325 2326 return ""; 2327 }, 2328 "addClickEventToId": function (elemId, func) { 2329 tarteaucitron.addClickEventToElement(document.getElementById(elemId), func); 2330 }, 2331 "addClickEventToElement": function (e, func) { 2332 if (e) { 2333 if (e.addEventListener) { 2334 e.addEventListener("click", func); 2335 } else { 2336 e.attachEvent("onclick", func); 2337 } 2338 } 2339 }, 2340 "triggerJobsAfterAjaxCall": function() { 2341 tarteaucitron.job.forEach(function(e) { tarteaucitron.job.push(e) }); 2342 var i; 2343 var allowBtns = document.getElementsByClassName("tarteaucitronAllow"); 2344 for (i = 0; i < allowBtns.length; i++) { 2345 tarteaucitron.addClickEventToElement(allowBtns[i], function () { 2346 tarteaucitron.userInterface.respond(this, true); 2347 }); 2348 } 2349 var denyBtns = document.getElementsByClassName("tarteaucitronDeny"); 2350 for (i = 0; i < denyBtns.length; i++) { 2351 tarteaucitron.addClickEventToElement(denyBtns[i], function () { 2352 tarteaucitron.userInterface.respond(this, false); 2353 }); 2354 } 2355 } 2356};
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.