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