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