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