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