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