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