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