1 2// ************************************************************************* 3// * CookieGuard v1.1 * 4// * * 5// * (c) 2012 Ultimateweb LTD <[email protected]> * 6// * All Rights Reserved. * 7// * * 8// * This program is free software: you can redistribute it and/or modify * 9// * it under the terms of the GNU General Public License as published by * 10// * the Free Software Foundation, either version 3 of the License, or * 11// * (at your option) any later version. * 12// * * 13// * This program is distributed in the hope that it will be useful, * 14// * but WITHOUT ANY WARRANTY; without even the implied warranty of * 15// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 16// * GNU General Public License for more details. * 17// * * 18// * GNU General Public License <http://www.gnu.org/licenses/>. * 19// * * 20// ************************************************************************* 21// CHANGELOG 22// 23// 1.1.0 (updated by [email protected]) 24// - Multilanguage (spanish and german translations included). 25// - Responsive (CSS based in percentages) 26// - Script Cookies with 2 expiration days 27// 28 (function ($) { 29 if (typeof $.cookieguard === 'undefined') { 30 $.cookieguard = function (options) { 31 32 // Defaults 33 var defaults = { 34 cookieDeleteDelay: 100, 35 messageShowDelay: 1000, 36 messageHideDelay: null, 37 answeredHideDelay: 2000, 38 slideSpeed: 500, 39 cookieExpirationDays: 60, 40 cookiePrefix: 'cookieguard_', 41 alertOfUnknown: true 42 }; 43 44 var messages = { 45 bannerTitle: ' I cookie ci servono per far funzionare al meglio questo sito.', 46 bannerDescription: 'Navigando su questo sito accetti l\'utilizzo dei cookie da parte del titolare del sito', 47 cookiesListInit: 'Elenco dei cookie previsti inizialmente per questo sito', 48 cookiesListNew: 'Elenco dei nuovi cookie trovati', 49 cookiesNewTitle: 'Sono stati trovati nuovi cookie su questo sito.<br/>Questi cookie non sono essenziali ma rendono più fluida la tua navigazione.', 50 cookiesNewDescription: '', 51 cookiesBlocked: 'I cookie non essenziali sono stati bloccati su questo sito.', 52 cookiesAllowed: 'I cookie sono ora stati approvati su questo sito.', 53 buttonShow: 'Mostra', 54 buttonHide: 'Nascondi', 55 buttonBlock: 'Blocca', 56 buttonAllowInit: 'Consenti e prosegui la navigazione', 57 buttonAllowNew: 'Consenti', 58 buttonOK: 'Ok', 59 cookieGuardName: 'Cookie Guard', 60 cookieGuardDescription: 'Questo cookie è essenziale per memorizzare lo stato delle tue scelte riguardo a tutti gli altri cookie.', 61 label_essential: 'essenziale', 62 label_nonEssential: 'non essenziale' 63 }; 64 65 var buttons = { 66 buttonsConfigInit: '<div id="cookieButtons"><a href="#" id="showCookies">' + messages.buttonShow + '</a>' + '<a href="#" id="authoriseCookies">' + messages.buttonOK + '</a>' 67 68 + '</div>', 69 buttonsConfigNew: '<div id="cookieButtons"><a href="#" id="showCookies">' + messages.buttonShow + '</a>' + '<a href="#" id="authoriseCookies">' + messages.buttonAllowNew + '</a>' + '<a href="#" id="denyCookies">' + messages.buttonBlock + '</a></div>', 70 buttonsOK: '<div id="cookieButtons"><a href="#" id="showCookies">' + messages.buttonShow + '</a><a href="#" id="cookieGuardOkay">' + messages.buttonOK + '</a></div>' 71 }; 72 73 $.cookieguard.settings = $.extend(defaults, messages, buttons, options, {'cookiesUsed': new Array(), 'messageHideTimeout': null}); 74 }; 75 } 76 77 if (typeof $.cookieguard.cookies === 'undefined') { 78 $.cookieguard.cookies = function () { 79 }; 80 } 81 82 if (typeof $.cookieguard.cookies.read === 'undefined') { 83 $.cookieguard.cookies.read = function (name) { 84 var nameEQ = name + "="; 85 var ca = document.cookie.split(';'); 86 for (var i = 0; i < ca.length; i++) { 87 var c = ca[i];
88 while (c.charAt(0) == ' ') 89 c = c.substring(1, c.length); 90 if (c.indexOf(nameEQ) == 0) 91 return c.substring(nameEQ.length, c.length); 92 } 93 return null; 94 }; 95 } 96 97 if (typeof $.cookieguard.cookies.create === 'undefined') { 98 $.cookieguard.cookies.create = function (name, value, days, domain, path) { 99 if (domain == undefined || domain == null) 100 domain = document.domain; 101 if (path == undefined || path == null) 102 path = "/"; 103 if (days) { 104 var date = new Date(); 105 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 106 var expires = "; expires=" + date.toGMTString(); 107 } 108 else 109 var expires = ""; 110 111 document.cookie = name + "=" + value + expires + "; domain=" + domain + "; path=" + path; 112 }; 113 } 114 115 if (typeof $.cookieguard.cookies.erase === 'undefined') { 116 $.cookieguard.cookies.erase = function (name) { 117 $.cookieguard.cookies.create(name, "", -1, "", ""); 118 $.cookieguard.cookies.create(name, "", -1, ""); 119 $.cookieguard.cookies.create(name, "", -1); 120 $.cookieguard.cookies.create(name, "", -1, "." + document.domain); 121 if (document.domain.substr(0, 4) == '.www.') 122 $.cookieguard.cookies.create(name, "", -1, document.domain.substr(1)); 123 if (document.domain.substr(0, 4) == 'www.') 124 $.cookieguard.cookies.create(name, "", -1, "." + document.domain.substr(4)); 125 }; 126 } 127 128 if (typeof $.cookieguard.cookies.add === 'undefined') { 129 $.cookieguard.cookies.add = function (name, cookie, description, essential) { 130 var cookies = cookie.split(","); 131 132 for (var i = 0; i < cookies.length; i++) { 133 $.cookieguard.settings.cookiesUsed.push({'name': name, 'cookie': cookies[i], 'description': description, 'essential': essential}); 134 135 if (essential) 136 $.cookieguard.cookies.storeAllowedCookie(cookies[i]); 137 } 138 }; 139 } 140 141 if (typeof $.cookieguard.cookies.findUnknownCookies === 'undefined') { 142 $.cookieguard.cookies.findUnknownCookies = function () { 143 var allowedCookies = $.cookieguard.cookies.getAllowedCookies(); 144 var disallowedCookies = $.cookieguard.cookies.getDisallowedCookies(); 145 var definedCookies = $.cookieguard.settings.cookiesUsed; 146 var allCookies = new Array(); 147 var unknownCookies = new Array(); 148 149 if (document.cookie && document.cookie != '') { 150 var split = document.cookie.split(';'); 151 for (var i = 0; i < split.length; i++) { 152 var name_value = split[i].split("="); 153 name_value[0] = name_value[0].replace(/^ /, ''); 154 allCookies.push(decodeURIComponent(name_value[0])); 155 } 156 } 157 158 for (var i = 0; i < allCookies.length; i++) { 159 var cookieFound = false; 160 161 if (allowedCookies != null) { 162 for (var j = 0; j < allowedCookies.length; j++) { 163 if (allowedCookies[j].indexOf('*') === 0 && allowedCookies[j].match("\\*$") == '*') { 164 if (allCookies[i].indexOf(allowedCookies[j].replace('*', '')) > -1) { 165 cookieFound = true; 166 break; 167 } 168 } 169 else if (allowedCookies[j].indexOf('*') === 0) { 170 if (allCookies[i].match(allowedCookies[j].replace('*', '') + '$') == allowedCookies[j].replace('*', '')) { 171 cookieFound = true; 172 break; 173 } 174 } 175 else if (allowedCookies[j].match("\\*$") == "*") { 176 if (allCookies[i].indexOf(allowedCookies[j].replace('*', '')) === 0) { 177 cookieFound = true; 178 break; 179 } 180 } 181 else if (allowedCookies[j] == allCookies[i]) { 182 cookieFound = true; 183 break; 184 } 185 } 186 } 187 188 if (!cookieFound) { 189 if (disallowedCookies != null) { 190 for (var j = 0; j < disallowedCookies.length; j++) { 191 if (disallowedCookies[j].indexOf('*') === 0 && disallowedCookies[j].match("\\*$") == '*') { 192 if (allCookies[i].indexOf(disallowedCookies[j].replace('*', '')) > -1) { 193 cookieFound = true; 194 break; 195 } 196 } 197 else if (disallowedCookies[j].indexOf('*') === 0) { 198 if (allCookies[i].match(disallowedCookies[j].replace('*', '') + '$') == disallowedCookies[j].replace('*', '')) { 199 cookieFound = true; 200 break; 201 } 202 } 203 else if (disallowedCookies[j].match("\\*$") == "*") { 204 if (allCookies[i].indexOf(disallowedCookies[j].replace('*', '')) === 0) { 205 cookieFound = true; 206 break; 207 } 208 } 209 else if (disallowedCookies[j] == allCookies[i]) { 210 cookieFound = true; 211 break; 212 } 213 } 214 } 215 } 216 217 if (!cookieFound) { 218 if (definedCookies.length > 0) { 219 for (var j = 0; j < definedCookies.length; j++) { 220 if (definedCookies[j].cookie.indexOf('*') === 0 && definedCookies[j].cookie.match("\\*$") == '*') { 221 if (allCookies[i].indexOf(definedCookies[j].cookie.replace(/\*/g, '')) > -1) { 222 cookieFound = true; 223 break; 224 } 225 } 226 else if (definedCookies[j].cookie.indexOf('*') === 0) { 227 if (allCookies[i].match(definedCookies[j].cookie.replace(/\*/g, '') + '$') == definedCookies[j].cookie.replace(/\*/g, '')) { 228 cookieFound = true; 229 break; 230 } 231 } 232 else if (definedCookies[j].cookie.match("\\*$") == "*") { 233 if (allCookies[i].indexOf(definedCookies[j].cookie.replace(/\*/g, '')) === 0) { 234 cookieFound = true; 235 break; 236 } 237 } 238 else if (definedCookies[j].cookie == allCookies[i]) { 239 cookieFound = true; 240 break; 241 } 242 } 243 } 244 } 245 246 if (!cookieFound) 247 if (allCookies[i].indexOf($.cookieguard.settings.cookiePrefix) === 0) 248 cookieFound = true; 249 250 if (!cookieFound) { 251 unknownCookies.push(allCookies[i]); 252 } 253 } 254 255 return unknownCookies; 256 }; 257 } 258 259 if (typeof $.cookieguard.cookies.storeAllowedCookie === 'undefined') { 260 $.cookieguard.cookies.storeAllowedCookie = function (cookie) { 261 var allowedCookies = $.cookieguard.cookies.getAllowedCookies(); 262 var allowedCookiesStr; 263 264 if (allowedCookies == null) 265 allowedCookiesStr = cookie; 266 else { 267 allowedCookiesStr = allowedCookies.join(','); 268 if ($.inArray(cookie, allowedCookies) == -1) 269 allowedCookiesStr = allowedCookiesStr + ',' + cookie; 270 } 271 272 $.cookieguard.cookies.create($.cookieguard.settings.cookiePrefix + 'allowedCookies', allowedCookiesStr, $.cookieguard.settings.cookieExpirationDays); 273 }; 274 } 275 276 if (typeof $.cookieguard.cookies.getAllowedCookies === 'undefined') { 277 $.cookieguard.cookies.getAllowedCookies = function () { 278 var allowedCookies = $.cookieguard.cookies.read($.cookieguard.settings.cookiePrefix + 'allowedCookies'); 279 280 if (allowedCookies != null) 281 return allowedCookies.split(','); 282 283 return null; 284 }; 285 } 286 287 if (typeof $.cookieguard.cookies.storeDisallowedCookie === 'undefined') { 288 $.cookieguard.cookies.storeDisallowedCookie = function (cookie) { 289 var disallowedCookies = $.cookieguard.cookies.getDisallowedCookies(); 290 var disallowedCookiesStr; 291 292 if (disallowedCookies == null) 293 disallowedCookiesStr = cookie; 294 else { 295 disallowedCookiesStr = disallowedCookies.join(','); 296 if ($.inArray(cookie, disallowedCookies) == -1) 297 disallowedCookiesStr = disallowedCookiesStr + ',' + cookie; 298 } 299 300 $.cookieguard.cookies.create($.cookieguard.settings.cookiePrefix + 'disallowedCookies', disallowedCookiesStr, $.cookieguard.settings.cookieExpirationDays); 301 }; 302 } 303 304 if (typeof $.cookieguard.cookies.getDisallowedCookies === 'undefined') { 305 $.cookieguard.cookies.getDisallowedCookies = function () { 306 var disallowedCookies = $.cookieguard.cookies.read($.cookieguard.settings.cookiePrefix + 'disallowedCookies') 307 308 if (disallowedCookies != null) 309 return disallowedCookies.split(','); 310 311 return null; 312 }; 313 } 314 315 if (typeof $.cookieguard.eradicateCookies === 'undefined') { 316 $.cookieguard.eradicateCookies = function () { 317 var cookiesToDestroy = $.cookieguard.cookies.getDisallowedCookies(); 318 var cookiesToAllow = $.cookieguard.cookies.getAllowedCookies(); 319 var allCookies = new Array(); 320 321 if (document.cookie && document.cookie != '') { 322 var split = document.cookie.split(';'); 323 for (var i = 0; i < split.length; i++) { 324 var name_value = split[i].split("="); 325 name_value[0] = name_value[0].replace(/^ /, ''); 326 allCookies.push(decodeURIComponent(name_value[0])); 327 } 328 } 329 330 for (var i = 0; i < allCookies.length; i++) { 331 var cookieFound = false; 332 333 if (allCookies[i].indexOf($.cookieguard.settings.cookiePrefix) === 0) 334 cookieFound = true; 335 336 if (!cookieFound) {
337 if (cookiesToAllow != null) { 338 for (var j = 0; j < cookiesToAllow.length; j++) { 339 if (cookiesToAllow[j].indexOf('*') === 0 && cookiesToAllow[j].match("\\*$") == '*') { 340 if (allCookies[i].indexOf(cookiesToAllow[j].replace('*', '')) > -1) { 341 cookieFound = true; 342 break; 343 } 344 } 345 else if (cookiesToAllow[j].indexOf('*') === 0) { 346 if (allCookies[i].match(cookiesToAllow[j].replace('*', '') + '$') == cookiesToAllow[j].replace('*', '')) { 347 cookieFound = true; 348 break; 349 } 350 } 351 else if (cookiesToAllow[j].match("\\*$") == "*") { 352 if (allCookies[i].indexOf(cookiesToAllow[j].replace('*', '')) === 0) { 353 cookieFound = true; 354 break; 355 } 356 } 357 else if (cookiesToAllow[j] == allCookies[i]) { 358 cookieFound = true; 359 break; 360 } 361 } 362 } 363 364 if (!cookieFound) { 365 if (cookiesToDestroy != null) { 366 for (var j = 0; j < cookiesToDestroy.length; j++) { 367 if (cookiesToDestroy[j].indexOf('*') === 0 && cookiesToDestroy[j].match("\\*$") == '*') { 368 if (allCookies[i].indexOf(cookiesToDestroy[j].replace('*', '')) > -1) { 369 $.cookieguard.cookies.erase(allCookies[i]); 370 cookieFound = true; 371 break; 372 } 373 } 374 else if (cookiesToDestroy[j].indexOf('*') === 0) { 375 if (allCookies[i].match(cookiesToDestroy[j].replace('*', '') + '$') == cookiesToDestroy[j].replace('*', '')) { 376 $.cookieguard.cookies.erase(allCookies[i]); 377 cookieFound = true; 378 break; 379 } 380 } 381 else if (cookiesToDestroy[j].match("\\*$") == "*") { 382 if (allCookies[i].indexOf(cookiesToDestroy[j].replace('*', '')) === 0) { 383 $.cookieguard.cookies.erase(allCookies[i]); 384 cookieFound = true; 385 break; 386 } 387 } 388 else if (cookiesToDestroy[j] == allCookies[i]) { 389 $.cookieguard.cookies.erase(allCookies[i]); 390 cookieFound = true; 391 break; 392 } 393 } 394 } 395 } 396 } 397 } 398 } 399 } 400 401 if (typeof $.cookieguard.run === 'undefined') { 402 $.cookieguard.run = function () { 403 setTimeout(function () { 404 var unknownCookies; 405 406 if ($.cookieguard.settings.alertOfUnknown) 407 unknownCookies = $.cookieguard.cookies.findUnknownCookies(); 408 else 409 unknownCookies = new Array(); 410 411 if (!$.cookieguard.hasAnswered()) { 412 $.cookieguard.buildMessage(true, $.cookieguard.settings.cookiesUsed, unknownCookies); 413 $.cookieguard.displayMessage($.cookieguard.settings.messageShowDelay, $.cookieguard.settings.messageHideDelay); 414 } 415 else { 416 $.cookieguard.eradicateCookies(); 417 418 if (unknownCookies.length > 0) { 419 $.cookieguard.buildMessage(false, null, unknownCookies); 420 $.cookieguard.displayMessage($.cookieguard.settings.messageShowDelay, $.cookieguard.settings.messageHideDelay); 421 } 422 } 423 }, $.cookieguard.settings.cookieDeleteDelay); 424 }; 425 } 426 427 if (typeof $.cookieguard.hasAnswered === 'undefined') { 428 $.cookieguard.hasAnswered = function () { 429 if ($.cookieguard.cookies.read($.cookieguard.settings.cookiePrefix + "initialised") != null) 430 return true; 431 else 432 return false; 433 }; 434 } 435 436 if (typeof $.cookieguard.buildMessage === 'undefined') { 437 $.cookieguard.buildMessage = function (init, knownCookies, unknownCookies) { 438 $('body').prepend('<div id="cookieGuardMsg"><div id="cookieGuardMsgInner"></div>'); 439 440 if (init) { 441 $('#cookieGuardMsgInner').append('<strong>' + $.cookieguard.settings.bannerTitle + '</strong><br/>'); 442 if (unknownCookies.length == 0 && $.cookieguard.hasOnlyEssential()) 443 $('#cookieGuardMsgInner').addClass('onlyEssential').append($.cookieguard.settings.buttonsOk); 444 else 445 $('#cookieGuardMsgInner').append($.cookieguard.settings.bannerDescription + $.cookieguard.settings.buttonsConfigInit); 446 } 447 else { 448 $('#cookieGuardMsgInner').append($.cookieguard.settings.cookiesNewTitle + '<br/>'); 449 $('#cookieGuardMsgInner').append($.cookieguard.settings.cookiesNewDescription + $.cookieguard.settings.buttonsConfigNew); 450 } 451
452 $.cookieguard.buildCookieList(init, knownCookies, unknownCookies); 453 454 $('#cookieGuardOkay').click(function () { 455 clearTimeout($.cookieguard.settings.messageHideTimeout); 456 $.cookieguard.hideMessage(0); 457 $.cookieguard.cookies.create($.cookieguard.settings.cookiePrefix + 'initialised', '1', $.cookieguard.settings.cookieExpirationDays); 458 return false; 459 }); 460 461 $('#showCookies').click(function () { 462 if ($(this).text() == $.cookieguard.settings.buttonShow) { 463 clearTimeout($.cookieguard.settings.messageHideTimeout); 464 $('#cookieList').show(); 465 $(this).text($.cookieguard.settings.buttonHide); 466 var h = $('#cookieList').outerHeight(); 467 $('#cookieList').css({'overflow': 'hidden', 'height': 0}).animate({ 468 'height': h 469 }, $.cookieguard.settings.slideTimer); 470 } 471 else if ($(this).text() == $.cookieguard.settings.buttonHide) { 472 $(this).text($.cookieguard.settings.buttonShow); 473 $('#cookieList').animate({ 474 'height': 0 475 }, $.cookieguard.settings.slideTimer, null, function () { 476 $('#cookieList').hide().attr('style', '').removeAttr('style'); 477 }); 478 } 479 480 return false; 481 }); 482 483 $('#authoriseCookies').click(function () { 484 clearTimeout($.cookieguard.settings.messageHideTimeout); 485 $('#cookieGuardMsgInner').empty().addClass('msgAllowed').html($.cookieguard.settings.cookiesAllowed); 486 $.cookieguard.hideMessage($.cookieguard.settings.answeredHideDelay); 487 488 if (knownCookies != null) { 489 for (var i = 0; i < knownCookies.length; i++) 490 $.cookieguard.cookies.storeAllowedCookie(knownCookies[i].cookie); 491 } 492 if (unknownCookies != null) { 493 for (var i = 0; i < unknownCookies.length; i++) 494 $.cookieguard.cookies.storeAllowedCookie(unknownCookies[i]); 495 } 496 497 $.cookieguard.cookies.create($.cookieguard.settings.cookiePrefix + 'initialised', '1', $.cookieguard.settings.cookieExpirationDays); 498 return false; 499 }); 500 501 $('#denyCookies').click(function () { 502 clearTimeout($.cookieguard.settings.messageHideTimeout); 503 $('#cookieGuardMsgInner').empty().addClass('msgDenied').html($.cookieguard.settings.cookiesBlocked); 504 $.cookieguard.hideMessage($.cookieguard.settings.answeredHideDelay); 505 506 if (knownCookies != null) { 507 for (var i = 0; i < knownCookies.length; i++) 508 if (knownCookies[i].essential == false) 509 $.cookieguard.cookies.storeDisallowedCookie(knownCookies[i].cookie); 510 } 511 if (unknownCookies != null) { 512 for (var i = 0; i < unknownCookies.length; i++) 513 $.cookieguard.cookies.storeDisallowedCookie(unknownCookies[i]); 514 } 515 516 $.cookieguard.cookies.create($.cookieguard.settings.cookiePrefix + 'initialised', '1', $.cookieguard.settings.cookieExpirationDays); 517 $.cookieguard.eradicateCookies(); 518 return false; 519 }); 520 }; 521 } 522 523 if (typeof $.cookieguard.buildCookieList === 'undefined') { 524 $.cookieguard.buildCookieList = function (init, knownCookies, unknownCookies) { 525 var essentialCookies = new Array(); 526 var unessentialCookies = new Array(); 527 var knownNames = new Array(); 528 529 if (knownCookies != null) { 530 for (var i = 0; i < knownCookies.length; i++) { 531 if ($.inArray(knownCookies[i].name, knownNames) == -1) { 532 knownNames.push(knownCookies[i].name); 533 if (knownCookies[i].essential) 534 essentialCookies.push(knownCookies[i]); 535 else 536 unessentialCookies.push(knownCookies[i]); 537 } 538 } 539 } 540 541 $('#cookieGuardMsgInner').append('<div id="cookieList"/>'); 542 543 $('#cookieList').append('<div class="cookiesHeader">' + (init ? $.cookieguard.settings.cookiesListInit : $.cookieguard.settings.cookiesListNew) + '</div>'); 544 $('#cookieList').append('<ul class="allCookies"/>'); 545 if (init) { 546 $('#cookieList > ul.allCookies').append('<li><div class="cookieName">' + $.cookieguard.settings.cookieGuardName + '</div><div class="cookieDescription"> - ' 547 548 + $.cookieguard.settings.cookieGuardDescription + '</div></li>'); 549 } 550 for (var i = 0; i < essentialCookies.length; i++) { 551 $('#cookieList > ul.allCookies').append('<li><div class="cookieName">' + essentialCookies[i].name + '</div><div class="cookieDescription"> - ' 552 553 + essentialCookies[i].description + '</div></li>'); 554 } 555 for (var i = 0; i < unessentialCookies.length; i++) { 556 $('#cookieList > ul.allCookies').append('<li><div class="cookieName">' + unessentialCookies[i].name + '</div><div class="cookieDescription"> - ' 557 558 + unessentialCookies[i].description + '</div></li>'); 559 } 560 for (var i = 0; i < unknownCookies.length; i++) { 561 $('#cookieList > ul.allCookies').append('<li><div class="cookieName">' + unknownCookies[i] + '</div></li>'); 562 } 563 }; 564 } 565 566 if (typeof $.cookieguard.displayMessage === 'undefined') { 567 $.cookieguard.displayMessage = function (showDelay, hideDelay) { 568 569 $('body').attr('marginTop', $('body').css('marginTop')).css('margin', 0).delay(showDelay).animate({ 570 'marginTop': $('#cookieGuardMsg').outerHeight() 571 }, $.cookieguard.settings.slideSpeed); 572 $('#head').attr('marginTop', $('body').css('marginTop')).css('margin', 0).delay(showDelay).animate({ 573 'marginTop': $('#cookieGuardMsg').outerHeight() 574 }, $.cookieguard.settings.slideSpeed); 575 $('#cookieGuardMsg').css('top', -$('#cookieGuardMsg').outerHeight()); 576 $('#cookieGuardMsg').delay(showDelay).addClass('visible').show().animate({ 577 'top': 0 578 }, $.cookieguard.settings.slideSpeed); 579 580 if ($.cookieguard.settings.messageHideDelay != null) { 581 $.cookieguard.settings.messageHideTimeout = setTimeout(function () { 582 $.cookieguard.hideMessage(0); 583 }, hideDelay); 584 } 585 }; 586 } 587 588 if (typeof $.cookieguard.hideMessage === 'undefined') { 589 $.cookieguard.hideMessage = function (hideDelay) { 590 $('body').delay(hideDelay).animate({ 591 'marginTop': $('body').attr('marginTop') 592 }, $.cookieguard.settings.slideSpeed); 593 $('#head').delay(hideDelay).animate({ 594 'marginTop': $('body').attr('marginTop') 595 }, $.cookieguard.settings.slideSpeed); 596 597 $('#cookieGuardMsg').delay(hideDelay).animate({ 598 'top': -$('#cookieGuardMsg').height() 599 }, $.cookieguard.settings.slideSpeed, null, function () { 600 $('#cookieGuardMsg').remove(); 601 $('body').attr('style', '').removeAttr('style'); 602 }); 603 } 604 } 605 606 if (typeof $.cookieguard.hasOnlyEssential === 'undefined') { 607 $.cookieguard.hasOnlyEssential = function () { 608 var knownCookies = $.cookieguard.settings.cookiesUsed; 609 610 for (var i = 0; i < knownCookies.length; i++) { 611 if (!knownCookies[i].essential) 612 return false; 613 } 614 return true; 615 } 616 } 617 saved_cookieguard=$.cookieguard; 618 })(jQuery);
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.