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