1/* 2 Copyright 2012-2013 Silktide Ltd. 3 4 This program is free software: you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation, either version 3 of the License, or 7 (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program. If not, see <http://www.gnu.org/licenses/> 16*/ 17 18var cc = 19{ 20 version: '1.0.10', 21 jqueryversionrequired: '1.4.4', 22 initobj: false, 23 ismobile: false, 24 setupcomplete: false, 25 allasked: false, 26 checkedlocal: false, 27 checkedremote: false, 28 remoteresponse: false, 29 frommodal: false, 30 hassetupmobile: false, 31 sessionkey: false, 32 noclosewin: false, 33 closingmodal: false, 34 jqueryattempts: 0, 35 reloadkey: false, 36 forcereload: false, 37 allagree: true, 38 checkedipdb: false, 39 cookies: {}, 40 uniqelemid: 0, 41 executionblock: 0, 42 defaultCookies: { social: {}, analytics: {}, advertising: {}}, 43 remoteCookies: {}, 44 approved: {}, 45 bindfunctions: {}, 46 checkeddonottrack: false, 47 eumemberstates: [ 48 "BE", 49 "BG", 50 "CZ", 51 "DK", 52 "DE", 53 "EE", 54 "IE", 55 "EL", 56 "ES", 57 "FR", 58 "IT", 59 "CY", 60 "LV", 61 "LT", 62 "LU", 63 "HU", 64 "MT", 65 "NL", 66 "AT", 67 "PL", 68 "PT", 69 "RO", 70 "SI", 71 "SK", 72 "FI", 73 "SE", 74 "UK" 75 ], 76 settings: { 77 refreshOnConsent: false, 78 style: "dark", 79 bannerPosition: "top", 80 clickAnyLinkToConsent: false, 81 privacyPolicy: false, 82 collectStatistics: false, 83 tagPosition: 'bottom-right', 84 useSSL: true, 85 serveraddr: 'https://cookieconsent.silktide.com/', 86 clearprefs: false, 87 consenttype: 'explicit', 88 onlyshowbanneronce: false, 89 hideallsitesbutton: false, 90 disableallsites: true, 91 hideprivacysettingstab: false, 92 scriptdelay: 800, 93 testmode: false, 94 overridewarnings: false, 95 onlyshowwithineu: false, 96 ipinfodbkey: false, 97 ignoreDoNotTrack: false 98 }, 99 100 strings: { 101 jqueryWarning: "Developer: Caution! In order to use Cookie Consent, you need to use jQuery 1.4.4 or higher.", 102 noJsBlocksWarning: "Developer: Warning! It doesn't look like you have set up Cookie Consent correctly.", 103 noKeyWarning: "Developer: Warning! You have set the plugin to only show within the EU, but you have not provided an API key for the IP Info DB.", 104 invalidKeyWarning: "Developer: Warning! You must provide a valid API key for IP Info DB.", 105 necessaryDefaultTitle: "Strictly necessary", 106 socialDefaultTitle: "Social media", 107 analyticsDefaultTitle: "Analytics", 108 advertisingDefaultTitle: "Advertising", 109 defaultTitle: "Default cookie title", 110 necessaryDefaultDescription: "Some cookies on this website are strictly necessary and cannot be disabled.", 111 socialDefaultDescription: "Facebook, Twitter and other social websites need to know who you are to work properly.", 112 analyticsDefaultDescription: "We anonymously measure your use of this website to improve your experience.", 113 advertisingDefaultDescription: "Adverts will be chosen for you automatically based on your past behaviour and interests.", 114 defaultDescription: "Default cookie description.", 115 notificationTitle: "Your experience on this site will be improved by allowing cookies", 116 notificationTitleImplicit: "We use cookies to ensure you get the best experience on our website", 117 poweredBy: "", 118 privacyPolicy: "Privacy policy", 119 learnMore: "Cookies policy", 120 link: "", 121 seeDetails: "see details", 122 seeDetailsImplicit: "change your settings", 123 hideDetails: "hide details", 124 savePreference: 'Save preference', 125 saveForAllSites: 'Save for all sites', 126 allowCookies: 'Allow cookies', 127 allowCookiesImplicit: 'Close', 128 allowForAllSites: 'Allow for all sites', 129 declineCookies: 'Continue without accepting', 130 customCookie: 'This website uses a custom type of cookie which needs specific approval', 131 privacySettings: "Privacy settings", 132 privacySettingsDialogTitleA: "Privacy settings", 133 privacySettingsDialogTitleB: "for this website", 134 privacySettingsDialogSubtitle: "Some features of this website need your consent to remember who you are.", 135 closeWindow: "Close window", 136 changeForAllSitesLink: "Change settings for all websites", 137 preferenceUseGlobal: 'Use global setting', 138 preferenceConsent: "I consent", 139 preferenceDecline: "I decline", 140 preferenceAsk: 'Ask me each time', 141 preferenceAlways: "Always allow", 142 preferenceNever: "Never allow", 143 notUsingCookies: "This website does not use any cookies.", 144 clearedCookies: "Your cookies have been cleared, you will need to reload this page for the settings to have effect.", 145 allSitesSettingsDialogTitleA: "Privacy settings", 146 allSitesSettingsDialogTitleB: "for all websites", 147 allSitesSettingsDialogSubtitle: "You may consent to these cookies for all websites that use this plugin.", 148 backToSiteSettings: "Back to website settings" 149 }, 150 151 onconsent: function (cookieType, input) { 152 if (cc.isfunction(input)) { 153 fn = input; 154 } 155 else { 156 scriptname = input; 157 fn = function () { 158 cc.insertscript(scriptname); 159 }; 160 } 161 if (cc.cookies && cc.cookies[cookieType] && cc.cookies[cookieType].approved) { 162 cc.cookies[cookieType].executed = true; 163 fn(); 164 } else { 165 if (window.jQuery) {
166 jQuery(document).bind("cc_" + cookieType, fn); 167 } else { 168 if (cc.bindfunctions[cookieType]) { 169 cc.bindfunctions[cookieType][cc.bindfunctions[cookieType].length] = fn; 170 } else { 171 cc.bindfunctions[cookieType] = new Array(fn); 172 } 173 } 174 } 175 }, 176 177 geturlparameter: function (name) { 178 name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); 179 var regexS = "[\\?&]" + name + "=([^&#]*)"; 180 var regex = new RegExp(regexS); 181 var results = regex.exec(window.location.search); 182 if (results == null) 183 return false; 184 else 185 return decodeURIComponent(results[1].replace(/\+/g, " ")); 186 }, 187 188 isfunction: function (functionToCheck) { 189 var getType = {}; 190 return functionToCheck && getType.toString.call(functionToCheck) == '[object Function]'; 191 }, 192 193 setup: function () { 194 jQuery.each(cc.bindfunctions, function (key, value) { 195 for (i = 0; i < value.length; i++) { 196 jQuery(document).bind("cc_" + key, value[i]); 197 } 198 }); 199 verstr = jQuery().jquery; 200 parts = verstr.split('.'); 201 versionRequired = cc.jqueryversionrequired.split('.'); 202 jqueryOk = true; 203 for (i = 0; i < parts.length && i < versionRequired.length; i++) { 204 currentpart = parseInt(parts[i]); 205 requiredpart = parseInt(versionRequired[i]); 206 if (currentpart < requiredpart) { 207 /* Unsatisfied - this part of the version string is less than the version we require */ 208 jqueryOk = false; 209 break; 210 } 211 if (currentpart > requiredpart) { 212 /* Satisfied - this part of the version string is greater than the version we require */ 213 break; 214 } 215 /* This version is the same as the one we require. Check the next part of the version number. */ 216 } 217 if (!jqueryOk) { 218 alert(cc.strings.jqueryWarning); 219 } 220 jQuery.each(cc.defaultCookies, function (key, value) { 221 if (key == "necessary") { 222 cc.defaultCookies[key].title = cc.strings.necessaryDefaultTitle; 223 cc.defaultCookies[key].description = cc.strings.necessaryDefaultDescription; 224 } 225 else if (key == "social") { 226 cc.defaultCookies[key].title = cc.strings.socialDefaultTitle; 227 cc.defaultCookies[key].description = cc.strings.socialDefaultDescription; 228 } 229 else if (key == "analytics") { 230 cc.defaultCookies[key].title = cc.strings.analyticsDefaultTitle; 231 cc.defaultCookies[key].description = cc.strings.analyticsDefaultDescription; 232 } 233 else if (key == "advertising") { 234 cc.defaultCookies[key].title = cc.strings.advertisingDefaultTitle; 235 cc.defaultCookies[key].description = cc.strings.advertisingDefaultDescription; 236 } 237 }); 238 239 console.log(cc.initobj.cookies); 240 241 jQuery.each(cc.initobj.cookies, function (key, value) { 242 243 if (!value.title) { 244 if (key == "necessary") { 245 cc.initobj.cookies[key].title = cc.strings.necessaryDefaultTitle; 246 } 247 else if (key == "social") { 248 cc.initobj.cookies[key].title = cc.strings.socialDefaultTitle; 249 } 250 else if (key == "analytics") { 251 cc.initobj.cookies[key].title = cc.strings.analyticsDefaultTitle; 252 } 253 else if (key == "advertising") { 254 cc.initobj.cookies[key].title = cc.strings.advertisingDefaultTitle; 255 } else { 256 cc.initobj.cookies[key].title = cc.strings.defaultTitle; 257 } 258 } 259 if (!value.description) { 260 if (key == "necessary") { 261 cc.initobj.cookies[key].description = cc.strings.necessaryDefaultDescription; 262 } 263 else if (key == "social") { 264 cc.initobj.cookies[key].description = cc.strings.socialDefaultDescription; 265 } 266 else if (key == "analytics") { 267 cc.initobj.cookies[key].description = cc.strings.analyticsDefaultDescription; 268 } 269 else if (key == "advertising") { 270 cc.initobj.cookies[key].description = cc.strings.advertisingDefaultDescription; 271 } else { 272 cc.initobj.cookies[key].description = cc.strings.defaultDescription; 273 } 274 } 275 276 if (!value.defaultstate) { 277 cc.initobj.cookies[key].defaultstate = "on"; 278 } 279 280 cc.initobj.cookies[key].asked = false; 281 cc.initobj.cookies[key].approved = false; 282 cc.initobj.cookies[key].executed = false; 283 }); 284 if (cc.settings.onlyshowwithineu && !cc.settings.ipinfodbkey) { 285 alert(cc.strings.noKeyWarning); 286 } 287 testmode = cc.geturlparameter('cctestmode'); 288 if (testmode == 'accept' || testmode == 'decline') { 289 cc.settings.testmode = testmode; 290 } 291 if (cc.settings.disableallsites) { 292 cc.settings.hideallsitesbutton = true; 293 } 294 295 for (var attrname in cc.initobj.cookies) { 296 cc.cookies[attrname] = cc.initobj.cookies[attrname]; 297 if (cc.settings.testmode == "accept") { 298 cc.approved[attrname] = "yes"; 299 } 300 if (cc.settings.testmode == "decline") { 301 cc.approved[attrname] = "no"; 302 } 303 } 304 305 }, 306 307 initialise: function (obj) { 308 cc.initobj = obj;
309 if (obj.settings !== undefined) { 310 for (var attrname in obj.settings) { 311 this.settings[attrname] = obj.settings[attrname]; 312 } 313 } 314 if (obj.strings !== undefined) { 315 for (var attrname in obj.strings) { 316 this.strings[attrname] = obj.strings[attrname]; 317 } 318 } 319 cc.settings.style = "cc-" + cc.settings.style; 320 cc.settings.bannerPosition = "cc-" + cc.settings.bannerPosition; 321 if (cc.settings.useSSL) { 322 cc.settings.serveraddr = 'https://cookieconsent.silktide.com/'; 323 } 324 if (window.jQuery) { 325 cc.setupcomplete = true; 326 cc.setup(); 327 } 328 }, 329 330 calculatestatsparams: function () { 331 params = "c="; 332 first = true; 333 jQuery.each(cc.initobj.cookies, function (key, value) { 334 if (first) { 335 first = false; 336 } else { 337 params += ";"; 338 } 339 params += encodeURIComponent(key) + ":"; 340 341 if (cc.approved[key]) { 342 params += cc.approved[key]; 343 } else { 344 params += "none"; 345 } 346 if (value.statsid) { 347 params += ":" + value.statsid; 348 } 349 }); 350 if (cc.ismobile) { 351 params += "&m=1"; 352 } else { 353 params += "&m=0"; 354 } 355 params += "&u=" + encodeURIComponent(document.URL); 356 return params; 357 }, 358 359 setsessionkey: function (data) { 360 cc.sessionkey = data; 361 }, 362 363 364 fetchprefs: function () { 365 cc.remoteresponse = false; 366 params = "?s=1"; 367 if (cc.settings.collectStatistics) { 368 params = "?s=1&" + cc.calculatestatsparams(); 369 } 370 if (cc.settings.clearprefs) { 371 params += "&v=1"; 372 cc.settings.clearprefs = false; 373 } 374 cc.insertscript(cc.settings.serveraddr + params); 375 setTimeout(function () { 376 if (!cc.remoteresponse) { 377 cc.checkapproval(); 378 } 379 }, 3000); 380 this.checkedremote = true; 381 }, 382 383 responseids: function (data) { 384 jQuery.each(data, function (key, value) { 385 cc.cookies[key].statsid = value; 386 }); 387 }, 388 389 insertscript: function (script) { 390 var newfile = document.createElement('script'); 391 newfile.setAttribute("type", "text/javascript"); 392 newfile.setAttribute("src", script); 393 document.getElementsByTagName("head")[0].appendChild(newfile); 394 }, 395 396 insertscripttag: function (content) { 397 var newfile = document.createElement('script'); 398 newfile.setAttribute("type", "text/javascript"); 399 newfile.innerHTML = content; 400 document.getElementsByTagName("head")[0].appendChild(newfile); 401 }, 402 403 checklocal: function () { 404 this.checkedlocal = true; 405 jQuery.each(cc.cookies, function (key, value) { 406 cookieval = cc.getcookie('cc_' + key); 407 if (cookieval) { 408 cc.approved[key] = cookieval; 409 } 410 }); 411 this.checkapproval(); 412 }, 413 414 response: function (data) { 415 cc.remoteresponse = true 416 jQuery.each(data, function (key, value) { 417 if (cc.cookies[key] && (!cc.approved[key] || (cc.approved[key] && (cc.approved[key] == "always" || cc.approved[key] == "never")))) { 418 cc.setcookie('cc_' + key, value, 365); 419 } 420 }); 421 422 for (var attrname in data) { 423 cc.remoteCookies[attrname] = data[attrname]; 424 if (this.approved[attrname] != "yes" && this.approved[attrname] != "no") { 425 this.approved[attrname] = data[attrname]; 426 } 427 } 428 jQuery.each(cc.cookies, function (key, value) { 429 if (!data[key] && (cc.approved[key] == "always" || cc.approved[key] == "never")) { 430 cc.cookies[key].approved = false; 431 cc.deletecookie(key); 432 delete cc.approved[key]; 433 } 434 }); 435 436 this.checkapproval(); 437 }, 438
439 deletecookie: function (key) { 440 date = new Date(); 441 date.setDate(date.getDate() - 1); 442 document.cookie = escape("cc_" + key) + '=; path=/; expires=' + date + '; SameSite=Lax'; 443 }, 444 445 reloadifnecessary: function () { 446 if (cc.settings.refreshOnConsent || cc.ismobile || cc.forcereload) { 447 setTimeout("location.reload(true);", 50); 448 } 449 }, 450 451 onkeyup: function (e) { 452 if (e.keyCode == 27) { 453 cc.closemodals(); 454 } 455 }, 456 457 closemodals: function () { 458 if (!cc.closingmodal) { 459 if (cc.noclosewin) { 460 cc.noclosewin = false; 461 } else { 462 if (jQuery('#cc-modal').is(":visible")) { 463 jQuery('#cc-modal .cc-modal-closebutton a').click(); 464 } 465 if (jQuery('#cc-settingsmodal').is(":visible")) { 466 jQuery('#cc-settingsmodal #cc-settingsmodal-closebutton a').click(); 467 } 468 } 469 } 470 }, 471 472 showbanner: function () { 473 console.log("Settings %o", cc.settings); 474 jQuery('#cc-tag').fadeOut(null, function () { 475 jQuery(this).remove(); 476 }); 477 jQuery('#cc-notification, #cc-wrapper').remove(); 478 if (cc.ismobile) { 479 cc.setupformobile(); 480 jQuery('head').append('<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">'); 481 jQuery('body').html('').css("margin", 0); 482 } 483 data = '<div id="cc-notification">' + 484 '<div id="cc-notification-wrapper">' + 485 '<h2><span>' + cc.strings.notificationTitle + '</span> <a class="cc-link open_iframe" href="' + cc.strings.link + (cc.ismobile ? '?show=back' : '') + '" id="cc-policy-link' + (cc.ismobile ? '-off' : '') + '">' + cc.strings.learnMore + '</a></h2>' + 486 '<div id="cc-notification-permissions">' + 487 '</div>' + 488 '<ul class="cc-notification-buttons">' + 489 '<li><a class="cc-link" href="#" id="cc-decline-button-thissite">' + cc.strings.declineCookies + '</a></li>' + 490 '<li><a class="cc-link cc-button-enableall" href="#" id="cc-approve-button-thissite">' + cc.strings.allowCookies + '</a></li>' + 491 '<li><a class="cc-link2" href="#" id="cc-notification-moreinfo">' + cc.strings.seeDetails + '</a></li>' + 492 '</ul>' + 493 '<div class="cc-clear"></div>' + 494 '</div>' + 495 '</div>'; 496 497 jQuery('body').prepend(data); 498 if (cc.settings.hideallsitesbutton) { 499 jQuery('#cc-approve-button-allsites').hide(); 500 } 501 if (cc.settings.consenttype == 'implicit') { 502 jQuery('#cc-notification h2 span').html(cc.strings.notificationTitleImplicit); 503 jQuery('#cc-approve-button-thissite').html(cc.strings.allowCookiesImplicit); 504 jQuery('#cc-approve-button-thissite').parent().after(jQuery('#cc-approve-button-allsites').parent()); 505 jQuery('#cc-approve-button-allsites').hide(); 506 } 507 jQuery('#cc-notification-logo').hide(); 508 if (cc.settings.privacyPolicy) { 509 jQuery('#cc-notification-moreinformation').prepend('<a href="' + cc.settings.privacyPolicy + '">' + cc.strings.privacyPolicy + '</a> | '); 510 } 511 jQuery('#cc-notification').addClass(cc.settings.style).addClass(cc.settings.bannerPosition); 512 bannerh = jQuery('#cc-notification').height(); 513 jQuery('#cc-notification, #cc-wrapper').hide(); 514 if (cc.ismobile) { 515 jQuery('#cc-notification').addClass("cc-mobile"); 516 } 517 jQuery('#cc-notification-permissions').prepend('<ul></ul>'); 518 allcustom = true; 519 jQuery.each(cc.cookies, function (key, value) { 520 if (!value.asked) { 521 jQuery('#cc-notification-permissions ul').append('<li><input type="checkbox" checked="checked" id="cc-checkbox-' + key + '" /> <label id="cc-label-' + key + '" for="cc-checkbox-' + key + '"><strong>' + value.title + '</strong> ' + value.description + '</label></li>'); 522 if (value.link) { 523 jQuery('#cc-label-' + key).append(' <a target="_blank" href="' + value.link + '" class="cc-learnmore-link">' + cc.strings.learnMore + '</a>'); 524 } 525 if (key == "social" || key == "analytics" || key == "advertising") { 526 allcustom = false; 527 } 528 jQuery('#cc-checkbox-' + key).change(function () { 529 if (jQuery(this).is(':checked')) { 530 jQuery(this).parent().removeClass('cc-notification-permissions-inactive'); 531 } else { 532 jQuery(this).parent().addClass('cc-notification-permissions-inactive'); 533 534 } 535 }); 536 if (value.defaultstate == "off") { 537 jQuery('#cc-checkbox-' + key).removeAttr("checked").parent().addClass('cc-notification-permissions-inactive'); 538 } 539 if (key == "necessary") { 540 jQuery('#cc-checkbox-' + key).attr("disabled", "disabled"); 541 } 542 } 543 }); 544 //jQuery('#cc-notification-wrapper h2').append(' <a class="cc-link" href="#" id="cc-notification-moreinfo2">' + cc.strings.seeDetails + '</a>'); 545 if (cc.settings.consenttype == "implicit") { 546 jQuery('#cc-notification-moreinfo').html(cc.strings.seeDetailsImplicit); 547 } 548 549 jQuery('#cc-notification-moreinfo').click(function () 550 { 551 if (jQuery(this).html() == cc.strings.seeDetails || jQuery(this).html() == cc.strings.seeDetailsImplicit) { 552 553 if (cc.settings.consenttype == 'implicit') { 554 if (!cc.settings.hideallsitesbutton) { 555 jQuery('#cc-approve-button-allsites').show(); 556 } 557 } 558 559 jQuery('#cc-approve-button-thissite').removeClass('cc-button-enableall').html(cc.strings.savePreference); 560 jQuery('#cc-approve-button-allsites').html(cc.strings.saveForAllSites); 561 jQuery(this).html(cc.strings.hideDetails); 562 563 } else { 564 jQuery.each(cc.cookies, function (key, value) { 565 if (value.defaultstate == "off") { 566 jQuery('#cc-checkbox-' + key).removeAttr("checked"); 567 jQuery(this).parent().addClass('cc-notification-permissions-inactive'); 568 } else { 569 jQuery('#cc-checkbox-' + key).attr('checked', 'checked'); 570 jQuery(this).parent().removeClass('cc-notification-permissions-inactive'); 571 572 } 573 }); 574 if (cc.settings.consenttype == 'implicit') { 575 jQuery(this).html(cc.strings.seeDetailsImplicit); 576 jQuery('#cc-approve-button-thissite').addClass('cc-button-enableall').html(cc.strings.allowCookiesImplicit); 577 jQuery('#cc-approve-button-allsites').hide(); 578 } else { 579 jQuery(this).html(cc.strings.seeDetails); 580 jQuery('#cc-approve-button-thissite').addClass('cc-button-enableall').html(cc.strings.allowCookies); 581 jQuery('#cc-approve-button-allsites').html(cc.strings.allowForAllSites); 582 } 583 } 584 585 jQuery('#cc-notification').toggleClass('opening'); 586 jQuery('#cc-notification-logo').fadeToggle(); 587 jQuery('#cc-notification-permissions').slideToggle(); 588 jQuery('#cc-notification').removeClass('opening').toggleClass('opened'); 589 jQuery(this).blur(); 590 return false; 591 592 }); 593 594 if (!cc.ismobile) { 595 if (cc.settings.bannerPosition == "cc-push") { 596 jQuery('html').animate({marginTop: bannerh}, 400); 597 } 598 jQuery('#cc-notification').slideDown(); 599 jQuery('#cc-wrapper').hide(); 600 } else { 601 jQuery('#cc-notification, #cc-wrapper').show(); 602 } 603 604 if (cc.settings.bannerPosition == "cc-center") { 605 jQuery('#cc-notification').wrap('<div id="cc-wrapper"></div>'); 606 jQuery('#cc-wrapper').addClass(cc.settings.style).addClass(cc.settings.bannerPosition); 607 } 608 609 jQuery('#cc-approve-button-thissite').click(cc.onlocalconsentgiven); 610 jQuery('#cc-decline-button-thissite').click(cc.onlocalconsentdeclined); 611 if (cc.settings.clickAnyLinkToConsent) { 612 jQuery("a").filter(':not(.cc-link)').click(cc.onlocalconsentgiven); 613 } 614 if (allcustom) { 615 jQuery('#cc-notification h2 span').html(cc.strings.customCookie); 616 jQuery('#cc-approve-button-allsites').hide(); 617 } else { 618 jQuery('#cc-approve-button-allsites').click(cc.onremoteconsentgiven); 619 } 620 621 }, 622 623 timestamp: function () { 624 return Math.round((new Date()).getTime() / 1000); 625 }, 626 627 locationcallback: function (data) { 628 if (data.statusCode == "OK" && data.countryCode) { 629 ineu = "yes"; 630 if (jQuery.inArray(data.countryCode, cc.eumemberstates) == -1) { 631 //Visitor is from outside EU 632 ineu = "no"; 633 jQuery.each(cc.cookies, function (key, value) { 634 cc.approved[key] = "yes"; 635 }); 636 cc.settings.hideprivacysettingstab = true; 637 } 638 cc.setcookie('cc_ineu', ineu, 365); 639 } 640 if (data.statusCode == "ERROR" && data.statusMessage == "Invalid API key.") { 641 alert(cc.strings.invalidKeyWarning) 642 } 643 cc.checkapproval(); 644 }, 645 646 checkdonottrack: function () { 647 cc.checkeddonottrack = true; 648 if (!cc.settings.ignoreDoNotTrack) { 649 if (navigator.doNotTrack == "yes" || navigator.doNotTrack == "1" || navigator.msDoNotTrack == "yes" || navigator.msDoNotTrack == "1") { 650 cc.settings.consenttype = "explicit"; 651 } 652 } 653 cc.checkapproval(); 654 }, 655 656 checkapproval: function () { 657 if (!cc.checkedipdb && cc.settings.onlyshowwithineu) { 658 cc.checkedipdb = true; 659 ineu = cc.getcookie('cc_ineu'); 660 if (ineu) { 661 if (ineu == "no") { 662 jQuery.each(cc.cookies, function (key, value) { 663 cc.approved[key] = "yes"; 664 }); 665 cc.settings.hideprivacysettingstab = true; 666 } 667 } else { 668 jQuery.getScript("http://api.ipinfodb.com/v3/ip-country/?key=" + cc.settings.ipinfodbkey + "&format=json&callback=cc.locationcallback"); 669 return; 670 } 671 } 672
673 cc.allasked = true; 674 jQuery.each(cc.cookies, function (key, value) { 675 if (cc.approved[key]) { 676 if (cc.approved[key] == "yes" || (cc.approved[key] == "always" && cc.checkedremote)) { 677 cc.cookies[key].asked = true; 678 cc.cookies[key].approved = true; 679 cc.execute(key); 680 } else if ((cc.approved[key] == "never" && cc.checkedremote) || cc.approved[key] == "no") { 681 cc.cookies[key].asked = true; 682 cc.cookies[key].approved = false; 683 } else { 684 685 cc.allasked = false; 686 } 687 } else { 688 689 cc.allasked = false; 690 } 691 }); 692 693 if (!cc.allasked) { 694 if (!cc.checkedlocal) { 695 cc.checklocal(); 696 return; 697 } 698 if (!cc.checkedremote && !cc.settings.disableallsites) { 699 cc.fetchprefs(); 700 return; 701 } 702 if (!cc.checkeddonottrack) { 703 cc.checkdonottrack(); 704 return; 705 } 706 if (cc.settings.consenttype == "implicit") { 707 jQuery.each(cc.cookies, function (key, value) { 708 if (!cc.cookies[key].asked) { 709 if (cc.settings.onlyshowbanneronce) { 710 cc.setcookie('cc_' + key, 'yes', 365); 711 } 712 cc.execute(key); 713 } 714 }); 715 } 716 cc.showbanner(); 717 } else { 718 if (cc.settings.collectStatistics) { 719 params = ""; 720 params += "?s=1&n=1&" + cc.calculatestatsparams(); 721 cc.insertscript(cc.settings.serveraddr + params); 722 } 723 cc.showminiconsent(); 724 } 725 }, 726 727 execute: function (cookieType) { 728 if (cookieType == "necessary") { 729 return; 730 } 731 if (cc.cookies[cookieType].executed) { 732 return; 733 } 734 jQuery('.cc-placeholder-' + cookieType).remove(); 735 jQuery('script.cc-onconsent-' + cookieType + '[type="text/plain"]').each(function () { 736 if (jQuery(this).attr('src')) { 737 jQuery(this).after('<script type="text/javascript" src="' + jQuery(this).attr('src') + '"></script>'); 738 } else { 739 jQuery(this).after('<script type="text/javascript">' + jQuery(this).html() + '</script>'); 740 } 741 }); 742 cc.cookies[cookieType].executed = true; 743 jQuery(document).trigger("cc_" + cookieType); 744 745 cc.executescriptinclusion(cookieType); 746 747 }, 748 749 executescriptinclusion: function (cookieType) { 750 timetaken = jQuery('script.cc-onconsent-inline-' + cookieType + '[type="text/plain"]').length * cc.settings.scriptdelay; 751 now = new Date().getTime(); 752 753 if (now < cc.executionblock) { 754 setTimeout(cc.executescriptinclusion, cc.executionblock - now, [cookieType]); 755 return; 756 } 757 cc.executionblock = now + timetaken; 758 759 cc.insertscripts(cookieType); 760 }, 761 762 insertscripts: function (cookieType) { 763 764 jQuery('script.cc-onconsent-inline-' + cookieType + '[type="text/plain"]').first().each(function () { 765 cc.uniqelemid++; 766 if (jQuery(this).parents('body').length > 0) { 767 jQuery(this).after('<div id="cc-consentarea-' + cc.uniqelemid + '" class="' + cookieType + '"></div>'); 768 document.write = function (g) { 769 jQuery('#cc-consentarea-' + cc.uniqelemid).append(g); 770 }; 771 document.writeln = function (g) { 772 jQuery('#cc-consentarea-' + cc.uniqelemid).append(g); 773 }; 774 } 775 776 if (jQuery(this).attr('src')) { 777 jQuery(this).after('<script type="text/javascript" src="' + jQuery(this).attr('src') + '"></script>'); 778 } else { 779 jQuery(this).after('<script type="text/javascript">' + jQuery(this).html() + '</script>'); 780 } 781 jQuery(this).remove(); 782 783 }); 784 785 if (jQuery('script.cc-onconsent-inline-' + cookieType + '[type="text/plain"]').length > 0) { 786 setTimeout(cc.insertscripts, cc.settings.scriptdelay, [cookieType]); 787 } 788 }, 789 790 getcookie: function (c_name) { 791 var i, x, y, ARRcookies = document.cookie.split(";"); 792 for (i = 0; i < ARRcookies.length; i++) { 793 x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("=")); 794 y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1); 795 x = x.replace(/^\s+|\s+$/g, ""); 796 if (x == c_name) { 797 return unescape(y); 798 } 799 } 800 return false; 801 }, 802 803 setcookie: function (name, value, expirydays) { 804 var exdate = new Date(); 805 exdate.setDate(exdate.getDate() + expirydays);
806 document.cookie = name + '=' + value + '; expires=' + exdate.toUTCString() + '; path=/; SameSite=Lax' 807 }, 808 809 onremoteconsentgiven: function () { 810 if (cc.settings.clickAnyLinkToConsent) { 811 jQuery("a").filter(':not(.cc-link)').unbind("click"); 812 } 813 cc.allagree = true; 814 jQuery.each(cc.cookies, function (key, value) { 815 if (!value.approved && !value.asked) { 816 if (jQuery('#cc-checkbox-' + key).is(':checked')) { 817 if (key == "social" || key == "analytics" || key == "advertising") { 818 cc.remoteCookies[key] = "always"; 819 cc.approved[key] = "always"; 820 } else { 821 cc.approved[key] = "yes"; 822 } 823 cc.cookies[key].asked = true; 824 } else { 825 if (key == "social" || key == "analytics" || key == "advertising") { 826 cc.remoteCookies[key] = "never"; 827 cc.approved[key] = "never"; 828 } else { 829 cc.approved[key] = "no"; 830 } 831 cc.allagree = false; 832 cc.cookies[key].asked = true; 833 } 834 cc.setcookie('cc_' + key, cc.approved[key], 365); 835 } else { 836 } 837 }); 838 urlx = cc.settings.serveraddr + '?p=1&tokenonly=true&cc-key=' + cc.sessionkey; 839 if (cc.remoteCookies['social']) { 840 urlx += '&cc-cookies-social=' + cc.approved['social']; 841 } 842 if (cc.remoteCookies['analytics']) { 843 urlx += '&cc-cookies-analytics=' + cc.approved['analytics']; 844 } 845 if (cc.remoteCookies['advertising']) { 846 urlx += '&cc-cookies-advertising=' + cc.approved['advertising']; 847 } 848 cc.reloadkey = true; 849 cc.insertscript(urlx); 850 851 if (!cc.ismobile) {
852 jQuery('#cc-notification').slideUp(); 853 jQuery('#cc-wrapper').hide(); 854 if (cc.settings.bannerPosition == "cc-push") { 855 //detect body margin 856 jQuery('html').animate({marginTop: 0}, 400); 857 } 858 } 859 cc.checkapproval(); 860 861 return false; 862 }, 863 864 onlocalconsentgiven: function () { 865 enableall = false; 866 enablejustone = false; 867 868 if (jQuery(this).hasClass('cc-button-enableall') || jQuery(this).hasClass('cc-button-enable-all')) { 869 enableall = true; 870 jQuery.each(cc.cookies, function (key, value) { 871 cc.cookies[key].asked = false; 872 }); 873 } 874 elem = this; 875 876 jQuery.each(cc.cookies, function (key, value) { 877 if (jQuery(elem).hasClass('cc-button-enable-' + key)) { 878 enablejustone = true; 879 cc.approved[key] = "yes"; 880 cc.cookies[key].asked = true; 881 cc.setcookie('cc_' + key, cc.approved[key], 365); 882 } 883 }); 884 885 cc.allagree = true; 886 if (!enablejustone) { 887 if (cc.settings.clickAnyLinkToConsent) { 888 jQuery("a").filter(':not(.cc-link)').unbind("click"); 889 } 890 jQuery.each(cc.cookies, function (key, value) { 891 if (!value.approved && !value.asked) { 892 if (enableall || jQuery('#cc-checkbox-' + key).is(':checked')) { 893 cc.approved[key] = "yes"; 894 cc.cookies[key].asked = true; 895 } else { 896 cc.approved[key] = "no"; 897 cc.cookies[key].asked = true; 898 cc.allagree = false; 899 } 900 cc.setcookie('cc_' + key, cc.approved[key], 365); 901 } else { 902 } 903 }); 904 } 905 if (!cc.allagree && cc.settings.consenttype == "implicit") { 906 cc.forcereload = true; 907 } 908 909 if (!cc.ismobile) {
910 jQuery('#cc-notification').slideUp(); 911 jQuery('#cc-wrapper').hide(); 912 if (cc.settings.bannerPosition == "cc-push") { 913 //detect body margin 914 jQuery('html').animate({marginTop: 0}, 400); 915 } 916 } 917 cc.checkapproval(); 918 cc.reloadifnecessary(); 919 920 return false; 921 }, 922 923 onlocalconsentdeclined: function () { 924 cc.allagree = false; 925 jQuery.each(cc.cookies, function (key, value) { 926 if (!value.approved && !value.asked) { 927 cc.approved[key] = "no"; 928 cc.cookies[key].asked = true; 929 } 930 if (key == 'necessary') { 931 cc.approved[key] = "yes"; 932 cc.cookies[key].asked = true; 933 } 934 cc.setcookie('cc_' + key, cc.approved[key], 365); 935 }); 936 937 if (!cc.ismobile) { 938 jQuery('#cc-notification').slideUp(); 939 jQuery('#cc-wrapper').hide(); 940 if (cc.settings.bannerPosition == "cc-push") { 941 jQuery('html').animate({marginTop: 0}, 400); 942 } 943 } 944 cc.checkapproval(); 945 cc.reloadifnecessary(); 946 947 return false; 948 }, 949 950 showminiconsent: function () { 951 if (jQuery('#cc-tag').length == 0) { 952 data = '<div id="cc-tag" class="cc-tag-' + cc.settings.tagPosition + '"><a class="cc-link" href="#" id="cc-tag-button" title="' + cc.strings.privacySettings + '"><span>' + cc.strings.privacySettings + '</span></a></div>'; 953 jQuery('body').prepend(data); 954 jQuery('#cc-tag').addClass(cc.settings.style); 955 if (!cc.settings.hideprivacysettingstab) { 956 jQuery('#cc-tag').fadeIn(); 957 } else { 958 jQuery('#cc-tag').hide(); 959 } 960 jQuery('.cc-privacy-link').click(cc.showmodal); 961 jQuery('#cc-tag-button').click(cc.showmodal); 962 } 963 }, 964 965 getsize: function (obj) { 966 var size = 0, key; 967 for (key in obj) { 968 if (obj.hasOwnProperty(key)) size++; 969 } 970 return size; 971 }, 972 973 settoken: function (data) { 974 if (cc.reloadkey) { 975 cc.reloadkey = false; 976 if (!cc.allagree && cc.settings.consenttype == "implicit") { 977 cc.forcereload = true; 978 } 979 cc.reloadifnecessary(); 980 } 981 cc.sessionkey = data; 982 }, 983 984 showmodal: function () { 985 if (!cc.checkedremote && !cc.settings.disableallsites) { 986 cc.fetchprefs(); 987 } 988 jQuery(document).bind('keyup', cc.onkeyup); 989 jQuery('body').prepend('<div id="cc-modal-overlay"></div>'); 990 jQuery(this).blur(); 991 if (cc.ismobile) { 992 cc.setupformobile(); 993 } 994 data = '<div id="cc-modal">' + 995 '<div id="cc-modal-wrapper">' + 996 '<h2>' + cc.strings.privacySettingsDialogTitleA + ' <span>' + cc.strings.privacySettingsDialogTitleB + '</span></h2>' + 997 '<p class="cc-subtitle">' + cc.strings.privacySettingsDialogSubtitle + '</p>' + 998 999 '<div class="cc-content">' + 1000 '</div>' + 1001 1002 '<div class="cc-clear"></div>' + 1003 1004 '<p id="cc-modal-closebutton" class="cc-modal-closebutton"><a class="cc-link" href="#" title="' + cc.strings.closeWindow + '"><span>' + cc.strings.closeWindow + '</span></a></p>' + 1005 '<div id="cc-modal-footer-buttons">' + 1006 1007 '<p id="cc-modal-global"><a class="cc-link" href="#" title="' + cc.strings.changeForAllSitesLink + '"><span>' + cc.strings.changeForAllSitesLink + '</span></a></p></div>' + 1008 '<a id="cc-notification-logo" class="cc-logo" target="_blank" rel="noreferrer" href="http://silktide.com/cookieconsent" title="' + cc.strings.poweredBy + '"><span>' + cc.strings.poweredBy + '</span></a> ' + 1009 '<div class="cc-clear"></div>' + 1010 '</div>' + 1011 '</div>'; 1012 jQuery('body').prepend(data); 1013 if (cc.settings.disableallsites) { 1014 jQuery('#cc-modal-global').hide(); 1015 } 1016 jQuery('#cc-modal').addClass(cc.settings.style).click(cc.closemodals); 1017 if (cc.ismobile) { 1018 jQuery('#cc-modal').addClass("cc-mobile"); 1019 } 1020 cc.reloadmodal(); 1021 jQuery('#cc-modal').fadeIn(); 1022 jQuery('#cc-modal-overlay').fadeIn(); 1023 jQuery('#cc-modal-wrapper').click(function () { 1024 cc.noclosewin = true; 1025 }); 1026 jQuery('#cc-modal .cc-modal-closebutton a').click(function () { 1027 cc.showhidemodal(); 1028 cc.reloadifnecessary(); 1029 return false; 1030 }); 1031 jQuery('#cc-modal-global').click(function () { 1032 cc.frommodal = true; 1033 cc.gotosettings();
1034 return false; 1035 }); 1036 jQuery('#cc-tag-button').unbind('click').click(cc.showhidemodal); 1037 jQuery('.cc-privacy-link').unbind('click').click(cc.showhidemodal); 1038 1039 return false; 1040 }, 1041 1042 closepreferencesmodal: function () { 1043 jQuery.each(cc.defaultCookies, function (key, value) { 1044 value = jQuery('#cc-globalpreference-selector-' + key).val(); 1045 if (cc.approved[key] != "yes" && cc.approved[key] != "no") { 1046 cc.approved[key] = value; 1047 cc.setcookie('cc_' + key, cc.approved[key], 365); 1048 } 1049 cc.remoteCookies[key] = value; 1050 1051 }); 1052 urlx = cc.settings.serveraddr + '?p=1&tokenonly=true&cc-key=' + cc.sessionkey; 1053 if (cc.remoteCookies['social']) { 1054 urlx += '&cc-cookies-social=' + cc.remoteCookies['social']; 1055 } 1056 if (cc.remoteCookies['analytics']) { 1057 urlx += '&cc-cookies-analytics=' + cc.remoteCookies['analytics']; 1058 } 1059 if (cc.remoteCookies['advertising']) { 1060 urlx += '&cc-cookies-advertising=' + cc.remoteCookies['advertising']; 1061 } 1062 1063 cc.insertscript(urlx); 1064 1065 jQuery('#cc-notification, #cc-wrapper').hide().remove(); 1066 jQuery(this).blur(); 1067 jQuery('#cc-settingsmodal').fadeOut(null, function () { 1068 jQuery('#cc-settingsmodal').remove(); 1069 }); 1070 if (!cc.frommodal) { 1071 cc.checkapproval(); 1072 cc.reloadifnecessary(); 1073 } else { 1074 cc.frommodal = false; 1075 cc.showhidemodal(); 1076 } 1077 return false; 1078 }, 1079 1080 showhidemodal: function () { 1081 jQuery(this).blur(); 1082 cc.checkedlocal = false; 1083 cc.checkedremote = false; 1084 if (jQuery('#cc-modal').is(":visible") && !cc.frommodal) { 1085 cc.closingmodal = true; 1086 jQuery('#cc-modal-overlay').fadeToggle(null, function () { 1087 cc.closingmodal = false; 1088 }); 1089 jQuery.each(cc.cookies, function (key, value) { 1090 thisval = jQuery('#cc-preference-selector-' + key).val(); 1091 1092 if (key == "necessary") { 1093 thisval = "yes"; 1094 } 1095 1096 if (thisval == "no") { 1097 cc.cookies[key].approved = false; 1098 cc.approved[key] = "no"; 1099 cc.setcookie('cc_' + key, cc.approved[key], 365); 1100 } else if (thisval == "yes") { 1101 cc.cookies[key].approved = true; 1102 cc.approved[key] = "yes"; 1103 cc.setcookie('cc_' + key, cc.approved[key], 365); 1104 } else { 1105 cc.cookies[key].approved = false; 1106 cc.deletecookie(key); 1107 delete cc.approved[key]; 1108 } 1109 cc.cookies[key].asked = false; 1110 1111 }); 1112 cc.checkapproval(); 1113 } else if (!jQuery('#cc-settingsmodal').is(":visible") && !jQuery('#cc-modal').is(":visible")) { 1114 cc.closingmodal = true; 1115 jQuery('#cc-modal-overlay').fadeToggle(null, function () { 1116 cc.closingmodal = false; 1117 }); 1118 } 1119 if (cc.ismobile) { 1120 jQuery('#cc-modal').toggle(); 1121 } else { 1122 jQuery('#cc-modal').fadeToggle(); 1123 } 1124 return false; 1125 }, 1126 1127 1128 reloadmodal: function () { 1129 jQuery('#cc-modal-wrapper .cc-content').html(''); 1130 if (cc.getsize(cc.cookies) > 0) { 1131 jQuery('#cc-modal-wrapper .cc-content').append('<ul></ul>'); 1132 jQuery.each(cc.cookies, function (key, value) { 1133 1134 jQuery('#cc-modal-wrapper ul').append('<li id="cc-preference-element-' + key + '"><label for="cc-preference-selector-' + key + '"><strong>' + value.title + '</strong><span>' + value.description + '</span></label><select id="cc-preference-selector-' + key + '"><option value="yes">' + cc.strings.preferenceConsent + '</option><option value="no">' + cc.strings.preferenceDecline + '</option></select></li>'); 1135 if (value.link) { 1136 jQuery('#cc-preference-element-' + key + ' label span').append(' <a target="_blank" href="' + value.link + '" class="cc-learnmore-link">' + cc.strings.learnMore + '</a>'); 1137 } 1138 if ((key == "social" || key == "advertising" || key == "analytics") && !cc.settings.disableallsites) { 1139 jQuery('#cc-preference-selector-' + key).append('<option value="global">
1139' + cc.strings.preferenceUseGlobal + '</option>'); 1140 } 1141 jQuery('#cc-change-button-allsites').unbind('click').click(function () { 1142 cc.frommodal = true; 1143 cc.gotosettings(); 1144 return false; 1145 }); 1146 jQuery('#cc-preference-selector-' + key).change(function () { 1147 1148 }); 1149 if (key == "necessary") { 1150 jQuery('#cc-preference-selector-' + key).remove(); 1151 } 1152 if (cc.approved[key] == "yes") { 1153 jQuery('#cc-preference-selector-' + key).val("yes") 1154 } 1155 else if (cc.approved[key] == "no") { 1156 jQuery('#cc-preference-selector-' + key).val("no") 1157 } 1158 else { 1159 jQuery('#cc-preference-selector-' + key).val("global") 1160 } 1161 1162 }); 1163 } else { 1164 jQuery('#cc-modal-wrapper .cc-content').append('<p>' + cc.strings.notUsingCookies + '</p>'); 1165 } 1166 jQuery('.cc-content').append('<div class="cc-clear"></div>'); 1167 }, 1168 1169 reloadsettingsmodal: function () { 1170 jQuery('#cc-settingsmodal-wrapper .cc-content').html(''); 1171 if (cc.getsize(cc.defaultCookies) > 0) { 1172 jQuery('#cc-settingsmodal-wrapper .cc-content').append('<ul></ul>'); 1173 jQuery.each(cc.defaultCookies, function (key, value) { 1174 1175 jQuery('#cc-settingsmodal-wrapper ul').append('<li id="cc-globalpreference-element-' + key + '"><label for="cc-globalpreference-selector-' + key + '"><strong>' + value.title + '</strong><span>' + value.description + '</span></label><select id="cc-globalpreference-selector-' + key + '"><option value="ask">' + cc.strings.preferenceAsk + '</option><option value="always">' + cc.strings.preferenceAlways + '</option><option value="never">' + cc.strings.preferenceNever + '</option></select></li>'); 1176 if (value.link) { 1177 jQuery('#cc-globalpreference-element-' + key + ' label span').append(' <a target="_blank" href="' + value.link + '" class="cc-learnmore-link">' + cc.strings.learnMore + '</a>'); 1178 } 1179 jQuery('#cc-globalpreference-selector-' + key).change(function () { 1180 1181 }); 1182 if (cc.remoteCookies[key] == "always") { 1183 jQuery('#cc-globalpreference-selector-' + key).val("always") 1184 } 1185 else if (cc.remoteCookies[key] == "never") { 1186 jQuery('#cc-globalpreference-selector-' + key).val("never") 1187 } 1188 else { 1189 jQuery('#cc-globalpreference-selector-' + key).val("ask") 1190 } 1191 1192 }); 1193 } else { 1194 jQuery('#cc-settingsmodal-wrapper .cc-content').append('<p>' + cc.strings.notUsingCookies + '</p>'); 1195 } 1196 jQuery('#cc-settingsmodal-wrapper .cc-content').append('<div class="cc-clear"></div>'); 1197 }, 1198 1199 approvedeny: function () { 1200 key = jQuery(this).attr("id").split("-")[2]; 1201 if (cc.cookies[key].approved) { 1202 cc.cookies[key].approved = false; 1203 cc.approved[key] = "no"; 1204 } else { 1205 cc.cookies[key].approved = true; 1206 cc.approved[key] = "yes"; 1207 } 1208 cc.setcookie('cc_' + key, cc.approved[key], 365); 1209 cc.checkapproval(); 1210 cc.reloadmodal(); 1211 return false; 1212 }, 1213 1214 clearalllocalcookies: function () { 1215 var cookies = document.cookie.split(";"); 1216 1217 for (var i = 0; i < cookies.length; i++) { 1218 var cookie = cookies[i]; 1219 var eqPos = cookie.indexOf("="); 1220 var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie; 1221 document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax"; 1222 } 1223 }, 1224 1225 clearlocal: function () { 1226 cc.clearalllocalcookies(); 1227 jQuery(this).before('<p>' + cc.strings.clearedCookies + '</p>') 1228 }, 1229 1230 getcurrenturl: function () { 1231 return window.location.protocol + "//" + window.location.host + window.location.pathname; 1232 }, 1233 1234 gotosettings: function () { 1235 if (jQuery('#cc-modal').is(":visible")) { 1236 cc.showhidemodal(); 1237 } 1238 jQuery(this).blur(); 1239 if (cc.ismobile) { 1240 cc.setupformobile(); 1241 jQuery('#cc-notification, #cc-wrapper').remove(); 1242 } 1243 if (cc.frommodal) { 1244 buttontext = cc.strings.backToSiteSettings; 1245 } else { 1246 buttontext = cc.strings.closeWindow; 1247 } 1248 1249 data = '<div id="cc-settingsmodal">' + 1250 '<div id="cc-settingsmodal-wrapper">' + 1251 '<h2>' + cc.strings.allSitesSettingsDialogTitleA + ' <span>' + cc.strings.allSitesSettingsDialogTitleB + '</span></h2>' + 1252 '<p class="cc-subtitle">' + cc.strings.allSitesSettingsDialogSubtitle + '</p>' + 1253 '<div class="cc-content">' + 1254 '</div>' + 1255 '<div class="cc-clear"></div>' + 1256 '<p id="cc-settingsmodal-closebutton" class="cc-settingsmodal-closebutton"><a class="cc-link" href="#" title="' + buttontext + '"><span>' + buttontext + '</span></a></p>' + 1257 '<div id="cc-settingsmodal-footer-buttons">' + 1258 '<p id="cc-settingsmodal-secondclosebutton" class="cc-settingsmodal-closebutton"><a class="cc-link" href="#" title="' + buttontext + '"><span>' + buttontext + '</span></a></p>' + 1259 '</div>' + 1260 '<a id="cc-notification-logo" class="cc-logo" target="_blank" rel="noreferrer" href="http://silktide.com/cookieconsent" title="' + cc.strings.poweredBy + '"><span>' + cc.strings.poweredBy + '</span></a> ' + 1261 '</div>' + 1262 '</div>'; 1263 jQuery('body').prepend(data); 1264 cc.reloadsettingsmodal(); 1265 jQuery('#cc-settingsmodal').addClass(cc.settings.style).click(cc.closemodals); 1266 jQuery('#cc-settingsmodal-wrapper').click(function () { 1267 cc.noclosewin = true; 1268 }); 1269 if (cc.ismobile) { 1270 jQuery('#cc-settingsmodal').addClass("cc-mobile"); 1271 } 1272 jQuery('#cc-settingsmodal').fadeIn(); 1273 jQuery('.cc-settingsmodal-closebutton').click(cc.closepreferencesmodal); 1274 1275 return false; 1276 }, 1277 1278 setupformobile: function () { 1279 if (!cc.hassetupmobile) { 1280 cc.hassetupmobile = true; 1281 jQuery('head').append('<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">'); 1282 if (cc.settings.style == 'cc-light') { 1283 bgcol = '#e1e1e1'; 1284 } else { 1285 bgcol = '#1d1d1d' 1286 }
1287 jQuery('body').html('').css("margin", 0).css('width', 'auto').css("backgroundColor", bgcol).css("backgroundImage", 'none'); 1288 } 1289 }, 1290 1291 onfirstload: function () { 1292 if (!cc.setupcomplete && cc.initobj) { 1293 if (!(window.jQuery)) { 1294 cc.jqueryattempts++; 1295 if (cc.jqueryattempts >= 5) { 1296 return; 1297 } 1298 setTimeout(cc.onfirstload, 200); 1299 return; 1300 } 1301 cc.setupcomplete = true; 1302 cc.setup(); 1303 } 1304 setTimeout(cc.afterload, 50); 1305 cc.checkapproval(); 1306 }, 1307 1308 afterload: function () { 1309 jQuery('.cc-button-enableall').addClass('cc-link').click(cc.onlocalconsentgiven); 1310 jQuery('.cc-button-enable-all').addClass('cc-link').click(cc.onlocalconsentgiven); 1311 jQuery.each(cc.cookies, function (key, value) { 1312 jQuery('.cc-button-enable-' + key).addClass('cc-link').click(cc.onlocalconsentgiven); 1313 }); 1314 } 1315} 1316 1317if (!(window.jQuery)) { 1318 var s = document.createElement('script'); 1319 s.setAttribute('src', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js'); //1.7.2 1320 s.setAttribute('type', 'text/javascript'); 1321 document.getElementsByTagName('head')[0].appendChild(s); 1322 if (window.onload != null) { 1323 var oldOnload = window.onload; 1324 window.onload = function (e) { 1325 oldOnload(e); 1326 cc.onfirstload(); 1327 }; 1328 } 1329 else { 1330 window.onload = cc.onfirstload; 1331 } 1332} else { 1333 jQuery(document).ready(cc.onfirstload); 1334} 1335 1336/** 1337 * jQuery.browser.mobile (http://detectmobilebrowser.com/) 1338 * 1339 * jQuery.browser.mobile will be true if the browser is a mobile device - modified so that cc.ismobile is true 1340 * 1341 **/ 1342(function (a) { 1343 cc.ismobile = /android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)); 1344 cc.ismobile=false; 1345})(navigator.userAgent || navigator.vendor || window.opera); 1346 1347 1348/** 1349 * Load web font 1350 * 1351 1352 1353WebFontConfig = { 1354 google: { families: [ 'Open+Sans:400,600:latin' ] } 1355}; 1356(function () { 1357 var wf = document.createElement('script'); 1358 wf.src = ('https:' == document.location.protocol ? 'https' : 'https') + 1359 '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; 1360 wf.type = 'text/javascript'; 1361 wf.async = 'true'; 1362 var s = document.getElementsByTagName('script')[0]; 1363 s.parentNode.insertBefore(wf, s); 1364})(); 1365**/
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.