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