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