1/*jslint browser: true, evil: true */ 2 3// define correct path for files inclusion 4var scripts = document.getElementsByTagName('script'), 5 path = scripts[scripts.length - 1].src.split('?')[0], 6 cdn = path.split('/').slice(0, -1).join('/') + '/', 7 alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch, 8 tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage, 9 tarteaucitronProLoadServices, 10 tarteaucitronNoAdBlocker = false; 11 12var tarteaucitron = { 13 "version": 323, 14 "cdn": cdn, 15 "user": {}, 16 "lang": {}, 17 "services": {}, 18 "added": [], 19 "idprocessed": [], 20 "state": [], 21 "launch": [], 22 "parameters": {}, 23 "isAjax": false, 24 "reloadThePage": false, 25 "init": function (params) { 26 "use strict"; 27 var origOpen; 28 29 tarteaucitron.parameters = params; 30 if (alreadyLaunch === 0) { 31 alreadyLaunch = 1; 32 if (window.addEventListener) { 33 window.addEventListener("load", function () { 34 tarteaucitron.load(); 35 tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) { 36 elem.addEventListener("click", function (event) { 37 tarteaucitron.userInterface.openPanel
37(); 38 event.preventDefault(); 39 }, false); 40 }, true); 41 }, false); 42 window.addEventListener("scroll", function () { 43 var scrollPos = window.pageYOffset || document.documentElement.scrollTop, 44 heightPosition; 45 /* if (document.getElementById('tarteaucitronAlertBig') !== null && !tarteaucitron.highPrivacy) { 46 if (document.getElementById('tarteaucitronAlertBig').style.display === 'block') { 47 heightPosition = document.getElementById('tarteaucitronAlertBig').offsetHeight + 'px'; 48 49 if (scrollPos > (screen.height * 2)) { 50 tarteaucitron.userInterface.respondAll(true); 51 } else if (scrollPos > (screen.height / 2)) { 52 document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '<b>' + tarteaucitron.lang.alertBigScroll + '</b> ' + tarteaucitron.lang.alertBig; 53 } 54 55 if (tarteaucitron.orientation === 'top') { 56 document.getElementById('tarteaucitronPercentage').style.top = heightPosition; 57 } else { 58 document.getElementById('tarteaucitronPercentage').style.bottom = heightPosition; 59 } 60 document.getElementById('tarteaucitronPercentage').style.width = ((100 / (screen.height * 2)) * scrollPos) + '%'; 61 } 62 } */ 63 }, false); 64 window.addEventListener("keydown", function (evt) { 65 if (evt.keyCode === 27) { 66 tarteaucitron.userInterface.closePanel(); 67 } 68 }, false); 69 window.addEventListener("hashchange", function () { 70 if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
71 tarteaucitron.userInterface.openPanel(); 72 } 73 }, false); 74 window.addEventListener("resize", function () { 75 if (document.getElementById('tarteaucitron') !== null) { 76 if (document.getElementById('tarteaucitron').style.display === 'block') { 77 tarteaucitron.userInterface.jsSizing('main'); 78 } 79 } 80 81 if (document.getElementById('tarteaucitronCookiesListContainer') !== null) { 82 if (document.getElementById('tarteaucitronCookiesListContainer').style.display === 'block') { 83 tarteaucitron.userInterface.jsSizing('cookie'); 84 } 85 } 86 }, false); 87 } else { 88 window.attachEvent("onload", function () { 89 tarteaucitron.load(); 90 tarteaucitron.fallback(['tarteaucitronOpenPanel'], function (elem) { 91 elem.attachEvent("onclick", function (event) { 92 tarteaucitron.userInterface.openPanel
92(); 93 event.preventDefault(); 94 }); 95 }, true); 96 }); 97 window.attachEvent("onscroll", function () { 98 var scrollPos = window.pageYOffset || document.documentElement.scrollTop, 99 heightPosition; 100 if (document.getElementById('tarteaucitronAlertBig') !== null && !tarteaucitron.highPrivacy) { 101 if (document.getElementById('tarteaucitronAlertBig').style.display === 'block') { 102 heightPosition = document.getElementById('tarteaucitronAlertBig').offsetHeight + 'px'; 103 104 if (scrollPos > (screen.height * 2)) { 105 tarteaucitron.userInterface.respondAll(true); 106 } else if (scrollPos > (screen.height / 2)) { 107 document.getElementById('tarteaucitronDisclaimerAlert').innerHTML = '<b>' + tarteaucitron.lang.alertBigScroll + '</b> ' + tarteaucitron.lang.alertBig; 108 } 109 if (tarteaucitron.orientation === 'top') { 110 document.getElementById('tarteaucitronPercentage').style.top = heightPosition; 111 } else { 112 document.getElementById('tarteaucitronPercentage').style.bottom = heightPosition; 113 } 114 document.getElementById('tarteaucitronPercentage').style.width = ((100 / (screen.height * 2)) * scrollPos) + '%'; 115 } 116 } 117 }); 118 window.attachEvent("onkeydown", function (evt) { 119 if (evt.keyCode === 27) { 120 tarteaucitron.userInterface.closePanel(); 121 } 122 }); 123 window.attachEvent("onhashchange", function () { 124 if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') {
125 tarteaucitron.userInterface.openPanel(); 126 } 127 }); 128 window.attachEvent("onresize", function () { 129 if (document.getElementById('tarteaucitron') !== null) { 130 if (document.getElementById('tarteaucitron').style.display === 'block') { 131 tarteaucitron.userInterface.jsSizing('main'); 132 } 133 } 134 135 if (document.getElementById('tarteaucitronCookiesListContainer') !== null) { 136 if (document.getElementById('tarteaucitronCookiesListContainer').style.display === 'block') { 137 tarteaucitron.userInterface.jsSizing('cookie'); 138 } 139 } 140 }); 141 } 142 143 if (typeof XMLHttpRequest !== 'undefined') { 144 origOpen = XMLHttpRequest.prototype.open; 145 XMLHttpRequest.prototype.open = function () { 146 147 if (window.addEventListener) { 148 this.addEventListener("load", function () { 149 if (typeof tarteaucitronProLoadServices === 'function') { 150 tarteaucitronProLoadServices(); 151 } 152 }, false); 153 } else if (typeof this.attachEvent !== 'undefined') { 154 this.attachEvent("onload", function () { 155 if (typeof tarteaucitronProLoadServices === 'function') { 156 tarteaucitronProLoadServices(); 157 } 158 }); 159 } else { 160 if (typeof tarteaucitronProLoadServices === 'function') { 161 setTimeout(tarteaucitronProLoadServices, 1000); 162 } 163 } 164 165 try { 166 origOpen.apply(this, arguments); 167 } catch (err) {} 168 }; 169 } 170 } 171 }, 172 "load": function () { 173 "use strict"; 174 var cdn = tarteaucitron.cdn, 175 language = tarteaucitron.getLanguage(), 176 pathToLang = cdn + 'lang/tarteaucitron.' + language + '.js?v=' + tarteaucitron.version, 177 pathToServices = cdn + 'tarteaucitron.services.js?v=43452331' + tarteaucitron.version, 178 linkElement = document.createElement('link'), 179 defaults = { 180 "adblocker": false, 181 "hashtag": '#tarteaucitron', 182 "highPrivacy": false, 183 "orientation": "top", 184 "removeCredit": false, 185 "showAlertSmall": true, 186 "cookieslist": true, 187 "privacyUrl": '#' 188 }, 189 params = tarteaucitron.parameters; 190 191 // Step 0: get params 192 if (params !== undefined) { 193 tarteaucitron.extend(defaults, params); 194 } 195 196 // global 197 tarteaucitron.orientation = defaults.orientation; 198 tarteaucitron.hashtag = defaults.hashtag; 199 tarteaucitron.highPrivacy = defaults.highPrivacy; 200 tarteaucitron.privacyUrl = defaults.privacyUrl; 201 202 // Step 1: load css 203 linkElement.rel = 'stylesheet'; 204 linkElement.type = 'text/css'; 205 linkElement.href = cdn + 'css/tarteaucitron.css?v=' + tarteaucitron.version; 206 document.getElementsByTagName('head')[0].appendChild(linkElement); 207 208 // Step 2: load language and services 209 tarteaucitron.addScript(pathToLang, '', function () { 210 tarteaucitron.addScript(pathToServices, '', function () { 211 212 var body = document.body, 213 div = document.createElement('div'), 214 html = '', 215 index, 216 orientation = 'Top', 217 cat = ['ads', 'analytic', 'api', 'comment', 'social', 'work', 'support', 'video', 'other'], 218 i; 219 220 cat = cat.sort(function (a, b) { 221 if (tarteaucitron.lang[a].title > tarteaucitron.lang[b].title) { return 1; } 222 if (tarteaucitron.lang[a].title < tarteaucitron.lang[b].title) { return -1; } 223 return 0; 224 }); 225 226 // Step 3: prepare the html 227 html += '<div id="tarteaucitronPremium"></div>'; 228 html += '<div id="tarteaucitronBack" onclick="tarteaucitron.userInterface.closePanel();"></div>'; 229 html += '<div id="tarteaucitron">'; 230 html += ' <div id="tarteaucitronClosePanel" onclick="tarteaucitron.userInterface.closePanel();">'; 231 html += ' ' + tarteaucitron.lang.close; 232 html += ' </div>'; 233 html += ' <div id="tarteaucitronServices">'; 234 html += ' <div class="tarteaucitronLine tarteaucitronMainLine" id="tarteaucitronMainLineOffset">'; 235 html += ' <div class="tarteaucitronName">'; 236 html += ' <b><a href="#" onclick="tarteaucitron.userInterface.toggle(\'tarteaucitronInfo\', \'tarteaucitronInfoBox\');return false">✛</a> ' + tarteaucitron.lang.all + '</b>'; 237 html += ' </div>'; 238 html += ' <div class="tarteaucitronAsk" id="tarteaucitronScrollbarAdjust">'; 239 html += ' <div id="tarteaucitronAllAllowed" class="tarteaucitronAllow" onclick="tarteaucitron.userInterface.respondAll(true);">'; 240 html += ' ✓ ' + tarteaucitron.lang.allow; 241 html += ' </div> '; 242 html += ' <div id="tarteaucitronAllDenied" class="tarteaucitronDeny" onclick="tarteaucitron.userInterface.respondAll(false);">'; 243 html += ' ✗ ' + tarteaucitron.lang.deny; 244 html += ' </div>'; 245 html += ' </div>'; 246 html += ' </div>'; 247 html += ' <div id="tarteaucitronInfo" class="tarteaucitronInfoBox">'; 248 html += ' ' + tarteaucitron.lang.disclaimer; 249 if (defaults.removeCredit === false) { 250 html += ' <br/><br/>'; 251 html += ' <a href="https://opt-out.ferank.eu/" rel="nofollow" target="_blank" rel="noopener">' + tarteaucitron.lang.credit + '</a>'; 252 } 253 html += ' </div>'; 254 html += ' <div class="tarteaucitronBorder" id="tarteaucitronScrollbarParent">'; 255 html += ' <div class="clear"></div>'; 256 for (i = 0; i < cat.length; i += 1) { 257 html += ' <div id="tarteaucitronServicesTitle_' + cat[i] + '" class="tarteaucitronHidden">'; 258 html += ' <div class="tarteaucitronTitle">'; 259 html += ' <a href="#" onclick="tarteaucitron.userInterface.toggle(\'tarteaucitronDetails' + cat[i] + '\', \'tarteaucitronInfoBox\');return false">✛</a> ' + tarteaucitron.lang[cat[i]].title; 260 html += ' </div>'; 261 html += ' <div id="tarteaucitronDetails' + cat[i] + '" class="tarteaucitronDetails tarteaucitronInfoBox">'; 262 html += ' ' + tarteaucitron.lang[cat[i]].details; 263 html += ' </div>'; 264 html += ' </div>'; 265 html += ' <div id="tarteaucitronServices_' + cat[i] + '"></div>'; 266 } 267 html += ' <div class="tarteaucitronHidden butn
267obg" id="tarteaucitronScrollbarChild" style="height:20px;display:block"><p>KészÃtette: <a href="https://webraketa.hu/" target="_blank">Webrakéta Kft.</a></p></div>'; 268 html += ' </div>'; 269 html += ' </div>'; 270 html += '</div>'; 271 272 if (defaults.orientation === 'bottom') { 273 orientation = 'Bottom'; 274 } 275 276 if (defaults.highPrivacy) { 277 html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">'; 278 html += ' <span id="tarteaucitronDisclaimerAlert">'; 279 html += ' ' + tarteaucitron.lang.alertBigPrivacy; 280 html += ' </span>'; 281 html += ' <span id="tarteaucitronPersonalize" onclick="tarteaucitron.userInterface.openPanel();">'; 282 html += ' ' + tarteaucitron.lang.personalize; 283 html += ' </span>'; 284 html += '</div>'; 285 } else { 286 html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">'; 287 html += ' <span id="tarteaucitronDisclaimerAlert"><p>'; 288 html += ' ' + bevezeto; 289 html += ' </p></span>'; 290 html += ' <span id="tarteaucitronPersonalize" onclick="tarteaucitron.userInterface.respondAll(true);">'; 291 html += ' ✓ ' + igen_gomb; 292 html += ' </span>'; 293 html += ' <span id="tarteaucitronCloseAlert" onclick="tarteaucitron.userInterface.openPanel
293();">'; 294 html += ' ' + nem_gomb; 295 html += ' </span>'; 296 html += ' <span id="tarteaucitronadvedlink" onClick="var exdate=new Date();exdate.setDate(exdate.getDate()-1);document.cookie=' + "'" + 'tarteaucitron=;expires=' + "'" + '+exdate.toUTCString()+' + "'" + ';path=/; domain=' + tarteaucitron.parameters.cookieDomain + "'" + ';">'; 297 html += ' ' + '<a href="' + tarteaucitron.privacyUrl + '">' + adatvedelem_gomb + '</a>'; 298 html += ' </span>'; 299 html += '</div>'; 300 html += '<div id="tarteaucitronPercentage"><div class="gdpr-overlay" style="display: block;"></div></div>'; 301 } 302 303 if (defaults.showAlertSmall === true) { 304 html += '<div id="tarteaucitronAlertSmall">'; 305 html += ' <div id="tarteaucitronManager" onclick="tarteaucitron.userInterface.openPanel();">'; 306 // html += ' ' + tarteaucitron.lang.alertSmall; 307 html += ' <i class="fa fa-2x text-white fa-cog "></i>'; 308 html += ' <div id="tarteaucitronDot">'; 309 html += ' <span id="tarteaucitronDotGreen"></span>'; 310 html += ' <span id="tarteaucitronDotYellow"></span>'; 311 html += ' <span id="tarteaucitronDotRed"></span>'; 312 html += ' </div>'; 313 if (defaults.cookieslist === true) { 314 html += ' </div><!-- @whitespace'; 315 html += ' --><div id="tarteaucitronCookiesNumber" onclick="tarteaucitron.userInterface.toggleCookiesList();">0</div>'; 316 html += ' <div id="tarteaucitronCookiesListContainer">'; 317 html += ' <div id="tarteaucitronClosePanelCookie" onclick="tarteaucitron.userInterface.closePanel();">'; 318 html += ' ' + tarteaucitron.lang.close; 319 html += ' </div>'; 320 html += ' <div class="tarteaucitronCookiesListMain" id="tarteaucitronCookiesTitle">'; 321 html += ' <b id="tarteaucitronCookiesNumberBis">0 cookie</b>'; 322 html += ' </div>'; 323 html += ' <div id="tarteaucitronCookiesList"></div>'; 324 html += ' </div>'; 325 } else { 326 html += ' </div>'; 327 } 328 html += '</div>'; 329 } 330 331 tarteaucitron.addScript(tarteaucitron.cdn + 'advertising.js?v=' + tarteaucitron.version, '', function () { 332 if (tarteaucitronNoAdBlocker === true || defaults.adblocker === false) { 333 div.id = 'tarteaucitronRoot'; 334 body.appendChild(div, body); 335 div.innerHTML = html; 336 337 if (tarteaucitron.job !== undefined) { 338 tarteaucitron.job = tarteaucitron.cleanArray(tarteaucitron.job); 339 for (index = 0; index < tarteaucitron.job.length; index += 1) { 340 tarteaucitron.addService(tarteaucitron.job[index]); 341 } 342 } 343 344 tarteaucitron.isAjax = true; 345 tarteaucitron.job.push = function (id) { 346 347 // ie <9 hack 348 if (typeof tarteaucitron.job.indexOf === 'undefined') { 349 tarteaucitron.job.indexOf = function (obj, start) { 350 var i, 351 j = this.length; 352 for (i = (start || 0); i < j; i += 1) { 353 if (this[i] === obj) { return i; } 354 } 355 return -1; 356 }; 357 } 358 359 if (tarteaucitron.job.indexOf(id) === -1) { 360 Array.prototype.push.call(this, id); 361 }
362 tarteaucitron.launch[id] = false; 363 tarteaucitron.addService(id); 364 }; 365 366 if (document.location.hash === tarteaucitron.hashtag && tarteaucitron.hashtag !== '') { 367 tarteaucitron.userInterface.openPanel(); 368 } 369 370 tarteaucitron.cookie.number(); 371 setInterval(tarteaucitron.cookie.number, 60000); 372 } 373 }, defaults.adblocker); 374 375 if (defaults.adblocker === true) { 376 setTimeout(function () { 377 if (tarteaucitronNoAdBlocker === false) { 378 html = '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '" style="display:block">'; 379 html += ' <span id="tarteaucitronDisclaimerAlert">'; 380 html += ' ' + tarteaucitron.lang.adblock + '<br/>'; 381 html += ' <b>' + tarteaucitron.lang.adblock_call + '</b>'; 382 html += ' </span>'; 383 html += ' <span id="tarteaucitronPersonalize" onclick="location.reload();">'; 384 html += ' ' + tarteaucitron.lang.reload; 385 html += ' </span>'; 386 html += '</div>'; 387 html += '<div id="tarteaucitronPremium"></div>'; 388 div.id = 'tarteaucitronRoot'; 389 body.appendChild(div, body); 390 div.innerHTML = html; 391 tarteaucitron.pro('!adblocker=true'); 392 } else { 393 tarteaucitron.pro('!adblocker=false'); 394 } 395 }, 1500); 396 } 397 }); 398 }); 399 }, 400 "addService": function (serviceId) { 401 "use strict"; 402 var html = '', 403 s = tarteaucitron.services, 404 service = s[serviceId], 405 cookie = tarteaucitron.cookie.read(), 406 hostname = document.location.hostname, 407 hostRef = document.referrer.split('/')[2], 408 isNavigating = (hostRef === hostname) ? true : false, 409 isAutostart = (!service.needConsent) ? true : false, 410 isWaiting = (cookie.indexOf(service.key + '=wait') >= 0) ? true : false, 411 isDenied = (cookie.indexOf(service.key + '=false') >= 0) ? true : false, 412 isAllowed = (cookie.indexOf(service.key + '=true') >= 0) ? true : false, 413 isResponded = (cookie.indexOf(service.key + '=false') >= 0 || cookie.indexOf(service.key + '=true') >= 0) ? true : false; 414 415 if (tarteaucitron.added[service.key] !== true) { 416 tarteaucitron.added[service.key] = true; 417 418 html += '<div id="' + service.key + 'Line" class="tarteaucitronLine">'; 419 html += ' <div class="tarteaucitronName">'; 420 html += ' <b>' + service.name + '</b><br/>'; 421 html += ' <span id="tacCL' + service.key + '" class="tarteaucitronListCookies"></span><br/>'; 422 // html += ' <a href="https://opt-out.ferank.eu/service/' + service.key + '/" target="_blank" rel="noopener">'; 423 // html += ' ' + tarteaucitron.lang.more; 424 // html += ' </a>'; 425 // html += ' - '; 426 427 if ( service.uri != "") { 428 html += ' <a href="' + service.uri + '" target="_blank" rel="noopener">'; 429 html += ' ' + tarteaucitron.lang.source; 430 html += ' </a>'; 431 } 432 433 html += ' </div>'; 434 html += ' <div class="tarteaucitronAsk">'; 435 html += ' <div id="' + service.key + 'Allowed" class="tarteaucitronAllow" onclick="tarteaucitron.userInterface.respond(this, true);">'; 436 html += ' ✓ ' + tarteaucitron.lang.allow; 437 html += ' </div> '; 438 html += ' <div id="' + service.key + 'Denied" class="tarteaucitronDeny" onclick="tarteaucitron.userInterface.respond(this, false);">'; 439 html += ' ✗ ' + tarteaucitron.lang.deny; 440 html += ' </div>'; 441 html += ' </div>'; 442 html += '</div>'; 443 444 tarteaucitron.userInterface.css('tarteaucitronServicesTitle_' + service.type, 'display', 'block'); 445 446 if (document.getElementById('tarteaucitronServices_' + service.type) !== null) { 447 document.getElementById('tarteaucitronServices_' + service.type).innerHTML += html; 448 } 449 450 tarteaucitron.userInterface.order(service.type); 451 } 452 453 // allow by default for non EU 454 if (isResponded === false && tarteaucitron.user.bypass === true) { 455 isAllowed = true; 456 tarteaucitron.cookie.create(service.key, true); 457 } 458 459 if ((!isResponded && (isAutostart || (isNavigating && isWaiting)) && !tarteaucitron.highPrivacy) || isAllowed) { 460 if (!isAllowed) { 461 tarteaucitron.cookie.create(service.key, true); 462 }
463 if (tarteaucitron.launch[service.key] !== true) { 464 tarteaucitron.launch[service.key] = true; 465 service.js(); 466 } 467 tarteaucitron.state[service.key] = true; 468 tarteaucitron.userInterface.color(service.key, true); 469 } else if (isDenied) { 470 if (typeof service.fallback === 'function') { 471 service.fallback(); 472 } 473 tarteaucitron.state[service.key] = false; 474 tarteaucitron.userInterface.color(service.key, false); 475 } else if (!isResponded) { 476 tarteaucitron.cookie.create(service.key, 'wait'); 477 if (typeof service.fallback === 'function') { 478 service.fallback(); 479 } 480 tarteaucitron.userInterface.color(service.key, 'wait'); 481 tarteaucitron.userInterface.openAlert(); 482 } 483 484 tarteaucitron.cookie.checkCount(service.key); 485 }, 486 "cleanArray": function cleanArray(arr) { 487 "use strict"; 488 var i, 489 len = arr.length, 490 out = [], 491 obj = {}, 492 s = tarteaucitron.services; 493 494 for (i = 0; i < len; i += 1) { 495 if (!obj[arr[i]]) { 496 obj[arr[i]] = {}; 497 if (tarteaucitron.services[arr[i]] !== undefined) { 498 out.push(arr[i]); 499 } 500 } 501 } 502 503 out = out.sort(function (a, b) { 504 if (s[a].type + s[a].key > s[b].type + s[b].key) { return 1; } 505 if (s[a].type + s[a].key < s[b].type + s[b].key) { return -1; } 506 return 0; 507 }); 508 509 return out; 510 }, 511 "userInterface": { 512 "css": function (id, property, value) { 513 "use strict"; 514 if (document.getElementById(id) !== null) { 515 document.getElementById(id).style[property] = value; 516 } 517 }, 518 "respondAll": function (status) { 519 "use strict"; 520 var s = tarteaucitron.services, 521 service, 522 key, 523 index = 0; 524 525 for (index = 0; index < tarteaucitron.job.length; index += 1) { 526 service = s[tarteaucitron.job[index]]; 527 key = service.key; 528 if (tarteaucitron.state[key] !== status) { 529 if (status === false && tarteaucitron.launch[key] === true) { 530 tarteaucitron.reloadThePage = true; 531 } 532 if (tarteaucitron.launch[key] !== true && status === true) { 533 tarteaucitron.launch[key] = true; 534 tarteaucitron.services[key].js(); 535 } 536 tarteaucitron.state[key] = status; 537 tarteaucitron.cookie.create(key, status); 538 tarteaucitron.userInterface.color(key, status); 539 } 540 } 541 }, 542 "respond": function (el, status) { 543 "use strict"; 544 var key = el.id.replace(new RegExp("(Eng[0-9]+|Allow|Deni)ed", "g"), ''); 545 546 // return if same state 547 if (tarteaucitron.state[key] === status) { 548 return; 549 } 550 551 if (status === false && tarteaucitron.launch[key] === true) { 552 tarteaucitron.reloadThePage = true; 553 } 554 555 // if not already launched... launch the service 556 if (status === true) { 557 if (tarteaucitron.launch[key] !== true) { 558 tarteaucitron.launch[key] = true; 559 tarteaucitron.services[key].js(); 560 } 561 } 562 tarteaucitron.state[key] = status; 563 tarteaucitron.cookie.create(key, status); 564 tarteaucitron.userInterface.color(key, status); 565 }, 566 "color": function (key, status) { 567 "use strict"; 568 var gray = '#808080', 569 greenDark = '#1B870B', 570 greenLight = '#E6FFE2',
571 redDark = '#9C1A1A', 572 redLight = '#FFE2E2', 573 yellowDark = '#FBDA26', 574 c = 'tarteaucitron', 575 nbDenied = 0, 576 nbPending = 0, 577 nbAllowed = 0, 578 sum = tarteaucitron.job.length, 579 index; 580 581 if (status === true) { 582 tarteaucitron.userInterface.css(key + 'Line', 'borderLeft', '5px solid ' + greenDark); 583 tarteaucitron.userInterface.css(key + 'Allowed', 'backgroundColor', greenDark); 584 tarteaucitron.userInterface.css(key + 'Denied', 'backgroundColor', gray); 585 } else if (status === false) { 586 tarteaucitron.userInterface.css(key + 'Line', 'borderLeft', '5px solid ' + redDark); 587 tarteaucitron.userInterface.css(key + 'Allowed', 'backgroundColor', gray); 588 tarteaucitron.userInterface.css(key + 'Denied', 'backgroundColor', redDark); 589 } 590 591 // check if all services are allowed 592 for (index = 0; index < sum; index += 1) { 593 if (tarteaucitron.state[tarteaucitron.job[index]] === false) { 594 nbDenied += 1; 595 } else if (tarteaucitron.state[tarteaucitron.job[index]] === undefined) { 596 nbPending += 1; 597 } else if (tarteaucitron.state[tarteaucitron.job[index]] === true) { 598 nbAllowed += 1;
599 } 600 } 601 602 tarteaucitron.userInterface.css(c + 'DotGreen', 'width', ((100 / sum) * nbAllowed) + '%'); 603 tarteaucitron.userInterface.css(c + 'DotYellow', 'width', ((100 / sum) * nbPending) + '%'); 604 tarteaucitron.userInterface.css(c + 'DotRed', 'width', ((100 / sum) * nbDenied) + '%'); 605 606 if (nbDenied === 0 && nbPending === 0) { 607 tarteaucitron.userInterface.css(c + 'AllAllowed', 'backgroundColor', greenDark); 608 tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', gray); 609 } else if (nbAllowed === 0 && nbPending === 0) { 610 tarteaucitron.userInterface.css(c + 'AllAllowed', 'backgroundColor', gray); 611 tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', redDark); 612 } else { 613 tarteaucitron.userInterface.css(c + 'AllAllowed', 'backgroundColor', gray); 614 tarteaucitron.userInterface.css(c + 'AllDenied', 'backgroundColor', gray); 615 } 616 617 // close the alert if all service have been reviewed 618 if (nbPending === 0) { 619 tarteaucitron.userInterface.closeAlert(); 620 } 621 622 if (tarteaucitron.services[key].cookies.length > 0 && status === false) { 623 tarteaucitron.cookie.purge(tarteaucitron.services[key].cookies); 624 } 625 626 if (status === true) { 627 if (document.getElementById('tacCL' + key) !== null) { 628 document.getElementById('tacCL' + key).innerHTML = '...'; 629 } 630 setTimeout(function () { 631 tarteaucitron.cookie.checkCount(key); 632 }, 2500); 633 } else { 634 tarteaucitron.cookie.checkCount(key); 635 } 636 }, 637 "openPanel": function () { 638 "use strict"; 639 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'block'); 640 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); 641 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); 642 tarteaucitron.userInterface.jsSizing('main'); 643 }, 644 "closePanel": function () { 645 "use strict"; 646 647 if (document.location.hash === tarteaucitron.hashtag) { 648 document.location.hash = ''; 649 } 650 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 651 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none'); 652 653 tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) { 654 elem.style.display = 'none'; 655 }, true); 656 657 if (tarteaucitron.reloadThePage === true) { 658 window.location.reload(); 659 } else { 660 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none'); 661 } 662 }, 663 "openAlert": function () { 664 "use strict"; 665 var c = 'tarteaucitron'; 666 tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'block'); 667 tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'none'); 668 tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'block'); 669 }, 670 "closeAlert": function () { 671 "use strict"; 672 var c = 'tarteaucitron'; 673 tarteaucitron.userInterface.css(c + 'Percentage', 'display', 'none'); 674 tarteaucitron.userInterface.css(c + 'AlertSmall', 'display', 'block'); 675 tarteaucitron.userInterface.css(c + 'AlertBig', 'display', 'none'); 676 tarteaucitron.userInterface.jsSizing('box'); 677 }, 678 "toggleCookiesList": function () { 679 "use strict"; 680 var div = document.getElementById('tarteaucitronCookiesListContainer'); 681 682 if (div === null) { 683 return; 684 } 685 686 if (div.style.display !== 'block') { 687 tarteaucitron.cookie.number(); 688 div.style.display = 'block'; 689 tarteaucitron.userInterface.jsSizing('cookie'); 690 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 691 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'block'); 692 tarteaucitron.fallback(['tarteaucitronInfoBox'], function (elem) { 693 elem.style.display = 'none'; 694 }, true); 695 } else { 696 div.style.display = 'none'; 697 tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none'); 698 tarteaucitron.userInterface.css('tarteaucitronBack', 'display', 'none'); 699 } 700 }, 701 "toggle": function (id, closeClass) { 702 "use strict"; 703 var div = document.getElementById(id); 704 705 if (div === null) { 706 return; 707 } 708 709 if (closeClass !== undefined) { 710 tarteaucitron.fallback([closeClass], function (elem) { 711 if (elem.id !== id) { 712 elem.style.display = 'none'; 713 } 714 }, true); 715 } 716 717 if (div.style.display !== 'block') { 718 div.style.display = 'block'; 719 } else { 720 div.style.display = 'none'; 721 } 722 }, 723 "order": function (id) { 724 "use strict"; 725 var main = document.getElementById('tarteaucitronServices_' + id), 726 allDivs, 727 store = [], 728 i; 729 730 if (main === null) { 731 return; 732 } 733 734 allDivs = main.childNodes; 735 736 if (typeof Array.prototype.map === 'function') { 737 Array.prototype.map.call(main.children, Object).sort(function (a, b) { 738 if (tarteaucitron.services[a.id.replace(/Line/g, '')].name > tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return 1; } 739 if (tarteaucitron.services[a.id.replace(/Line/g, '')].name < tarteaucitron.services[b.id.replace(/Line/g, '')].name) { return -1; } 740 return 0; 741 }
741).forEach(function (element) { 742 main.appendChild(element); 743 }); 744 } 745 }, 746 "jsSizing": function (type) { 747 "use strict"; 748 var scrollbarMarginRight = 10, 749 scrollbarWidthParent, 750 scrollbarWidthChild, 751 servicesHeight, 752 e = window, 753 a = 'inner', 754 windowInnerHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, 755 mainTop, 756 mainHeight, 757 closeButtonHeight, 758 headerHeight, 759 cookiesListHeight, 760 cookiesCloseHeight, 761 cookiesTitleHeight, 762 paddingBox, 763 alertSmallHeight, 764 cookiesNumberHeight; 765 766 if (type === 'box') { 767 if (document.getElementById('tarteaucitronAlertSmall') !== null && document.getElementById('tarteaucitronCookiesNumber') !== null) { 768 769 // reset 770 tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', '0px 10px'); 771 772 // calculate 773 alertSmallHeight = document.getElementById('tarteaucitronAlertSmall').offsetHeight; 774 cookiesNumberHeight = document.getElementById('tarteaucitronCookiesNumber').offsetHeight; 775 paddingBox = (alertSmallHeight - cookiesNumberHeight) / 2; 776 777 // apply 778 tarteaucitron.userInterface.css('tarteaucitronCookiesNumber', 'padding', paddingBox + 'px 10px'); 779 } 780 } else if (type === 'main') { 781 782 // get the real window width for media query 783 if (window.innerWidth === undefined) { 784 a = 'client'; 785 e = document.documentElement || document.body; 786 } 787 788 // height of the services list container 789 if (document.getElementById('tarteaucitron') !== null && document.getElementById('tarteaucitronClosePanel') !== null && document.getElementById('tarteaucitronMainLineOffset') !== null) { 790 791 // reset 792 tarteaucitron.userInterface.css('tarteaucitronScrollbarParent', 'height', 'auto'); 793 794 // calculate 795 mainHeight = document.getElementById('tarteaucitron').offsetHeight; 796 closeButtonHeight = document.getElementById('tarteaucitronClosePanel').offsetHeight; 797 headerHeight = document.getElementById('tarteaucitronMainLineOffset').offsetHeight; 798 799 // apply 800 servicesHeight = (mainHeight - closeButtonHeight - headerHeight + 1); 801 tarteaucitron.userInterface.css('tarteaucitronScrollbarParent', 'height', servicesHeight + 'px'); 802 } 803 804 // align the main allow/deny button depending on scrollbar width 805 if (document.getElementById('tarteaucitronScrollbarParent') !== null && document.getElementById('tarteaucitronScrollbarChild') !== null) { 806 807 // media query 808 if (e[a + 'Width'] <= 479) { 809 tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginLeft', '11px'); 810 } else if (e[a + 'Width'] <= 767) { 811 scrollbarMarginRight = 12; 812 } 813 814 scrollbarWidthParent = document.getElementById('tarteaucitronScrollbarParent').offsetWidth; 815 scrollbarWidthChild = document.getElementById('tarteaucitronScrollbarChild').offsetWidth; 816 tarteaucitron.userInterface.css('tarteaucitronScrollbarAdjust', 'marginRight', ((scrollbarWidthParent - scrollbarWidthChild) + scrollbarMarginRight) + 'px'); 817 } 818 819 // center the main panel 820 if (document.getElementById('tarteaucitron') !== null) { 821 822 // media query 823 if (e[a + 'Width'] <= 767) { 824 mainTop = 0; 825 } else { 826 mainTop = ((windowInnerHeight - document.getElementById('tarteaucitron').offsetHeight) / 2) - 21; 827 } 828 829 // correct 830 if (mainTop < 0) { 831 mainTop = 0; 832 } 833 834 if (document.getElementById('tarteaucitronMainLineOffset') !== null) { 835 if (document.getElementById('tarteaucitron').offsetHeight < (windowInnerHeight / 2)) { 836 mainTop -= document.getElementById('tarteaucitronMainLineOffset').offsetHeight; 837 } 838 } 839 840 // apply 841 tarteaucitron.userInterface.css('tarteaucitron', 'top', mainTop + 'px'); 842 } 843 844 845 } else if (type === 'cookie') { 846 847 // put cookies list at bottom 848 if (document.getElementById('tarteaucitronAlertSmall') !== null) { 849 tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'bottom', (document.getElementById('tarteaucitronAlertSmall').offsetHeight) + 'px'); 850 } 851 852 // height of cookies list 853 if (document.getElementById('tarteaucitronCookiesListContainer') !== null) { 854 855 // reset 856 tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', 'auto'); 857 858 // calculate 859 cookiesListHeight = document.getElementById('tarteaucitronCookiesListContainer').offsetHeight; 860 cookiesCloseHeight = document.getElementById('tarteaucitronClosePanelCookie').offsetHeight; 861 cookiesTitleHeight = document.getElementById('tarteaucitronCookiesTitle').offsetHeight; 862 863 // apply 864 tarteaucitron.userInterface.css('tarteaucitronCookiesList', 'height', (cookie
864sListHeight - cookiesCloseHeight - cookiesTitleHeight - 2) + 'px'); 865 } 866 } 867 } 868 }, 869 "cookie": { 870 "owner": {}, 871 "create": function (key, status) { 872 "use strict"; 873 var d = new Date(), 874 time = d.getTime(), 875 expireTime = time + 31536000000, // 365 days 876 regex = new RegExp("!" + key + "=(wait|true|false)", "g"), 877 cookie = tarteaucitron.cookie.read().replace(regex, ""), 878 value = 'tarteaucitron=' + cookie + '!' + key + '=' + status, 879 domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? 'domain=' + tarteaucitron.parameters.cookieDomain + ';' : ''; 880 881 if (tarteaucitron.cookie.read().indexOf(key + '=' + status) === -1) { 882 tarteaucitron.pro('!' + key + '=' + status); 883 } 884 885 d.setTime(expireTime); 886 document.cookie = value + '; expires=' + d.toGMTString() + '; path=/;' + domain; 887 }, 888 "read": function () { 889 "use strict"; 890 var nameEQ = "tarteaucitron=", 891 ca = document.cookie.split(';'), 892 i, 893 c; 894 895 for (i = 0; i < ca.length; i += 1) { 896 c = ca[i]; 897 while (c.charAt(0) === ' ') { 898 c = c.substring(1, c.length); 899 } 900 if (c.indexOf(nameEQ) === 0) { 901 return c.substring(nameEQ.length, c.length); 902 } 903 } 904 return ''; 905 }, 906 "purge": function (arr) { 907 "use strict"; 908 var i; 909 910 for (i = 0; i < arr.length; i += 1) { 911 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/;'; 912 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname + ';'; 913 document.cookie = arr[i] + '=; expires=Thu, 01 Jan 2000 00:00:00 GMT; path=/; domain=.' + location.hostname.split('.').slice(-2).join('.') + ';'; 914 } 915 }, 916 "checkCount": function (key) { 917 "use strict"; 918 var arr = tarteaucitron.services[key].cookies, 919 nb = arr.length, 920 nbCurrent = 0, 921 html = '', 922 i, 923 status = document.cookie.indexOf(key + '=true'); 924 925 if (status >= 0 && nb === 0) { 926 927 928 if ( tarteaucitron.services[key].key == "sajat") { 929 html += "A weboldal működéséhez alapvetÅen szükséges sütik. (Nem kikapcsolható)"; 930 931 } 932 else { 933 html += tarteaucitron.lang.useNoCookie; 934 935 936 } 937 938 } else if (status >= 0) { 939 for (i = 0; i < nb; i += 1) { 940 if (document.cookie.indexOf(arr[i] + '=') !== -1) { 941 nbCurrent += 1; 942 if (tarteaucitron.cookie.owner[arr[i]] === undefined) { 943 tarteaucitron.cookie.owner[arr[i]] = []; 944 } 945 if (tarteaucitron.cookie.crossIndexOf(tarteaucitron.cookie.owner[arr[i]], tarteaucitron.services[key].name) === false) { 946 tarteaucitron.cookie.owner[arr[i]].push(tarteaucitron.services[key].name); 947 } 948 } 949 } 950 951 if (nbCurrent > 0) { 952 html += tarteaucitron.lang.useCookieCurrent + ' ' + nbCurrent + ' sütit használ'; 953 if (nbCurrent > 1) { 954 // html += 's'; 955 } 956 html += '.'; 957 } else { 958 959 if ( tarteaucitron.services[key].key == "sajat") { 960 html += "A weboldal működéséhez alapvetÅen szükséges sütik. (Nem kikapcsolható)"; 961 962 } 963 else { 964 html += tarteaucitron.lang.useNoCookie; 965 } 966 967 968 969 970 } 971 } else if (nb === 0) { 972 973 974 if ( tarteaucitron.services[key].key == "sajat") {
975 html += "A weboldal működéséhez alapvetÅen szükséges sütik. (Nem kikapcsolható)"; 976 977 } 978 else { 979 html = tarteaucitron.lang.noCookie; 980 } 981 982 983 984 } else { 985 html += tarteaucitron.lang.useCookie + ' ' + nb + ' sütit telepÃthet'; 986 if (nb > 1) { 987 // html += 's'; 988 } 989 html += '.'; 990 } 991 992 if (document.getElementById('tacCL' + key) !== null) { 993 document.getElementById('tacCL' + key).innerHTML = html; 994 } 995 }, 996 "crossIndexOf": function (arr, match) { 997 "use strict"; 998 var i; 999 for (i = 0; i < arr.length; i += 1) { 1000 if (arr[i] === match) { 1001 return true; 1002 } 1003 } 1004 return false; 1005 }, 1006 "number": function () { 1007 "use strict"; 1008 var cookies = document.cookie.split(';'), 1009 nb = (document.cookie !== '') ? cookies.length : 0, 1010 html = '', 1011 i, 1012 name, 1013 namea, 1014 nameb, 1015 c, 1016 d, 1017 s = (nb > 1) ? 's' : '', 1018 savedname, 1019 regex = /^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i, 1020 regexedDomain = (tarteaucitron.cdn.match(regex) !== null) ? tarteaucitron.cdn.match(regex)[1] : tarteaucitron.cdn, 1021 host = (tarteaucitron.domain !== undefined) ? tarteaucitron.domain : regexedDomain; 1022 1023 cookies = cookies.sort(function (a, b) { 1024 namea = a.split('=', 1).toString().replace(/ /g, ''); 1025 nameb = b.split('=', 1).toString().replace(/ /g, ''); 1026 c = (tarteaucitron.cookie.owner[namea] !== undefined) ? tarteaucitron.cookie.owner[namea] : '0'; 1027 d = (tarteaucitron.cookie.owner[nameb] !== undefined) ? tarteaucitron.cookie.owner[nameb] : '0'; 1028 if (c + a > d + b) { return 1; } 1029 if (c + a < d + b) { return -1; } 1030 return 0; 1031 }); 1032 1033 if (document.cookie !== '') { 1034 for (i = 0; i < nb; i += 1) { 1035 name = cookies[i].split('=', 1).toString().replace(/ /g, ''); 1036 if (tarteaucitron.cookie.owner[name] !== undefined && tarteaucitron.cookie.owner[name].join(' // ') !== savedname) { 1037 savedname = tarteaucitron.cookie.owner[name].join(' // '); 1038 html += '<div class="tarteaucitronHidden">'; 1039 html += ' <div class="tarteaucitronTitle">'; 1040 html += ' ' + tarteaucitron.cookie.owner[name].join(' // '); 1041 html += ' </div>'; 1042 html += '</div>'; 1043 } else if (tarteaucitron.cookie.owner[name] === undefined && host !== savedname) { 1044 savedname = host; 1045 html += '<div class="tarteaucitronHidden">'; 1046 html += ' <div class="tarteaucitronTitle">'; 1047 html += ' ' + host; 1048 html += ' </div>'; 1049 html += '</div>'; 1050 } 1051 html += '<div class="tarteaucitronCookiesListMain">'; 1052 html += ' <div class="tarteaucitronCookiesListLeft"><a href="#" onclick="tarteaucitron.cookie.purge([\'' + cookies[i].split('=', 1) + '\']);tarteaucitron.cookie.number();tarteaucitron.userInterface.jsSizing(\'cookie\');return false"><b>×</b></a> <b>' + name + '</b>'; 1053 html += ' </div>'; 1054 html += ' <div class="tarteaucitronCookiesListRight">' + cookies[i].split('=').slice(1).join('=') + '</div>'; 1055 html += '</div>'; 1056 } 1057 } else { 1058 html += '<div class="tarteaucitronCookiesListMain">'; 1059 html += ' <div class="tarteaucitronCookiesListLeft"><b>-</b></div>'; 1060 html += ' <div class="tarteaucitronCookiesListRight"></div>'; 1061 html += '</div>'; 1062 } 1063
1064 html += '<div class="tarteaucitronHidden butnobg" id="tarteaucitronScrollbarChild" style="height:20px;display:block"><p>KészÃtette: <a href="https://webraketa.hu/" target="_blank">Webrakéta Kft.</a></p></div>'; 1065 1066 if (document.getElementById('tarteaucitronCookiesList') !== null) { 1067 document.getElementById('tarteaucitronCookiesList').innerHTML = html; 1068 } 1069 1070 if (document.getElementById('tarteaucitronCookiesNumber') !== null) { 1071 document.getElementById('tarteaucitronCookiesNumber').innerHTML = nb; 1072 } 1073 1074 if (document.getElementById('tarteaucitronCookiesNumberBis') !== null) { 1075 document.getElementById('tarteaucitronCookiesNumberBis').innerHTML = nb + ' cookie' + s; 1076 } 1077 1078 for (i = 0; i < tarteaucitron.job.length; i += 1) { 1079 tarteaucitron.cookie.checkCount(tarteaucitron.job[i]); 1080 } 1081 } 1082 }, 1083 "getLanguage": function () { 1084 "use strict"; 1085 if (!navigator) { return 'en'; } 1086 1087 var availableLanguages = 'cs,en,fr,es,it,de,pt,pl,ru,hu', 1088 defaultLanguage = 'en', 1089 lang = navigator.language || navigator.browserLanguage || 1090 navigator.systemLanguage || navigator.userLang || null, 1091 userLanguage = lang.substr(0, 2); 1092 1093 if (tarteaucitronForceLanguage !== '') { 1094 if (availableLanguages.indexOf(tarteaucitronForceLanguage) !== -1) { 1095 return tarteaucitronForceLanguage; 1096 } 1097 } 1098 1099 if (availableLanguages.indexOf(userLanguage) === -1) { 1100 return defaultLanguage; 1101 } 1102 return userLanguage; 1103 }, 1104 "getLocale": function () { 1105 "use strict"; 1106 if (!navigator) { return 'en_US'; } 1107 1108 var lang = navigator.language || navigator.browserLanguage || 1109 navigator.systemLanguage || navigator.userLang || null, 1110 userLanguage = lang.substr(0, 2); 1111 1112 if (userLanguage === 'fr') { 1113 return 'fr_FR'; 1114 } else if (userLanguage === 'en') { 1115 return 'en_US'; 1116 } else if (userLanguage === 'de') { 1117 return 'de_DE'; 1118 } else if (userLanguage === 'es') { 1119 return 'es_ES'; 1120 } else if (userLanguage === 'it') { 1121 return 'it_IT'; 1122 } else if (userLanguage === 'pt') { 1123 return 'pt_PT'; 1124 } else if (userLanguage === 'hu') { 1125 return 'hu_HU'; 1126 } else { 1127 return 'en_US'; 1128 } 1129 }, 1130 "addScript": function (url, id, callback, execute, attrName, attrVal) { 1131 "use strict"; 1132 var script, 1133 done = false; 1134 1135 if (execute === false) { 1136 if (typeof callback === 'function') { 1137 callback(); 1138 } 1139 } else { 1140 script = document.createElement('script'); 1141 script.type = 'text/javascript'; 1142 script.id = (id !== undefined) ? id : ''; 1143 script.async = true; 1144 script.src = url; 1145 1146 if (attrName !== undefined && attrVal !== undefined) { 1147 script.setAttribute(attrName, attrVal); 1148 } 1149 1150 if (typeof callback === 'function') { 1151 script.onreadystatechange = script.onload = function () { 1152 var state = script.readyState; 1153 if (!done && (!state || /loaded|complete/.test(state))) { 1154 done = true; 1155 callback(); 1156 } 1157 }; 1158 } 1159 1160 document.getElementsByTagName('head')[0].appendChild(script); 1161 } 1162 }, 1163 "makeAsync": { 1164 "antiGhost": 0, 1165 "buffer": '', 1166 "init": function (url, id) { 1167 "use strict"; 1168 var savedWrite = document.write, 1169 savedWriteln = document.writeln; 1170 1171 document.write = function (content) { 1172 tarteaucitron.makeAsync.buffer += content; 1173 }; 1174 document.writeln = function (content) { 1175 tarteaucitron.makeAsync.buffer += content.concat("\n"); 1176 }; 1177 1178 setTimeout(function () { 1179 document.write = savedWrite;
1180 document.writeln = savedWriteln; 1181 }, 20000); 1182 1183 tarteaucitron.makeAsync.getAndParse(url, id); 1184 }, 1185 "getAndParse": function (url, id) { 1186 "use strict"; 1187 if (tarteaucitron.makeAsync.antiGhost > 9) { 1188 tarteaucitron.makeAsync.antiGhost = 0; 1189 return; 1190 } 1191 tarteaucitron.makeAsync.antiGhost += 1; 1192 tarteaucitron.addScript(url, '', function () { 1193 if (document.getElementById(id) !== null) { 1194 document.getElementById(id).innerHTML += "<span style='display:none'> </span>" + tarteaucitron.makeAsync.buffer; 1195 tarteaucitron.makeAsync.buffer = ''; 1196 tarteaucitron.makeAsync.execJS(id); 1197 } 1198 }); 1199 }, 1200 "execJS": function (id) { 1201 /* not strict because third party scripts may have errors */ 1202 var i, 1203 scripts, 1204 childId, 1205 type; 1206 1207 if (document.getElementById(id) === null) { 1208 return; 1209 } 1210 1211 scripts = document.getElementById(id).getElementsByTagName('script'); 1212 for (i = 0; i < scripts.length; i += 1) { 1213 type = (scripts[i].getAttribute('type') !== null) ? scripts[i].getAttribute('type') : ''; 1214 if (type === '') { 1215 type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : ''; 1216 } 1217 if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') { 1218 childId = id + Math.floor(Math.random() * 99999999999); 1219 document.getElementById(id).innerHTML += '<div id="' + childId + '"></div>'; 1220 tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId); 1221 } else if (type.indexOf('javascript') !== -1 || type === '') { 1222 eval(scripts[i].innerHTML); 1223 } 1224 } 1225 } 1226 }, 1227 "fallback": function (matchClass, content, noInner) { 1228 "use strict"; 1229 var elems = document.getElementsByTagName('*'), 1230 i, 1231 index = 0; 1232 1233 for (i in elems) { 1234 if (elems[i] !== undefined) { 1235 for (index = 0; index < matchClass.length; index += 1) { 1236 if ((' ' + elems[i].className + ' ') 1237 .indexOf(' ' + matchClass[index] + ' ') > -1) { 1238 if (typeof content === 'function') { 1239 if (noInner === true) { 1240 content(elems[i]); 1241 } else { 1242 elems[i].innerHTML = content(elems[i]); 1243 } 1244 } else { 1245 elems[i].innerHTML = content; 1246 } 1247 } 1248 } 1249 } 1250 } 1251 }, 1252 "engage": function (id) { 1253 "use strict"; 1254 var html = '', 1255 r = Math.floor(Math.random() * 100000); 1256 1257 html += '<div class="tac_activate">'; 1258 html += ' <div class="tac_float">'; 1259 html += ' <b>' + tarteaucitron.services[id].name + '</b> ' + tarteaucitron.lang.fallback; 1260 html += ' <div class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '" onclick="tarteaucitron.userInterface.respond(this, true);">'; 1261 html += ' ✓ ' + tarteaucitron.lang.allow; 1262 html += ' </div>'; 1263 html += ' </div>'; 1264 html += '</div>'; 1265 1266 return html; 1267 }, 1268 "extend": function (a, b) { 1269 "use strict"; 1270 var prop; 1271 for (prop in b) { 1272 if (b.hasOwnProperty(prop)) { 1273 a[prop] = b[prop]; 1274 } 1275 } 1276 }, 1277 "proTemp": '', 1278 "proTimer": function () { 1279 "use strict"; 1280 setTimeout(tarteaucitron.proPing, 1000); 1281 }, 1282 "pro": function (list) { 1283 "use strict"; 1284 tarteaucitron.proTemp += list; 1285 clearTimeout(tarteaucitron.proTimer); 1286 tarteaucitron.proTimer = setTimeout(tarteaucitron.proPing, 2500); 1287 }, 1288 "proPing": function () { 1289 "use strict"; 1290 if (tarteaucitron.uuid !== '' && tarteaucitron.uuid !== undefined && tarteaucitron.proTemp !== '') { 1291 var div = document.getElementById('tarteaucitronPremium'), 1292 timestamp = new Date().getTime(), 1293 url = '//opt-out.ferank.eu/premium.php?'; 1294 1295 if (div === null) { 1296 return; 1297 } 1298 1299 url += 'domain=' + tarteaucitron.domain + '&'; 1300 url += 'uuid=' + tarteaucitron.uuid + '&'; 1301 url += 'c=' + encodeURIComponent(tarteaucitron.proTemp) + '&'; 1302 url += '_' + timestamp; 1303 1304 div.innerHTML = '<img src="' + url + '" style="display:none" />'; 1305 1306 tarteaucitron.proTemp = ''; 1307 } 1308 1309 tarteaucitron.cookie.number(); 1310 } 1311};
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.