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";
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 + ')" title="' + tarteaucitron.lang.close + ' (' + tarteaucitron.lang.reload + ')"></button>'; 316 } else { 317 html += '<button type="button" id="tarteaucitronBack" aria-label="' + tarteaucitron.lang.close + '" title="' + 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 + ')" title="' + 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,122 bytes, lines 329-469
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 + '" title="' + 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 + ')" title="' + 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 + '" title="' + 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
vendor: 4,651 bytes, lines 469-496
469">'; 470 html += ' <img src="' + (tarteaucitron.parameters.iconSrc ? tarteaucitron.parameters.iconSrc : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAGA0lEQVRoge1a207bWBRdBtJwLYZhKDMVmlSK1LxNkPo+ZH6g8B6p5AuALwC+APoFoVLeoT8whPeRSt+CZKmZVu3AiIsRlEtCktGyjy8xzuXYhvahS0JJHJ/4rLP3XnuffcAPfGdQ7mM6jRLSAF4BxqsbewB2lRS2o35mpEQaJcwCyANIdLi1DGBNSWEzqmdHRqRRwjqAJclhtExOSUEP+/xIiDRKhhUWfL7ShTtBuJnqcw+/z4Ql0xNmMEwSSz4kuNIzSgpjSsqYJP/GeE185wYJroedRyiLNEpGLLzzrHSuk+83SgbxvOcyyRaDziWsRVZkSRDinpzPbwVGWIucuohsKynMS47fAQyls/BMSRmKJo3AFhG5wm2N1wF+Zs3zebbFfR0RxrXcJHQlgH+LMW616pR/WiIMEXfW3mtzXyeEGWsjKot8c4TOI98L+iKaR5PS6IUk88RLAO9F8UjrbYoYMOosNavpfmODIiwRXRR/G3ohaWVo1RU/c30jV8ab2mV8qVGzHWBOLyTLZiWs5Rolg/C3ySOi0tXP/k4aEwOwSBKPJs7Rp16ABJTe+p1xVX0It/owqqdDEMRoqd3RFxqDPh20Ig6VEPVC0i5RSCD+6wl6HlW7GksSlUMV11/GrUs5NasFLusDE9ELSVphXemtJwaT/8JyIRvxNNCfBmIiNdR04LII3DSrbe0yjqvyJF/ppptqVlt+MCLCEh/oOkPPP6N38Mb5cnQBGFsEqmXg5j3QMwoMzwGnr4HYbybBq13gZAOom/FO63zdf2qQArCsZrUN2TlJy69eSDKYV+6Q4MpP75ivHzPA53ngaBW4eGuSOt0A/lsGPmXMz0+3TFJcTfFbPfFbfnwlhON+iQhlWmA82CQ4ocQ7c6KcfL3DHuls0yT6Sx4YnLXJDCQOIRRv5yGIJBgP8Sdisj2qubpc5UGJmo+W49ifVmzL8HcpGhQPvZCUKiCliIhEN0tr2OCqHuSA8gwQ/92MkU7gxEmeVqGrTTgpxPXbUrtGWYus0I9thRIraagRQUIDf7Qn4yZhKRiFQIyhfMfUr3yblokVWSJ6k8xSnc7eNN/RjowfCYiFoDUFer1S3gW6JiJ8Nt30EMbEhU+vzSIztuRYjRLsR8IHLjlf7HZ+MrWWEXxNmbvapt4jGSqZRYSkGUetSNTPzHsui5YMQ2ajJUNks6mw4wT54Ok2ShnzzIPCUGshzawCRKy5FqvrTZe0RWzQGvw79m67XZjKmxJrLsICjtZa55gxXy+6F4sYsEtxTqhXdRTLC8ulSDaWoCLsolfN+8YUhOsJV709H7Cudr0LlVEtzqBcN+shEyThdR941OnAbF8pirKJqXyupTRTtQSReiVmXW1j7oBErB0d9xM2WEd5J9ZKYtuR4WKwwBSoORbpGrJ5ZI9lt71irJmGX1px0JYE26uNErawr2zfIcP4OHEKXm66PA3wjpCNEfpJunI4muifPjKvsFCkGjExTq63yxMJsZNMYF/J4HmDC5A3Yq36jy0ClePHVhwuu/b1HSFlEfHD5ZtD1bEK44Qu1mWys6tbWmZyPWckzlPTGiRw/XHCuk+q4Rek+mVrVL/UppwrdDEGNV2kpyuhccgc5Oxm9vWnn+19vJrVpLor0kTUrGacMplb1CfOFyTD4o9uNrHqr2Z+ZMSp1c2XcVSORnh9Q81q3k599ETgkNnjg0nGzi10K7rX+bZpHbrblPcY5A4Zxk2xcjzCvTpd9027Aa0QtouyyrKFRR6D/04DwkFGvHPXM3Qda/Jb4nPgI7hQLVM1q5HIBt2MzQNa57Z1DiiLAGa5Mi+O4Sz3Mpp6laPHO6InII3ITnX1QtI+EOX+m9ZxleOZ/j9PiuKoLi3aqXPuEoSye/Vhkm+LalbLtHhMS0R6zu7aZ3vP2jOjL7QVv4McxhcDnZIelAQibGIbULOapf3PuE1Vs9qeaOTdkVKr00gCQiw4NlBzDvf1Lxx+uP5r3Dgv5KQZRzWn+GRwz8jmDS8itUg7iB6vLuJCF5Uty4A9mVKkFR6MiJDachST/oHvHgD+B4SoUIitpF05AAAAAElFTkSuQmCC') + '" alt="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '" title="' + tarteaucitron.lang.icon + ' ' + tarteaucitron.lang.modalWindow + '">'; 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 + '" title="' + 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" aria-expanded="false" aria-controls="tarteaucitronCookiesListContainer">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 + ')" title="' + 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="
vendor: 4,167 bytes, lines 496-576
4962" id="tarteaucitronCookiesNumberBis">0 cookie</span>'; 497 html += ' </div>'; 498 html += ' <div id="tarteaucitronCookiesList"></div>'; 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(); 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 () {
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 +'"
vendor: 5,736 bytes, lines 796-911
796class="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 document.getElementById('tarteaucitronClosePanel').setAttribute("title", ariaCloseValue); 982 } 983 } 984 if (tarteaucitron.launch[key] !== true && status === true) { 985 986 tarteaucitron.pro('!' + key + '=engage'); 987 988 tarteaucitron.launch[key] = true; 989 if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); } 990 tarteaucitron.sendEvent(key + '_loaded'); 991 } 992 var itemStatusElem = document.getElementById('tacCurrentStatus'+key); 993 if(status == true){ 994 itemStatusElem.innerHTML = tarteaucitron.lang.allowed; 995 }else{ 996 itemStatusElem.innerHTML = tarteaucitron.lang.disallowed; 997 } 998 tarteaucitron.state[key] = status; 999 tarteaucitron.cookie.create(key, status); 1000 tarteaucitron.userInterface.color(key, status); 1001 } 1002 } 1003 }, 1004 "respond": function (el, status) { 1005 "use strict"; 1006 if (el.id === '') { 1007 return; 1008 } 1009 var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), ''); 1010
1011 if (key.substring(0, 13) === 'tarteaucitron' || key === '') {return;} 1012 1013 // return if same state 1014 if (tarteaucitron.state[key] === status) { 1015 return; 1016 } 1017 1018 if (status === false && tarteaucitron.launch[key] === true) { 1019 tarteaucitron.reloadThePage = true; 1020 if (tarteaucitron.checkIfExist('tarteaucitronClosePanel')) { 1021 var ariaCloseValue = document.getElementById('tarteaucitronClosePanel').textContent.trim() + ' (' + tarteaucitron.lang.reload + ')'; 1022 document.getElementById('tarteaucitronClosePanel').setAttribute("aria-label", ariaCloseValue); 1023 document.getElementById('tarteaucitronClosePanel').setAttribute("title", ariaCloseValue); 1024 } 1025 } 1026 1027 // if not already launched... launch the service 1028 if (status === true) { 1029 if (tarteaucitron.launch[key] !== true) { 1030 1031 tarteaucitron.pro('!' + key + '=engage'); 1032 1033 tarteaucitron.launch[key] = true; 1034 if (typeof tarteaucitronMagic === 'undefined' || tarteaucitronMagic.indexOf("_" + key + "_") < 0) { tarteaucitron.services[key].js(); } 1035 tarteaucitron.sendEvent(key + '_loaded'); 1036 } 1037 } 1038 var itemStatusElem = document.getElementById('tacCurrentStatus'+key); 1039 if(status == true){ 1040 itemStatusElem.innerHTML = tarteaucitron.lang.allowed; 1041 }else{ 1042 itemStatusElem.innerHTML = tarteaucitron.lang.disallowed; 1043 } 1044 tarteaucitron.state[key] = status; 1045 tarteaucitron.cookie.create(key, status); 1046 tarteaucitron.userInterface.color(key, status); 1047 }, 1048 "color": function (key, status) { 1049 "use strict"; 1050 var c = 'tarteaucitron', 1051 nbDenied = 0, 1052 nbPending = 0, 1053 nbAllowed = 0, 1054 sum = tarteaucitron.job.length, 1055 index, 1056 s = tarteaucitron.services; 1057 1058 if (key !== "") { 1059 1060 if (status === true) { 1061 tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsAllowed'); 1062 tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsDenied'); 1063 document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'true'); 1064 document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'false'); 1065 } else if (status === false) { 1066 tarteaucitron.userInterface.removeClass(key + 'Line', 'tarteaucitronIsAllowed'); 1067 tarteaucitron.userInterface.addClass(key + 'Line', 'tarteaucitronIsDenied'); 1068 document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'false'); 1069 document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'true'); 1070 } else { 1071 document.getElementById(key + 'Allowed').setAttribute('aria-pressed', 'false'); 1072 document.getElementById(key + 'Denied').setAttribute('aria-pressed', 'false'); 1073 } 1074 1075 // check if all services are allowed 1076 var sumToRemove = 0; 1077 for (index = 0; index < sum; index += 1) { 1078 1079 if (typeof s[tarteaucitron.job[index]].safeanalytic !== "undefined" && s[tarteaucitron.job[index]].safeanalytic === true) { 1080 sumToRemove += 1; 1081 continue; 1082 } 1083 1084 if (tarteaucitron.state[tarteaucitron.job[index]] === false) { 1085 nbDenied += 1; 1086 } else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) { 1087 nbPending += 1; 1088 } else if (tarteaucitron.state[tarteaucitron.job[index]] === true) { 1089 nbAllowed += 1; 1090 } 1091 } 1092 sum -= sumToRemove; 1093 1094 tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%'); 1095 tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%'); 1096 tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%'); 1097
vendor: 16,385 bytes, lines 1098-1434
1098 if (nbDenied === 0 && nbPending === 0) { 1099 tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected'); 1100 tarteaucitron.userInterface.addClass(c + 'AllAllowed', c + 'IsSelected'); 1101 1102 tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsAllowed'); 1103 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied'); 1104 1105 document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false'); 1106 document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'true'); 1107 1108 } else if (nbAllowed === 0 && nbPending === 0) { 1109 tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected'); 1110 tarteaucitron.userInterface.addClass(c + 'AllDenied', c + 'IsSelected'); 1111 1112 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed'); 1113 tarteaucitron.userInterface.addClass(c + 'MainLineOffset', c + 'IsDenied'); 1114 1115 document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'true'); 1116 document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false'); 1117 1118 } else { 1119 tarteaucitron.userInterface.removeClass(c + 'AllAllowed', c + 'IsSelected'); 1120 tarteaucitron.userInterface.removeClass(c + 'AllDenied', c + 'IsSelected'); 1121 1122 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsAllowed'); 1123 tarteaucitron.userInterface.removeClass(c + 'MainLineOffset', c + 'IsDenied'); 1124 1125 document.getElementById(c + 'AllDenied').setAttribute('aria-pressed', 'false'); 1126 document.getElementById(c + 'AllAllowed').setAttribute('aria-pressed', 'false'); 1127 } 1128 1129 // close the alert if all service have been reviewed 1130 if (nbPending === 0) { 1131 tarteaucitron.userInterface.closeAlert(); 1132 } 1133 1134 if (tarteaucitron.services[key].cookies.length > 0 && status === false) { 1135 tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies); 1136 } 1137 1138 if (status === true) { 1139 if (document.getElementById('tacCL' + key) !== null) { 1140 document.getElementById('tacCL' + key).innerHTML = '...'; 1141 } 1142 setTimeout(function () { 1143 tarteaucitron.cookie.checkCount(key); 1144 }, 2500); 1145 } else { 1146 tarteaucitron.cookie.checkCount(key); 1147 } 1148 1149 } 1150 1151 // groups 1152 var cats = document.querySelectorAll('[id^="tarteaucitronServicesTitle_"]') 1153 Array.prototype.forEach.call(cats, function(item) { 1154 var cat = item.getAttribute('id').replace(/^(tarteaucitronServicesTitle_)/, ""), 1155 total = document.getElementById("tarteaucitronServices_"+cat).childElementCount; 1156 var doc = document.getElementById("tarteaucitronServices_"+cat), 1157 groupdenied = 0, 1158 groupallowed = 0; 1159 for (var ii = 0; ii < doc.children.length; ii++) { 1160 if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsDenied") { 1161 groupdenied++; 1162 } 1163 if (doc.children[ii].className == "tarteaucitronLine tarteaucitronIsAllowed") { 1164 groupallowed++; 1165 } 1166 } 1167 if (total === groupallowed) { 1168 tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied'); 1169 tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed'); 1170 1171 if (document.getElementById('tarteaucitron-reject-group-'+cat)) { 1172 document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false'); 1173 document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'true'); 1174 } 1175 } 1176 if (total === groupdenied) { 1177 tarteaucitron.userInterface.addClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied'); 1178 tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed'); 1179 1180 if (document.getElementById('tarteaucitron-reject-group-'+cat)) { 1181 document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'true'); 1182 document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false'); 1183 } 1184 } 1185 if (total !== groupdenied && total !== groupallowed) { 1186 tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsDenied'); 1187 tarteaucitron.userInterface.removeClass('tarteaucitron-group-'+cat, 'tarteaucitronIsAllowed'); 1188 1189 if (document.getElementById('tarteaucitron-reject-group-'+cat)) { 1190 document.getElementById('tarteaucitron-reject-group-'+cat).setAttribute('aria-pressed', 'false'); 1191 document.getElementById('tarteaucitron-accept-group-'+cat).setAttribute('aria-pressed', 'false'); 1192 } 1193 } 1194 groupdenied = 0; 1195 groupallowed = 0; 1196 }); 1197 1198 }, 1199 "openPanel": function () { 1200 "use strict"; 1201 1202 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block'); 1203 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); 1204 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); 1205 1206 document.getElementById('tarteaucitronClosePanel').focus(); 1207 if (document.getElementsByTagName('body')[0].classList !== undefined) { 1208 document.getElementsByTagName('body')[0].classList.add('tarteaucitron-modal-open'); 1209 } 1210 tarteaucitron.userInterface.focusTrap(); 1211 tarteaucitron.userInterface.jsSizing('main'); 1212 1213 //ie compatibility 1214 var tacOpenPanelEvent; 1215 if(typeof(Event) === 'function') { 1216 tacOpenPanelEvent = new Event("tac.open_panel"); 1217 }else if (typeof(document.createEvent) === 'function'){ 1218 tacOpenPanelEvent = document.createEvent('Event'); 1219 tacOpenPanelEvent.initEvent("tac.open_panel", true, true); 1220 } 1221 //end ie compatibility 1222 1223 if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacOpenPanelEvent);} 1224 }, 1225 "closePanel": function () { 1226 "use strict"; 1227 1228 if (document.location.hash === tarteaucitron.hashtag) { 1229 if (window.history) { 1230 window.history.replaceState('', document.title, window.location.pathname + window.location.search); 1231 } else { 1232 document.location.hash = ''; 1233 } 1234 } 1235 if (tarteaucitron.checkIfExist('tarteaucitron')) { 1236 // accessibility: manage focus on close panel 1237 if (tarteaucitron.checkIfExist('tarteaucitronCloseAlert')) { 1238 document.getElementById('tarteaucitronCloseAlert').focus(); 1239 } else if (tarteaucitron.checkIfExist('tarteaucitronManager')) { 1240 document.getElementById('tarteaucitronManager').focus(); 1241 } else if (tarteaucitron.customCloserId && tarteaucitron.checkIfExist(tarteaucitron.customCloserId)) { 1242 document.getElementById(tarteaucitron.customCloserId).focus(); 1243 } 1244 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 1245 } 1246 1247 if (tarteaucitron.checkIfExist('tarteaucitronCookiesListContainer') && tarteaucitron.checkIfExist('tarteaucitronCookiesNumber')) { 1248 // accessibility: manage focus on close cookies list 1249 document.getElementById('tarteaucitronCookiesNumber').focus(); 1250 document.getElementById('tarteaucitronCookiesNumber').setAttribute("aria-expanded", "false"); 1251 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); 1252 } 1253 1254 tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) { 1255 elem.style.display = 'none'; 1256 }, true); 1257 1258 if (tarteaucitron.reloadThePage === true) { 1259 window.location.reload(); 1260 } else { 1261 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none'); 1262 } 1263 if (document.getElementsByTagName('body')[0].classList !== undefined) { 1264 document.getElementsByTagName('body')[0].classList.remove('tarteaucitron-modal-open'); 1265 } 1266 1267 //ie compatibility 1268 var tacClosePanelEvent; 1269 if(typeof(Event) === 'function') { 1270 tacClosePanelEvent = new Event("tac.close_panel"); 1271 }else if (typeof(document.createEvent) === 'function'){ 1272 tacClosePanelEvent = document.createEvent('Event'); 1273 tacClosePanelEvent.initEvent("tac.close_panel", true, true); 1274 } 1275 //end ie compatibility 1276 1277 if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacClosePanelEvent);} 1278 }, 1279 "focusTrap": function() { 1280 "use strict"; 1281 1282 var focusableEls, 1283 firstFocusableEl, 1284 lastFocusableEl, 1285 filtered; 1286 1287 focusableEls = document.getElementById('tarteaucitron').querySelectorAll('a[href], button'); 1288 filtered = []; 1289 1290 // get only visible items 1291 for (var i = 0, max = focusableEls.length; i < max; i++) { 1292 if (focusableEls[i].offsetHeight > 0) { 1293 filtered.push(focusableEls[i]); 1294 } 1295 } 1296 1297 firstFocusableEl = filtered[0]; 1298 lastFocusableEl = filtered[filtered.length - 1]; 1299 1300 //loop focus inside tarteaucitron 1301 document.getElementById('tarteaucitron').addEventListener("keydown", function (evt) { 1302 1303 if ( evt.key === 'Tab' || evt.keyCode === 9 ) { 1304 1305 if ( evt.shiftKey ) /* shift + tab */ { 1306 if (document.activeElement === firstFocusableEl) { 1307 lastFocusableEl.focus(); 1308 evt.preventDefault(); 1309 } 1310 } else /* tab */ { 1311 if (document.activeElement === lastFocusableEl) { 1312 firstFocusableEl.focus(); 1313 evt.preventDefault(); 1314 } 1315 } 1316 } 1317 }) 1318 }, 1319 "openAlert": function () { 1320 "use strict"; 1321 var c = 'tarteaucitron'; 1322 tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block'); 1323 tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none'); 1324 tarteaucitron.userInterface.css(c + 'Icon', 'display', 'none'); 1325 tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'flex'); 1326 tarteaucitron.userInterface.addClass(c + 'Root', 'tarteaucitronBeforeVisible'); 1327 1328 //ie compatibility 1329 var tacOpenAlertEvent; 1330 if(typeof(Event) === 'function') { 1331 tacOpenAlertEvent = new Event("tac.open_alert"); 1332 }else if (typeof(document.createEvent) === 'function'){ 1333 tacOpenAlertEvent = document.createEvent('Event'); 1334 tacOpenAlertEvent.initEvent("tac.open_alert", true, true); 1335 } 1336 //end ie compatibility 1337 1338 if (document.getElementById('tarteaucitronAlertBig') !== null) { 1339 document.getElementById('tarteaucitronAlertBig').focus(); 1340 } 1341 1342 if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacOpenAlertEvent);} 1343 }, 1344 "closeAlert": function () { 1345 "use strict"; 1346 var c = 'tarteaucitron'; 1347 tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none'); 1348 tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block'); 1349 tarteaucitron.userInterface.css(c + 'Icon', 'display', 'block'); 1350 tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'none'); 1351 tarteaucitron.userInterface.removeClass(c + 'Root', 'tarteaucitronBeforeVisible'); 1352 tarteaucitron.userInterface.jsSizing('box'); 1353 1354 //ie compatibility 1355 var tacCloseAlertEvent; 1356 if(typeof(Event) === 'function') { 1357 tacCloseAlertEvent = new Event("tac.close_alert"); 1358 }else if (typeof(document.createEvent) === 'function'){ 1359 tacCloseAlertEvent = document.createEvent('Event'); 1360 tacCloseAlertEvent.initEvent("tac.close_alert", true, true); 1361 } 1362 //end ie compatibility 1363 1364 if (typeof(window.dispatchEvent) === 'function') {window.dispatchEvent(tacCloseAlertEvent);} 1365 }, 1366 "toggleCookiesList": function () { 1367 "use strict"; 1368 var div = document.getElementById('tarteaucitronCookiesListContainer'), 1369 togglediv = document.getElementById('tarteaucitronCookiesNumber'); 1370 1371 if (div === null) { 1372 return; 1373 } 1374 1375 if (div.style.display !== 'block') { 1376 tarteaucitron.cookie.number(); 1377 div.style.display = 'block'; 1378 togglediv.setAttribute("aria-expanded", "true"); 1379 tarteaucitron.userInterface.jsSizing('cookie'); 1380 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 1381 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); 1382 tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) { 1383 elem.style.display = 'none'; 1384 }, true); 1385 } else { 1386 div.style.display = 'none'; 1387 togglediv.setAttribute("aria-expanded", "false"); 1388 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 1389 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none'); 1390 } 1391 }, 1392 "toggle": function (id, closeClass) { 1393 "use strict"; 1394 var div = document.getElementById(id); 1395 1396 if (div === null) { 1397 return; 1398 } 1399 1400 if (closeClass !== undefined) { 1401 tarteaucitron.fallback([closeClass], function (elem) { 1402 if (elem.id !== id) { 1403 elem.style.display = 'none'; 1404 } 1405 }, true); 1406 } 1407 1408 if (div.style.display !== 'flex') { 1409 div.style.display = 'flex'; 1410 } else { 1411 div.style.display = 'none'; 1412 } 1413 }, 1414 "order": function (id) { 1415 "use strict"; 1416 var main = document.getElementById('tarteaucitronServices_' + id), 1417 allDivs, 1418 store = [], 1419 i; 1420 1421 if (main === null) { 1422 return; 1423 } 1424 1425 allDivs = main.childNodes; 1426 1427 if (typeof Array.prototype.map === 'function' && typeof Enumerable === 'undefined') { 1428 Array.prototype.map.call(main.children, Object).sort(function (a, b) { 1429 //var mainChildren = Array.from(main.children); 1430 //mainChildren.sort(function (a, b) { 1431 if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; } 1432 if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; } 1433 return 0; 1434 }
1434).forEach(function (element) { 1435 main.appendChild(element); 1436 }); 1437 } 1438 }, 1439 "jsSizing": function (type) { 1440 "use strict"; 1441 var scrollbarMarginRight = 10, 1442 scrollbarWidthParent, 1443 scrollbarWidthChild, 1444 servicesHeight, 1445 e = window, 1446 a = 'inner', 1447 windowInnerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, 1448 mainTop, 1449 mainHeight, 1450 closeButtonHeight, 1451 headerHeight, 1452 cookiesListHeight, 1453 cookiesCloseHeight, 1454 cookiesTitleHeight, 1455 paddingBox, 1456 alertSmallHeight, 1457 cookiesNumberHeight; 1458 1459 if (type === 'box') { 1460 if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) { 1461 1462 // reset 1463 tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px'); 1464 1465 // calculate 1466 alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight; 1467 cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight; 1468 paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2; 1469 1470 // apply 1471 tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px'); 1472 } 1473 } else if (type === 'main') { 1474 1475 // get the real window width for media query 1476 if (window.innerWidth === undefined) { 1477 a = 'client'; 1478 e = document.documentElement || document.body; 1479 } 1480 1481 // height of the services list container 1482 if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) { 1483 1484 // reset 1485 tarteaucitron.userInterface.css('tarteaucitronServices', 'height', 'auto'); 1486 1487 // calculate 1488 mainHeight = document.getElementById('tarteaucitron').offsetHeight; 1489 closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight; 1490 1491 // apply 1492 servicesHeight = (mainHeight - closeButtonHeight + 2); 1493 tarteaucitron.userInterface.css('tarteaucitronServices', 'height', servicesHeight + 'px'); 1494 tarteaucitron.userInterface.css('tarteaucitronServices', 'overflow-x', 'auto'); 1495 } 1496 1497 // align the main allow/deny button depending on scrollbar width 1498 if (document.getElementById('tarteaucitronServices') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) { 1499 1500 // media query 1501 if (e[a + 'Width'] <= 479) { 1502 //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px'); 1503 } else if (e[a + 'Width'] <= 767) { 1504 scrollbarMarginRight = 12; 1505 } 1506 1507 scrollbarWidthParent = document.getElementById('tarteaucitronServices').offsetWidth; 1508 scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth; 1509 //tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px'); 1510 } 1511 1512 // center the main panel 1513 if (document.getElementById('tarteaucitron') !== null) { 1514 1515 // media query 1516 if (e[a + 'Width'] <= 767) { 1517 mainTop = 0; 1518 } else { 1519 mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21; 1520 } 1521 1522 if (document.getElementById('tarteaucitronMainLineOffset') !== null) { 1523 if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) { 1524 mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight; 1525 } 1526 } 1527 1528 // correct 1529 if (mainTop < 0) { 1530 mainTop = 0; 1531 } 1532 1533 // apply 1534 tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px'); 1535 } 1536 1537 1538 } else if (type === 'cookie') { 1539 1540 // put cookies list at bottom 1541 if (document.getElementById('tarteaucitronAlertSmall') !== null) { 1542 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px'); 1543 } 1544 1545 // height of cookies list 1546 if (document.getElementById('tarteaucitronCookiesListContainer') !== null) { 1547 1548 // reset 1549 tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto'); 1550 1551 // calculate 1552 cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight; 1553 cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight; 1554 cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight; 1555 1556 // apply 1557 tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookie
vendor: 14,683 bytes, lines 1557-1886
1557sListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px'); 1558 } 1559 } 1560 } 1561 }, 1562 "cookie": { 1563 "owner": {}, 1564 "create": function (key, status) { 1565 "use strict"; 1566 1567 if (tarteaucitronForceExpire !== '') { 1568 // The number of day(s)/hour(s) can't be higher than 1 year 1569 if ((tarteaucitronExpireInDay && tarteaucitronForceExpire < 365) || (!tarteaucitronExpireInDay && tarteaucitronForceExpire < 8760)) { 1570 if (tarteaucitronExpireInDay) { 1571 // Multiplication to tranform the number of days to milliseconds 1572 timeExpire = tarteaucitronForceExpire * 86400000; 1573 } else { 1574 // Multiplication to tranform the number of hours to milliseconds 1575 timeExpire = tarteaucitronForceExpire * 3600000; 1576 } 1577 } 1578 } 1579 1580 var d = new Date(), 1581 time = d.getTime(), 1582 expireTime = time + timeExpire, // 365 days 1583 regex = new RegExp("!" + key + "=(wait|true|false)", "g"), 1584 cookie = tarteaucitron.cookie.read().replace(regex, ""), 1585 value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status, 1586 domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? '; domain=' + tarteaucitron.parameters.cookieDomain : '', 1587 secure = location.protocol === 'https:' ? '; Secure' : ''; 1588 1589 d.setTime(expireTime); 1590 document.cookie = value + '; expires=' + d.toGMTString() + '; path=/' + domain + secure + '; samesite=lax'; 1591 }, 1592 "read": function () { 1593 "use strict"; 1594 var nameEQ = tarteaucitron.parameters.cookieName + "=", 1595 ca = document.cookie.split(';'), 1596 i, 1597 c; 1598 1599 for (i = 0; i < ca.length; i += 1) { 1600 c = ca[i]; 1601 while (c.charAt(0) === ' ') { 1602 c = c.substring(1, c.length); 1603 } 1604 if (c.indexOf(nameEQ) === 0) { 1605 return c.substring(nameEQ.length, c.length); 1606 } 1607 } 1608 return ''; 1609 }, 1610 "purge": function (arr) { 1611 "use strict"; 1612 var i; 1613 1614 for (i = 0; i < arr.length; i += 1) { 1615 1616 var rgxpCookie = new RegExp("^(.*;)?\\s*" + arr[i] + "\\s*=\\s*[^;]+(.*)?$"); 1617 if (document.cookie.match(rgxpCookie)) { 1618 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;'; 1619 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';'; 1620 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';'; 1621 } 1622 } 1623 }, 1624 "checkCount": function (key) { 1625 "use strict"; 1626 var arr = tarteaucitron.services[key].cookies, 1627 nb = arr.length, 1628 nbCurrent = 0, 1629 html = '', 1630 i, 1631 status = document.cookie.indexOf(key + '=true'); 1632 1633 if (status >= 0 && nb === 0) { 1634 html += tarteaucitron.lang.useNoCookie; 1635 } else if (status >= 0) { 1636 for (i = 0; i < nb; i += 1) { 1637 if (document.cookie.indexOf(arr[i] + '=') !== -1) { 1638 nbCurrent += 1; 1639 if (tarteaucitron.cookie.owner[arr[i]] === undefined) { 1640 tarteaucitron.cookie.owner[arr[i]] = []; 1641 } 1642 if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) { 1643 tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name); 1644 } 1645 } 1646 } 1647 1648 if (nbCurrent > 0) { 1649 html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' cookie'; 1650 if (nbCurrent > 1) { 1651 html += 's'; 1652 } 1653 html += '.'; 1654 } else { 1655 html += tarteaucitron.lang.useNoCookie; 1656 } 1657 } else if (nb === 0) { 1658 html = tarteaucitron.lang.noCookie; 1659 } else { 1660 html += tarteaucitron.lang.useCookie + ' ' + nb + ' cookie'; 1661 if (nb > 1) { 1662 html += 's'; 1663 } 1664 html += '.'; 1665 } 1666 1667 if (document.getElementById('tacCL' + key) !== null) { 1668 document.getElementById('tacCL' + key).innerHTML = html; 1669 } 1670 }, 1671 "crossIndexOf": function (arr, match) { 1672 "use strict"; 1673 var i; 1674 for (i = 0; i < arr.length; i += 1) { 1675 if (arr[i] === match) { 1676 return true; 1677 } 1678 } 1679 return false; 1680 }, 1681 "number": function () { 1682 "use strict"; 1683 var cookies = document.cookie.split(';'), 1684 nb = (document.cookie !== '') ? cookies.length : 0, 1685 html = '', 1686 i, 1687 name, 1688 namea, 1689 nameb, 1690 c, 1691 d, 1692 s = (nb > 1) ? 's' : '', 1693 savedname, 1694 regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i, 1695 regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn, 1696 host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain; 1697 1698 cookies = cookies.sort(function (a, b) { 1699 namea = a.split('=', 1).toString().replace(/ /g, ''); 1700 nameb = b.split('=', 1).toString().replace(/ /g, ''); 1701 c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0'; 1702 d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0'; 1703 if (c + a > d + b) { return 1; } 1704 if (c + a < d + b) { return -1; } 1705 return 0; 1706 }); 1707 1708 if (document.cookie !== '') { 1709 for (i = 0; i < nb; i += 1) { 1710 name = cookies[i].split('=', 1).toString().replace(/ /g, ''); 1711 if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) { 1712 savedname = tarteaucitron.cookie.owner[name].join(' // '); 1713 html += '<div class="tarteaucitronHidden">'; 1714 html += ' <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">'; 1715 html += ' ' + tarteaucitron.cookie.owner[name].join(' // '); 1716 html += ' </span>'; 1717 html += '</div><ul class="cookie-list">'; 1718 } else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) { 1719 savedname = host; 1720 html += '<div class="tarteaucitronHidden">'; 1721 html += ' <span class="tarteaucitronTitle tarteaucitronH3" role="heading" aria-level="3">'; 1722 html += ' ' + host; 1723 html += ' </span>'; 1724 html += '</div><ul class="cookie-list">'; 1725 } 1726 html += '<li class="tarteaucitronCookiesListMain">'; 1727 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>'; 1728 html += ' </div>'; 1729 html += ' <div class="tarteaucitronCookiesListRight">' + tarteaucitron.fixSelfXSS(cookies[i].split('=').slice(1).join('=')) + '</div>'; 1730 html += '</li>'; 1731 } 1732 html += '</ul>'; 1733 } else { 1734 html += '<div class="tarteaucitronCookiesListMain">'; 1735 html += ' <div class="tarteaucitronCookiesListLeft"><strong>-</strong></div>'; 1736 html += ' <div class="tarteaucitronCookiesListRight"></div>'; 1737 html += '</div>'; 1738 } 1739 1740 html += '<div class="tarteaucitronHidden tarteaucitron-spacer-20"></div>'; 1741 1742 if (document.getElementById('tarteaucitronCookiesList') !== null) { 1743 document.getElementById('tarteaucitronCookiesList').innerHTML = html; 1744 } 1745 1746 if (document.getElementById('tarteaucitronCookiesNumber') !== null) { 1747 document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb; 1748 document.getElementById('tarteaucitronCookiesNumber').setAttribute("aria-label", nb + ' cookie' + s + " - " + tarteaucitron.lang.toggleInfoBox); 1749 document.getElementById('tarteaucitronCookiesNumber').setAttribute("title", nb + ' cookie' + s + " - " + tarteaucitron.lang.toggleInfoBox); 1750 } 1751 1752 if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) { 1753 document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s; 1754 } 1755 1756 var purgeBtns = document.getElementsByClassName("purgeBtn"); 1757 for (i = 0; i < purgeBtns.length; i++) { 1758 tarteaucitron.addClickEventToElement(purgeBtns[i], function () { 1759 tarteaucitron.cookie.purge([this.dataset.cookie]); 1760 tarteaucitron.cookie.number(); 1761 tarteaucitron.userInterface.jsSizing('cookie'); 1762 return false; 1763 }); 1764 } 1765 1766 for (i = 0; i < tarteaucitron.job.length; i += 1) { 1767 tarteaucitron.cookie.checkCount(tarteaucitron.job[i]); 1768 } 1769 } 1770 }, 1771 "fixSelfXSS": function(html) { 1772 return html.toString().replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"); 1773 }, 1774 "getLanguage": function () { 1775 "use strict"; 1776 1777 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', 1778 defaultLanguage = 'en'; 1779 1780 if (tarteaucitronForceLanguage !== '') { 1781 if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) { 1782 return tarteaucitronForceLanguage; 1783 } 1784 } 1785 1786 if (!navigator) { return 'en'; } 1787 1788 var lang = navigator.language || navigator.browserLanguage || 1789 navigator.systemLanguage || navigator.userLang || null, 1790 userLanguage = lang ? lang.substr(0, 2) : null; 1791 1792 if (availableLanguages.indexOf(userLanguage) === -1) { 1793 return defaultLanguage; 1794 } 1795 return userLanguage; 1796 }, 1797 "getLocale": function () { 1798 "use strict"; 1799 if (!navigator) { return 'en_US'; } 1800 1801 var lang = navigator.language || navigator.browserLanguage || 1802 navigator.systemLanguage || navigator.userLang || null, 1803 userLanguage = lang ? lang.substr(0, 2) : null; 1804 1805 if (userLanguage === 'fr') { 1806 return 'fr_FR'; 1807 } else if (userLanguage === 'en') { 1808 return 'en_US'; 1809 } else if (userLanguage === 'de') { 1810 return 'de_DE'; 1811 } else if (userLanguage === 'es') { 1812 return 'es_ES'; 1813 } else if (userLanguage === 'it') { 1814 return 'it_IT'; 1815 } else if (userLanguage === 'pt') { 1816 return 'pt_PT'; 1817 } else if (userLanguage === 'nl') { 1818 return 'nl_NL'; 1819 } else if (userLanguage === 'el') { 1820 return 'el_EL'; 1821 } else { 1822 return 'en_US'; 1823 } 1824 }, 1825 "addScript": function (url, id, callback, execute, attrName, attrVal, internal) { 1826 "use strict"; 1827 var script, 1828 done = false; 1829 1830 if (execute === false) { 1831 if (typeof callback === 'function') { 1832 callback(); 1833 } 1834 } else { 1835 script = document.createElement('script'); 1836 script.id = (id !== undefined) ? id : ''; 1837 script.async = true; 1838 script.src = url; 1839 1840 if (attrName !== undefined && attrVal !== undefined) { 1841 script.setAttribute(attrName, attrVal); 1842 } 1843 1844 if (typeof callback === 'function') { 1845 if ( !tarteaucitron.parameters.useExternalJs || !internal ) { 1846 script.onreadystatechange = script.onload = function () { 1847 var state = script.readyState; 1848 if (!done && (!state || /loaded|complete/.test(state))) { 1849 done = true; 1850 callback(); 1851 } 1852 }; 1853 } else { 1854 callback(); 1855 } 1856 } 1857 1858 if ( !tarteaucitron.parameters.useExternalJs || !internal ) { 1859 document.getElementsByTagName('head')[0].appendChild(script); 1860 } 1861 } 1862 }, 1863 "addInternalScript": function (url, id, callback, execute, attrName, attrVal) { 1864 tarteaucitron.addScript(url, id, callback, execute, attrName, attrVal, true); 1865 }, 1866 "checkIfExist": function (elemId) { 1867 "use strict"; 1868 return document.getElementById(elemId) !== null && document.getElementById(elemId).offsetWidth !== 0 && document.getElementById(elemId).offsetHeight !== 0; 1869 }, 1870 "makeAsync": { 1871 "antiGhost": 0, 1872 "buffer": '', 1873 "init": function (url, id) { 1874 "use strict"; 1875 var savedWrite = document.write, 1876 savedWriteln = document.writeln; 1877 1878 document.write = function (content) { 1879 tarteaucitron.makeAsync.buffer += content; 1880 }; 1881 document.writeln = function (content) { 1882 tarteaucitron.makeAsync.buffer += content.concat("\n"); 1883 }; 1884 1885 setTimeout(function () { 1886 document.write = savedWrite;
1887 document.writeln = savedWriteln; 1888 }, 20000); 1889 1890 tarteaucitron.makeAsync.getAndParse(url, id); 1891 }, 1892 "getAndParse": function (url, id) { 1893 "use strict"; 1894 if (tarteaucitron.makeAsync.antiGhost > 9) { 1895 tarteaucitron.makeAsync.antiGhost = 0; 1896 return; 1897 } 1898 tarteaucitron.makeAsync.antiGhost += 1; 1899 tarteaucitron.addInternalScript(url, '', function () { 1900 if (document.getElementById(id) !== null) { 1901 document.getElementById(id).innerHTML += "<span class='tarteaucitron-display-none'> </span>" + tarteaucitron.makeAsync.buffer; 1902 tarteaucitron.makeAsync.buffer = ''; 1903 tarteaucitron.makeAsync.execJS(id); 1904 } 1905 }); 1906 }, 1907 "execJS": function (id) { 1908 /* not strict because third party scripts may have errors */ 1909 var i, 1910 scripts, 1911 childId, 1912 type; 1913 1914 if (document.getElementById(id) === null) { 1915 return; 1916 } 1917 1918 scripts = document.getElementById(id).getElementsByTagName('script'); 1919 for (i = 0; i < scripts.length; i += 1) { 1920 type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : ''; 1921 if (type === '') { 1922 type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : ''; 1923 } 1924 if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') { 1925 childId = id + Math.floor(Math.random() * 99999999999); 1926 document.getElementById(id).innerHTML += '<div id="' + childId + '"></div>'; 1927 tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId); 1928 } else if (type.indexOf('javascript') !== -1 || type === '') { 1929 eval(scripts[i].innerHTML); 1930 } 1931 } 1932 } 1933 }, 1934 "fallback": function (matchClass, content, noInner) { 1935 "use strict"; 1936 var elems = document.getElementsByTagName('*'), 1937 i, 1938 index = 0; 1939 1940 for (i in elems) { 1941 if (elems[i] !== undefined) { 1942 for (index = 0; index < matchClass.length; index += 1) { 1943 if ((' ' + elems[i].className + ' ') 1944 .indexOf(' ' + matchClass[index] + ' ') > -1) { 1945 if (typeof content === 'function') { 1946 if (noInner === true) { 1947 content(elems[i]); 1948 } else { 1949 elems[i].innerHTML = content(elems[i]); 1950 } 1951 } else { 1952 elems[i].innerHTML = content; 1953 } 1954 } 1955 } 1956 } 1957 } 1958 }, 1959 "engage": function (id) { 1960 "use strict"; 1961 var html = '', 1962 r = Math.floor(Math.random() * 100000), 1963 engage = tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback; 1964 1965 if (tarteaucitron.lang['engage-' + id] !== undefined) { 1966 engage = tarteaucitron.lang['engage-' + id]; 1967 } 1968 1969 html += '<div class="tac_activate tac_activate_' + id + '">'; 1970 html += ' <div class="tac_float">'; 1971 html += ' ' + engage; 1972 html += ' <button type="button" class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '">'; 1973 html += ' <span class="tarteaucitronCheck"></span> ' + tarteaucitron.lang.allow; 1974 html += ' </button>'; 1975 html += ' </div>'; 1976 html += '</div>'; 1977 1978 return html; 1979 }, 1980 "extend": function (a, b) { 1981 "use strict"; 1982 var prop; 1983 for (prop in b) { 1984 if (b.hasOwnProperty(prop)) { 1985 a[prop] = b[prop]; 1986 } 1987 } 1988 }, 1989 "proTemp": '', 1990 "proTimer": function () { 1991 "use strict"; 1992 setTimeout(tarteaucitron.proPing, 500); 1993 }, 1994 "pro": function (list) { 1995 "use strict"; 1996 tarteaucitron.proTemp += list; 1997 clearTimeout(tarteaucitron.proTimer); 1998 tarteaucitron.proTimer = setTimeout(tarteaucitron.proPing, 500); 1999 }, 2000 "proPing": function () { 2001 "use strict"; 2002 if (tarteaucitron.uuid !== '' && tarteaucitron.uuid !== undefined && tarteaucitron.proTemp !== '' && tarteaucitronStatsEnabled) { 2003 var div = document.getElementById('tarteaucitronPremium'), 2004 timestamp = new Date().getTime(), 2005 url = 'https://tarteaucitron.io/log/?'; 2006 2007 if (div === null) { 2008 return; 2009 } 2010 2011 url += 'account=' + tarteaucitron.uuid + '&'; 2012 url += 'domain=' + tarteaucitron.domain + '&'; 2013 url += 'status=' + encodeURIComponent(tarteaucitron.proTemp) + '&'; 2014 url += '_time=' + timestamp; 2015 2016 div.innerHTML = '<img src="' + url + '" class="tarteaucitron-display-none" alt="" />'; 2017 2018 tarteaucitron.proTemp = ''; 2019 } 2020 2021 tarteaucitron.cookie.number(); 2022 }, 2023 "AddOrUpdate" : function(source, custom){ 2024 /** 2025 Utility function to Add or update the fields of obj1 with the ones in obj2 2026 */ 2027 for(var key in custom){ 2028 if(custom[key] instanceof Object){ 2029 source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]); 2030 }else{ 2031 source[key] = custom[key]; 2032 } 2033 } 2034 return source; 2035 }, 2036 "getElemWidth": function(elem) { 2037 return elem.getAttribute('width') || elem.clientWidth; 2038 }, 2039 "getElemHeight": function(elem) { 2040 return elem.getAttribute('height') || elem.clientHeight; 2041 }, 2042 "getElemAttr": function (elem, attr) { 2043 return elem.getAttribute('data-' + attr) || elem.getAttribute(attr); 2044 }, 2045 "addClickEventToId": function (elemId, func) { 2046 tarteaucitron.addClickEventToElement(document.getElementById(elemId), func); 2047 }, 2048 "addClickEventToElement": function (e, func) { 2049 if (e) { 2050 if (e.addEventListener) { 2051 e.addEventListener("click", func); 2052 } else { 2053 e.attachEvent("onclick", func); 2054 } 2055 } 2056 }, 2057 "triggerJobsAfterAjaxCall": function() { 2058 tarteaucitron.job.forEach(function(e) { tarteaucitron.job.push(e) }); 2059 var i; 2060 var allowBtns = document.getElementsByClassName("tarteaucitronAllow"); 2061 for (i = 0; i < allowBtns.length; i++) { 2062 tarteaucitron.addClickEventToElement(allowBtns[i], function () { 2063 tarteaucitron.userInterface.respond(this, true); 2064 }); 2065 } 2066 var denyBtns = document.getElementsByClassName("tarteaucitronDeny"); 2067 for (i = 0; i < denyBtns.length; i++) { 2068 tarteaucitron.addClickEventToElement(denyBtns[i], function () { 2069 tarteaucitron.userInterface.respond(this, false); 2070 }); 2071 } 2072 } 2073};
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.