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