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