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