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