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