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