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 frommodal: false, 28 hassetupmobile: false, 29 noclosewin: false, 30 closingmodal: false, 31 jqueryattempts: 0, 32 reloadkey: false, 33 forcereload: false, 34 allagree: true, 35 refreshOnConsent: true, 36 hideallsitesbutton: false, 37 cookies: {}, 38 uniqelemid: 0, 39 executionblock: 0, 40 defaultCookies: { social: {}, analytics: {}}, 41 cookieAnalytics: ['_ga', '_gat' ,'__utmt' ,'__utma' ,'__utmb' ,'__utmc' ,'__utmz'], 42 approved: {}, 43 onlyshowbanneronce: false, 44 scriptdelay: 800, 45 bindfunctions: {}, 46 eumemberstates: [ 47 "BE",//"Belgium" 48 "BG",//"Bulgaria" 49 "CZ",//"Czech Republic" 50 "DK",//"Denmark" 51 "DE",//"Germany" 52 "EE",//"Estonia" 53 "IE",//"Ireland" 54 "EL",//"Grecia" 55 "GR",//"Greece" 56 "ES",//"Spain" 57 "FR",//"France" 58 "IT",//"Italy" 59 "CY",//"Cyprus" 60 "LV",//"Latvia" 61 "LT",//"Lithuania" 62 "LU",//"Luxembourg" 63 "HU",//"Hungary" 64 "MT",//"Malta" 65 "NL",//"Netherlands" (Paesi Bassi-Olanda) 66 "AT",//"Austria" 67 "PL",//"Poland" 68 "PT",//"Portugal" 69 "RO",//"Romania" 70 "SI",//"Slovenia" 71 "SK",//"Slovakia" 72 "FI",//"Finland" 73 "SE",//"Sweden" 74 "UK",// "Regno Unito" 75 "GB",// "United Kingdom" 76 "EU" //"Europe" 77 ], 78 noteumemberstates: [ 79 "A1",//"Anonymous Proxy" 80 "A2",//"Satellite Provider" 81 "O1",//"Other Country" 82 "AD",//"Andorra" 83 "AE",//"United Arab Emirates" 84 "AF",//"Afghanistan" 85 "AG",//"Antigua and Barbuda" 86 "AI",//"Anguilla" 87 "AL",//"Albania" 88 "AN",// antille olandesi 89 "AM",//"Armenia" 90 "AO",//"Angola" 91 "AP",//"Asia/Pacific Region" 92 "AQ",//"Antarctica" 93 "AR",//"Argentina" 94 "AS",//"American Samoa" 95 "AU",//"Australia" 96 "AW",//"Aruba" 97 "AX",//"Aland Islands" 98 "AZ",//"Azerbaijan" 99 "BA",//"Bosnia and Herzegovina" 100 "BB",//"Barbados" 101 "BD",//"Bangladesh" 102 "BF",//"Burkina Faso" 103 "BH",//"Bahrain" 104 "BI",//"Burundi" 105 "BJ",//"Benin" 106 "BL",//"Saint Bartelemey" 107 "BM",//"Bermuda" 108 "BN",//"Brunei Darussalam" 109 "BO",//"Bolivia" 110 "BQ",//"Bonaire, Saint Eustatius and Saba" 111 "BR",//"Brazil" 112 "BS",//"Bahamas" 113 "BT",//"Bhutan" 114 "BV",//"Bouvet Island" 115 "BW",//"Botswana" 116 "BY",//"Belarus" 117 "BZ",//"Belize" 118 "CA",//"Canada" 119 "CC",//"Cocos (Keeling) Islands" 120 "CD",//"Congo, The Democratic Republic of the" 121 "CF",//"Central African Republic" 122 "CG",//"Congo" 123 "CH",//"Switzerland" 124 "CI",//"Cote d'Ivoire" 125 "CK",//"Cook Islands" 126 "CL",//"Chile" 127 "CM",//"Cameroon" 128 "CN",//"China" 129 "CO",//"Colombia" 130 "CR",//"Costa Rica" 131 "CS",//"Serbia e Montenegro" 132 "CU",//"Cuba" 133 "CV",//"Cape Verde" 134 "CW",//"Curacao" 135 "CX",//"Christmas Island" 136 "DJ",//"Djibouti" 137 "DM",//"Dominica" 138 "DO",//"Dominican Republic" 139 "DZ",//"Algeria" 140 "EC",//"Ecuador" 141 "EG",//"Egypt" 142 "EH",//"Western Sahara" 143 "ER",//"Eritrea" 144 "ET",//"Ethiopia" 145 "FJ",//"Fiji" 146 "FK",//"Falkland Islands (Malvinas)" 147 "FM",//"Micronesia, Federated States of" 148 "FO",//"Faroe Islands" 149 "GA",//"Gabon" 150 "GD",//"Grenada" 151 "GE",//"Georgia" 152 "GF",//"French Guiana" 153 "GG",//"Guernsey" 154 "GH",//"Ghana" 155 "GI",//"Gibraltar" 156 "GL",//"Greenland" 157 "GM",//"Gambia" 158 "GN",//"Guinea" 159 "GP",//"Guadeloupe" 160 "GQ",//"Equatorial Guinea" 161 "GS",//"South Georgia and the South Sandwich Islands" 162 "GT",//"Guatemala" 163 "GU",//"Guam" 164 "GW",//"Guinea-Bissau" 165 "GY",//"Guyana" 166 "HK",//"Hong Kong" 167 "HM",//"Heard Island and McDonald Islands" 168 "HN",//"Honduras" 169 "HR",//"Croatia" 170 "HT",//"Haiti" 171 "ID",//"Indonesia" 172 "IL",//"Israel" 173 "IM",//"Isle of Man" 174 "IN",//"India" 175 "IO",//"British Indian Ocean Territory" 176 "IQ",//"Iraq"
177 "IR",//"Iran, Islamic Republic of" 178 "IS",//"Iceland" 179 "JE",//"Jersey" 180 "JM",//"Jamaica" 181 "JO",//"Jordan" 182 "JP",//"Japan" 183 "KE",//"Kenya" 184 "KG",//"Kyrgyzstan" 185 "KH",//"Cambodia" 186 "KI",//"Kiribati" 187 "KM",//"Comoros" 188 "KN",//"Saint Kitts and Nevis" 189 "KP",//"Korea, Democratic People's Republic of" 190 "KR",//"Korea, Republic of" 191 "KW",//"Kuwait" 192 "KY",//"Cayman Islands" 193 "KZ",//"Kazakhstan" 194 "LA",//"Lao People's Democratic Republic" 195 "LB",//"Lebanon" 196 "LC",//"Saint Lucia" 197 "LI",//"Liechtenstein" 198 "LK",//"Sri Lanka" 199 "LR",//"Liberia" 200 "LS",//"Lesotho" 201 "LY",//"Libyan Arab Jamahiriya" 202 "MA",//"Morocco" 203 "MC",//"Monaco" 204 "MD",//"Moldova, Republic of" 205 "ME",//"Montenegro" 206 "MF",//"Saint Martin" 207 "MG",//"Madagascar" 208 "MH",//"Marshall Islands" 209 "MK",//"Macedonia" 210 "ML",//"Mali" 211 "MM",//"Myanmar" 212 "MN",//"Mongolia" 213 "MO",//"Macao" 214 "MP",//"Northern Mariana Islands" 215 "MQ",//"Martinique" 216 "MR",//"Mauritania" 217 "MS",//"Montserrat" 218 "MU",//"Mauritius" 219 "MV",//"Maldives" 220 "MW",//"Malawi" 221 "MX",//"Mexico" 222 "MY",//"Malaysia" 223 "MZ",//"Mozambique" 224 "NA",//"Namibia" 225 "NC",//"New Caledonia" 226 "NE",//"Niger" 227 "NF",//"Norfolk Island" 228 "NG",//"Nigeria" 229 "NI",//"Nicaragua" 230 "NO",//"Norway" 231 "NP",//"Nepal" 232 "NR",//"Nauru" 233 "NU",//"Niue" 234 "NZ",//"New Zealand" 235 "OM",//"Oman" 236 "PA",//"Panama" 237 "PE",//"Peru" 238 "PF",//"French Polynesia" 239 "PG",//"Papua New Guinea" 240 "PH",//"Philippines" 241 "PK",//"Pakistan" 242 "PM",//"Saint Pierre and Miquelon" 243 "PN",//"Pitcairn" 244 "PR",//"Puerto Rico" 245 "PS",//"Palestinian Territory" 246 "PW",//"Palau" 247 "PY",//"Paraguay" 248 "QA",//"Qatar" 249 "RE",//"Reunion" 250 "RS",//"Serbia" 251 "RU",//"Russian Federation" 252 "RW",//"Rwanda" 253 "SA",//"Saudi Arabia" 254 "SB",//"Solomon Islands" 255 "SC",//"Seychelles" 256 "SD",//"Sudan" 257 "SG",//"Singapore" 258 "SH",//"Saint Helena" 259 "SJ",//"Svalbard and Jan Mayen" 260 "SL",//"Sierra Leone" 261 "SM",//"San Marino" 262 "SN",//"Senegal" 263 "SO",//"Somalia" 264 "SR",//"Suriname" 265 "SS",//"South Sudan" 266 "ST",//"Sao Tome and Principe" 267 "SV",//"El Salvador" 268 "SX",//"Sint Maarten" 269 "SY",//"Syrian Arab Republic" 270 "SZ",//"Swaziland" 271 "TC",//"Turks and Caicos Islands" 272 "TD",//"Chad" 273 "TF",//"French Southern Territories" 274 "TG",//"Togo" 275 "TH",//"Thailand" 276 "TJ",//"Tajikistan" 277 "TK",//"Tokelau" 278 "TL",//"Timor-Leste" 279 "TM",//"Turkmenistan" 280 "TN",//"Tunisia" 281 "TO",//"Tonga" 282 "TR",//"Turkey" 283 "TT",//"Trinidad and Tobago" 284 "TV",//"Tuvalu" 285 "TW",//"Taiwan" 286 "TZ",//"Tanzania, United Republic of" 287 "UA",//"Ukraine" 288 "UG",//"Uganda" 289 "UM",//"United States Minor Outlying Islands" 290 "US",//"United States" 291 "UY",//"Uruguay" 292 "UZ",//"Uzbekistan" 293 "VA",//"Città del Vaticano" 294 "VC",//"Saint Vincent e Grenadine" 295 "VE",//"Venezuela" 296 "VI",//"Isole Vergini Americane" 297 "VG",//"Isole Vergini Britanniche" 298 "VN",//"Vietnam" 299 "VU",//"Vanuatu" 300 "WF",//"Wallis e Futuna" 301 "WS",//"Samoa" 302 "YE",//"Yemen" 303 "YT",//"Mayotte" 304 "ZA",//"Sud Africa" 305 "ZM",//"Zambia" 306 "ZW"//"Zimbabwe" 307 ], 308 309 settings: { 310 311 style: "light", 312 bannerPosition: "bottom", 313 tagPosition: 'bottom-right', 314 hideprivacysettingstab: 1, 315 hidepopupprivatesettings: 1, 316 onlyshowwithineu: 1, 317 httpserviceapilocation:'http://api.wipmania.com/jsonp?', 318 consenttype: 'explicit', 319 confirmClick:1, 320 confirmScroll:1, 321 idPageInformation:47, 322 cookieExpire:365 323 324 }, 325 326 strings: { 327 jqueryWarning: "Developer: Caution! You need to use jQuery 1.4.4 or higher.", 328 invalidKeyWarning: "Developer: Warning! You must provide a valid API.", 329 socialDefaultTitle: "Social media", 330 analyticsDefaultTitle: "Analytics", 331 socialDefaultDescription: "Facebook, Twitter and other social websites need to know who you are to work properly.", 332 analyticsDefaultDescription: "We anonymously measure your use of this website to improve your experience.", 333 notificationTitle: "Your experience on this site will be improved by allowing cookies", 334 seeDetails: "see details", 335 seeDetailsImplicit: "change your settings", 336 hideDetails: "hide details", 337 savePreference: 'Save preference', 338 allowCookies: 'Allow cookies', 339 allowCookiesImplicit: 'Close', 340 privacySettings: "Privacy settings", 341 privacySettingsDialogTitleA: "Privacy settings", 342 privacySettingsDialogSubtitle: "Some features of this website need your consent to remember who you are.", 343 closeWindow: "Close window", 344 preferenceConsent: "I consent", 345 preferenceDecline: "I decline", 346 notificationTitleImplicit: "We use cookies to ensure you get the best experience on our website", 347 informationCookies:"Information on Cookies", 348 textOff: "player off press cookies" 349 }, 350 351 geturlparameter: function (name) { 352 name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
353 var regexS = "[\\?&]" + name + "=([^&#]*)"; 354 var regex = new RegExp(regexS); 355 var results = regex.exec(window.location.search); 356 if (results == null) 357 return false; 358 else 359 return decodeURIComponent(results[1].replace(/\+/g, " ")); 360 }, 361 362 isfunction: function (functionToCheck) { 363 var getType = {}; 364 return functionToCheck && getType.toString.call(functionToCheck) == '[object Function]'; 365 }, 366 367 setup: function () { 368 jQuery.each(cc.bindfunctions, function (key, value) { 369 for (i = 0; i < value.length; i++) { 370 jQuery(document).bind("cc_" + key, value[i]); 371 } 372 }); 373 verstr = jQuery().jquery; 374 parts = verstr.split('.'); 375 versionRequired = cc.jqueryversionrequired.split('.'); 376 jqueryOk = true; 377 for (i = 0; i < parts.length && i < versionRequired.length; i++) { 378 currentpart = parseInt(parts[i]); 379 requiredpart = parseInt(versionRequired[i]); 380 if (currentpart < requiredpart) { 381 /* Unsatisfied - this part of the version string is less than the version we require */ 382 jqueryok = false; 383 break; 384 } 385 if (currentpart > requiredpart) { 386 /* Satisfied - this part of the version string is greater than the version we require */ 387 break; 388 } 389 /* This version is the same as the one we require. Check the next part of the version number. */ 390 } 391 if (!jqueryOk) { 392 alert(cc.strings.jqueryWarning); 393 } 394 395 jQuery.each(cc.defaultCookies, function (key, value) { 396 if (key == "social") { 397 cc.defaultCookies[key].title = cc.strings.socialDefaultTitle; 398 cc.defaultCookies[key].description = cc.strings.socialDefaultDescription; 399 } 400 else if (key == "analytics") { 401 cc.defaultCookies[key].title = cc.strings.analyticsDefaultTitle; 402 cc.defaultCookies[key].description = cc.strings.analyticsDefaultDescription; 403 } 404 405 }); 406 jQuery.each(cc.initobj.cookies, function (key, value) { 407 408 if (!value.title) { 409 if (key == "social") { 410 cc.initobj.cookies[key].title = cc.strings.socialDefaultTitle; 411 } 412 else if (key == "analytics") { 413 cc.initobj.cookies[key].title = cc.strings.analyticsDefaultTitle; 414 } 415 else { 416 cc.initobj.cookies[key].title = cc.strings.defaultTitle; 417 } 418 } 419 if (!value.description) { 420 if (key == "social") { 421 cc.initobj.cookies[key].description = cc.strings.socialDefaultDescription; 422 } 423 else if (key == "analytics") { 424 cc.initobj.cookies[key].description = cc.strings.analyticsDefaultDescription; 425 } 426 else { 427 cc.initobj.cookies[key].description = cc.strings.defaultDescription; 428 } 429 } 430 431 if (!value.defaultstate) { 432 cc.initobj.cookies[key].defaultstate = "on"; 433 } 434 435 cc.initobj.cookies[key].asked = false; 436 cc.initobj.cookies[key].approved = false; 437 cc.initobj.cookies[key].executed = false; 438 cc.executeoff(key); 439 }); 440 441 testmode = cc.geturlparameter('cctestmode'); 442 if (testmode == 'accept' || testmode == 'decline') { 443 cc.settings.testmode = testmode; 444 } 445 /* if (cc.settings.disableallsites) { 446 cc.hideallsitesbutton = true; 447 }*/ 448 for (var attrname in cc.initobj.cookies) { 449 cc.cookies[attrname] = cc.initobj.cookies[attrname]; 450 if (cc.settings.testmode == "accept") { 451 cc.approved[attrname] = "yes"; 452 } 453 if (cc.settings.testmode == "decline") { 454 cc.approved[attrname] = "no"; 455 } 456 } 457 458 }, 459 460 initialise: function (obj) { 461 462 /* controlla che l'oggetto abbia il suo vettore di lingua valorizzato 463 altrimenti utilizza quello di default 464 */ 465 var stringLanguage = cc.messageLanguage(); 466 if (stringLanguage != '' && stringLanguage != 'error') 467 obj.strings = stringLanguage; 468 cc.initobj = obj; 469 470 if (obj.settings !== undefined) { 471 for (var attrname in obj.settings) { 472 this.settings[attrname] = obj.settings[attrname]; 473 } 474 } 475 if (obj.strings !== undefined) { 476 for (var attrname in obj.strings) { 477 this.strings[attrname] = obj.strings[attrname]; 478 } 479 } 480 481 482 cc.settings.style = "cc-" + cc.settings.style; 483 cc.settings.bannerPosition = "cc-" + cc.settings.bannerPosition; 484 485 486 if (window.jQuery) { 487 cc.setupcomplete = true; 488 cc.setup(); 489 490 } 491 }, 492 insertscript: function (script) { 493 var newfile = document.createElement('script'); 494 newfile.setAttribute("type", "text/javascript"); 495 newfile.setAttribute("src", script); 496 document.getElementsByTagName("head")[0].appendChild(newfile); 497 }, 498 499 insertscripttag: function (content) { 500 var newfile = document.createElement('script'); 501 newfile.setAttribute("type", "text/javascript"); 502 newfile.innerHTML = content; 503 document.getElementsByTagName("head")[0].appendChild(newfile); 504 }, 505 506 checklocal: function () { 507 this.checkedlocal = true; 508 jQuery.each(cc.cookies, function (key, value) { 509 cookieval = cc.getcookie('cc_' + key); 510 if (cookieval) { 511 cc.approved[key] = cookieval; 512 } 513 }); 514 this.checkapproval(); 515 }, 516 517
518 deletecookie: function (key) { 519 date = new Date(); 520 date.setDate(date.getDate() - 1); 521 document.cookie = escape("cc_" + key) + '=; path=/; expires=' + date; 522 523 }, 524 525 removecookieAnalytics: function (key, sPath, sDomain) { 526 for (var i = 0; i < cc.cookieAnalytics.length; i++){ 527 if (key == cc.cookieAnalytics[i]){ 528 document.cookie = key + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : ""); 529 530 } 531 } 532 }, 533 534 535 reloadifnecessary: function () { 536 if (cc.refreshOnConsent || cc.ismobile || cc.forcereload) { 537 setTimeout("location.reload(true);", 0); 538 } 539 }, 540 541 onkeyup: function (e) { 542 if (e.keyCode == 27) { 543 cc.closemodals(); 544 } 545 }, 546 547 closemodals: function () { 548 if (!cc.closingmodal) { 549 if (cc.noclosewin) { 550 cc.noclosewin = false; 551 } else { 552 if (jQuery('#cc-modal').is(":visible")) { 553 jQuery('#cc-modal .cc-modal-closebutton a').click(); 554 } 555 556 if (jQuery('#cc-settingsmodal').is(":visible")) { 557 jQuery('#cc-settingsmodal #cc-settingsmodal-closebutton a').click(); 558 } 559 560 } 561 } 562 }, 563 564 showbanner: function () { 565 566 jQuery('#cc-tag').fadeOut(null, function () { 567 jQuery(this).remove(); 568 }); 569 jQuery('#cc-notification').remove(); 570 if (cc.ismobile) { 571 cc.setupformobile(); 572 jQuery('head').append('<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">'); 573 574 } 575 data = '<div id="cc-notification">' + 576 '<div id="cc-notification-wrapper">' + 577 '<h2><span>' + cc.strings.notificationTitle + '</span></h2>' + 578 '<div id="cc-notification-permissions">' + 579 '</div>' + 580 '<ul class="cc-notification-buttons">' + 581 '<li>' + 582 '<a class="cc-link" href="#" id="cc-approve-button-thissite">' + cc.strings.allowCookies + '</a>' + 583 '</li>' + 584 '</ul>' + 585 '<div class="cc-clear"></div>' + 586 '</div>' + 587 '</div>'; 588 589 jQuery('body').prepend(data); 590 if (cc.hideallsitesbutton) { 591 jQuery('#cc-approve-button-allsites').hide(); 592 } 593 if (cc.settings.consenttype == 'implicit') { 594 jQuery('#cc-notification h2 span').html(cc.strings.notificationTitleImplicit) 595 jQuery('#cc-approve-button-thissite').html(cc.strings.allowCookiesImplicit); 596 jQuery('#cc-approve-button-thissite').parent().after(jQuery('#cc-approve-button-allsites').parent()); 597 jQuery('#cc-approve-button-allsites').hide(); 598 } 599 jQuery('#cc-notification-logo').hide(); 600 jQuery('#cc-notification').addClass(cc.settings.style).addClass(cc.settings.bannerPosition); 601 bannerh = jQuery('#cc-notification').height(); 602 jQuery('#cc-notification').hide(); 603 if (cc.ismobile) { 604 jQuery('#cc-notification').addClass("cc-mobile"); 605 } 606 jQuery('#cc-notification-permissions').prepend('<ul></ul>'); 607 allcustom = true; 608 jQuery.each(cc.cookies, function (key, value) { 609 if (!value.asked) { 610 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>'); 611 if (value.link) { 612 jQuery('#cc-label-' + key).append(' <a target="_blank" href="' + value.link + '" class="cc-learnmore-link">' + cc.strings.learnMore + '</a>'); 613 } 614 if (key == "social" || key == "analytics" ) { 615 allcustom = false; 616 } 617 jQuery('#cc-checkbox-' + key).change(function () { 618 if (jQuery(this).is(':checked')) { 619 jQuery(this).parent().removeClass('cc-notification-permissions-inactive'); 620 } else { 621 jQuery(this).parent().addClass('cc-notification-permissions-inactive'); 622 623 } 624 }); 625 if (value.defaultstate == "off") { 626 jQuery('#cc-checkbox-' + key).removeAttr("checked").parent().addClass('cc-notification-permissions-inactive'); 627 } 628 if (key == "necessary") { 629 jQuery('#cc-checkbox-' + key).attr("disabled", "disabled"); 630 } 631 } 632 }); 633 jQuery('#cc-notification-wrapper h2').append(' - <a href="/index.php?id=' + cc.settings.idPageInformation + '">' +cc.strings.informationCookies+'</a>'); 634 jQuery('#cc-notification-wrapper h2').append(' - <a class="cc-link" href="#" id="cc-notification-moreinfo">' + cc.strings.seeDetails + '</a>'); 635 636 if (cc.settings.consenttype == "implicit") { 637 jQuery('#cc-notification-moreinfo').html(cc.strings.seeDetailsImplicit); 638 } 639 640 jQuery('#cc-notification-moreinfo').click(function () { 641 if (jQuery(this).html() == cc.strings.seeDetails || jQuery(this).html() == cc.strings.seeDetailsImplicit) { 642 if (cc.settings.consenttype == 'implicit') { 643 if (!cc.hideallsitesbutton) { 644 jQuery('#cc-approve-button-allsites').show(); 645 } 646 } 647 jQuery('#cc-approve-button-thissite').html(cc.strings.savePreference); 648 jQuery(this).html(cc.strings.hideDetails); 649 } else { 650 jQuery.each(cc.cookies, function (key, value) { 651 if (value.defaultstate == "off") { 652 jQuery('#cc-checkbox-' + key).removeAttr("checked"); 653 jQuery(this).parent().addClass('cc-notification-permissions-inactive'); 654 } else { 655 jQuery('#cc-checkbox-' + key).attr('checked', 'checked'); 656 jQuery(this).parent().removeClass('cc-notification-permissions-inactive'); 657 658 } 659 }); 660 661 if (cc.settings.consenttype == 'implicit') { 662 jQuery(this).html(cc.strings.seeDetailsImplicit); 663 jQuery('#cc-approve-button-thissite').html(cc.strings.allowCookiesImplicit); 664 jQuery('#cc-approve-button-allsites').hide(); 665 } else { 666 jQuery(this).html(cc.strings.seeDetails); 667 jQuery('#cc-approve-button-thissite').html(cc.strings.allowCookies); 668 jQuery('#cc-approve-button-allsites').html(cc.strings.allowForAllSites); 669 } 670 671 } 672 jQuery('#cc-notification-logo').fadeToggle(); 673 jQuery('#cc-notification-permissions').slideToggle(); 674 jQuery(this).blur(); 675 return false;
676 }); 677 678 if (!cc.ismobile) { 679 if (cc.settings.bannerPosition == "cc-push") { 680 jQuery('html').animate({marginTop: bannerh}, 400); 681 } 682 jQuery('#cc-notification').slideDown(); 683 } else { 684 jQuery('#cc-notification').show(); 685 } 686 687 688 689 if (cc.settings.confirmClick == 1 && cc.settings.consenttype == 'implicit'){ 690 jQuery(window).addClass(cc.settings.style).click(cc.onlocalconsentgiven); 691 } 692 if (cc.settings.confirmScroll == 1 && cc.settings.consenttype == 'implicit'){ 693 jQuery(window).addClass(cc.settings.style).scroll(cc.onlocalconsentgiven); 694 } 695 jQuery('#cc-approve-button-thissite').click(cc.onlocalconsentgiven); 696 697 if (allcustom) { 698 jQuery('#cc-notification h2 span').html(cc.strings.customCookie); 699 700 } 701 702 }, 703 704 timestamp: function () { 705 return Math.round((new Date()).getTime() / 1000); 706 }, 707 708 locationcallback: function (data) { 709 status = cc.jsonserviceapi(data); 710 if (status != "error") { 711 ineu = "yes"; 712 if (jQuery.inArray(status, cc.eumemberstates) == -1) { 713 //Visitor is from outside EU 714 ineu = "no"; 715 jQuery.each(cc.cookies, function (key, value) { 716 cc.approved[key] = "yes"; 717 }); 718 cc.settings.hideprivacysettingstab = 1; 719 cc.settings.hidepopupprivatesettings = 1; 720 } 721 cc.setcookie('cc_ineu', ineu, cc.settings.cookieExpire); 722 }else{ 723 alert(cc.strings.invalidKeyWarning) 724 } 725 726 cc.checkapproval(); 727 }, 728 729 730 731 checkapproval: function () { 732 733 if (cc.settings.onlyshowwithineu != 1) { 734 ineu = cc.getcookie('cc_ineu'); 735 if (ineu) { 736 if (ineu == "no") { 737 jQuery.each(cc.cookies, function (key, value) { 738 cc.approved[key] = "yes"; 739 }); 740 cc.settings.hideprivacysettingstab = 1; 741 cc.settings.hidepopupprivatesettings = 1; 742 743 744 745 } 746 } else { 747 if (navigator.geolocation) { 748 navigator.geolocation.getCurrentPosition(cc.success); 749 } 750 } 751 } 752 cc.allasked = true; 753 jQuery.each(cc.cookies, function (key, value) { 754 if (cc.approved[key]) { 755 if (cc.approved[key] == "yes" ){ 756 cc.cookies[key].asked = true; 757 cc.cookies[key].approved = true; 758 cc.execute(key); 759 } else if ( cc.approved[key] == "no") { 760 cc.cookies[key].asked = true; 761 cc.cookies[key].approved = false; 762 cc.executeoff(key); 763 } else { 764 765 cc.allasked = false; 766 } 767 } else { 768 769 cc.allasked = false; 770 } 771 }); 772 if (!cc.allasked) { 773 if (!cc.checkedlocal) { 774 cc.checklocal(); 775 return; 776 } 777 if (cc.settings.consenttype == "implicit") { 778 jQuery.each(cc.cookies, function (key, value) { 779 if (!cc.cookies[key].asked) { 780 if (cc.onlyshowbanneronce) { 781 cc.setcookie('cc_' + key, 'yes', cc.settings.cookieExpire); 782 } 783 cc.execute(key); 784 } 785 }); 786 } 787 // visualizzare il banner iniziale 788 /*if (cc.settings.hideprivacysettingstab == 1){ 789 cc.showbanner(); 790 }*/ 791 if (cc.settings.hideprivacysettingstab == 1){ 792 if (cc.settings.hidepopupprivatesettings == 1){ 793 cc.showbanner(); 794 } 795 } 796 } else { 797 cc.showminiconsent(); 798 } 799 }, 800 801 success:function(position) { 802 if (position){ 803 jQuery.getScript(cc.settings.httpserviceapilocation+"callback=cc.locationcallback"); 804 return; 805 } 806 807 }, 808 809 810 execute: function (cookieType) { 811 if (cookieType == "necessary") { 812 return; 813 } 814 jQuery('.cc-placeholder-' + cookieType).remove(); 815 jQuery('script.cc-onconsent-' + cookieType + '[type="text/plain"]').each(function () { 816 817 var str = jQuery(this).text(); 818 var initframe = str.indexOf("<iframe"); 819 if (initframe > -1){ 820 var theframe = str.indexOf("</iframe>"); 821 var strframe = str.substring(initframe, theframe+9); 822 jQuery(this).next().hide() 823 jQuery(this).after(strframe) 824 }else{ 825 if (jQuery(this).attr('src')) { 826 jQuery(this).next().hide(); 827 jQuery(this).after('<script type="text/javascript" src="' + jQuery(this).attr('src') + '"></script>'); 828 } else { 829 jQuery(this).next().hide(); 830 jQuery(this).after('<script type="text/javascript">' + jQuery(this).html() + '</script>'); 831 832 } 833 } 834 835 }); 836 837 cc.cookies[cookieType].executed = true; 838 jQuery(document).trigger("cc_" + cookieType); 839 840 cc.executescriptinclusion(cookieType); 841 842 }, 843 844 845 executeoff: function (cookieType) { 846 if (cookieType == "necessary") { 847 return; 848 } 849 var i = 0; 850 851 jQuery('script.cc-onconsent-' + cookieType + '[type="text/plain"]').each(function () { 852 i++; 853 var str_id ="id_"+cookieType+"_"+i; 854 if ($('#'+str_id).length == 0){ 855 var vuoto = "<div class='image_off' id="+str_id+"><span class='text_off'><span class='bg_text'>"+cc.strings.textOff+"</span></span></div>" ; 856 jQuery(this).after(vuoto); 857 } 858 859 }); 860 861 }, 862 863 864 executescriptinclusion: function (cookieType) { 865 timetaken = jQuery('script.cc-onconsent-inline-' + cookieType + '[type="text/plain"]').length * cc.scriptdelay; 866 now = new Date().getTime(); 867 if (now < cc.executionblock) { 868 setTimeout(cc.executescriptinclusion, cc.executionblock - now, [cookieType]); 869 return; 870 } 871 cc.executionblock = now + timetaken; 872 873 cc.insertscripts(cookieType); 874 }, 875 876 insertscripts: function (cookieType) { 877 878 jQuery('script.cc-onconsent-inline-' + cookieType + '[type="text/plain"]').first().each(function () { 879 cc.uniqelemid++; 880 881 if (jQuery(this).parents('body').length > 0) { 882 jQuery(this).after('<div id="cc-consentarea-' + cc.uniqelemid + '" class="' + cookieType + '"></div>'); 883 document.write = function (g) { 884 jQuery('#cc-consentarea-' + cc.uniqelemid).append(g); 885 }; 886 document.writeln = function (g) { 887 jQuery('#cc-consentarea-' + cc.uniqelemid).append(g); 888 }; 889 } 890 891 if (jQuery(this).attr('src')) { 892 jQuery(this).after('<script type="text/javascript" src="' + jQuery(this).attr('src') + '"></script>'); 893 } else { 894 jQuery(this).after('<script type="text/javascript">' + jQuery(this).html() + '</script>'); 895 } 896 jQuery(this).remove(); 897 898 899 }); 900 901 if (jQuery('script.cc-onconsent-inline-' + cookieType + '[type="text/plain"]').length > 0) { 902 setTimeout(cc.insertscripts, cc.scriptdelay, [cookieType]); 903 } 904 905 }, 906 907 getcookie: function (c_name) { 908 var i, x, y, ARRcookies = document.cookie.split(";"); 909 for (i = 0; i < ARRcookies.length; i++) { 910 x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("=")); 911 y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1); 912 x = x.replace(/^\s+|\s+$/g, ""); 913 if (x == c_name) { 914 return unescape(y); 915 } 916 } 917 return false;
918 }, 919 920 setcookie: function (name, value, expirydays) { 921 var exdate = new Date(); 922 exdate.setTime(exdate.getTime()+(expirydays*24*60*60*1000)); 923 document.cookie = name + '=' + value + '; expires=' + exdate.toGMTString() + '; path=/' 924 }, 925 926 927 928 929 onremoteconsentgiven: function () { 930 cc.allagree = true; 931 jQuery.each(cc.cookies, function (key, value) { 932 if (!value.approved && !value.asked) { 933 if (jQuery('#cc-checkbox-' + key).is(':checked')) { 934 935 cc.approved[key] = "yes"; 936 937 cc.cookies[key].asked = true; 938 } else { 939 940 cc.approved[key] = "no"; 941 942 cc.allagree = false; 943 cc.cookies[key].asked = true; 944 945 } 946 cc.setcookie('cc_' + key, cc.approved[key], cc.settings.cookieExpire); 947 } else { 948 } 949 }); 950 951 952 if (!cc.ismobile) { 953 jQuery('#cc-notification').slideUp(); 954 if (cc.settings.bannerPosition == "cc-push") { 955 //detect body margin 956 jQuery('html').animate({marginTop: 0}, 400); 957 } 958 } 959 cc.checkapproval(); 960 961 return false; 962 }, 963 964 onlocalconsentgiven: function () { 965 enableall = false; 966 enablejustone = false; 967 if (jQuery(this).hasClass('cc-button-enableall') || jQuery(this).hasClass('cc-button-enable-all')) { 968 enableall = true; 969 jQuery.each(cc.cookies, function (key, value) { 970 cc.cookies[key].asked = false; 971 }); 972 } 973 elem = this; 974 jQuery.each(cc.cookies, function (key, value) { 975 if (jQuery(elem).hasClass('cc-button-enable-' + key)) { 976 enablejustone = true; 977 cc.approved[key] = "yes"; 978 cc.cookies[key].asked = true; 979 cc.setcookie('cc_' + key, cc.approved[key], cc.settings.cookieExpire); 980 } 981 }); 982 983 cc.allagree = true; 984 if (!enablejustone) { 985 jQuery.each(cc.cookies, function (key, value) { 986 if (!value.approved && !value.asked) { 987 if (enableall || jQuery('#cc-checkbox-' + key).is(':checked')) { 988 cc.approved[key] = "yes"; 989 cc.cookies[key].asked = true; 990 } else { 991 cc.approved[key] = "no"; 992 cc.cookies[key].asked = true; 993 cc.allagree = false; 994 } 995 cc.setcookie('cc_' + key, cc.approved[key], cc.settings.cookieExpire); 996 } else { 997 } 998 }); 999 } 1000 1001 if (!cc.allagree && cc.settings.consenttype == "implicit") { 1002 cc.forcereload = true; 1003 } 1004 1005 if (!cc.ismobile) {
1006 jQuery('#cc-notification').slideUp(); 1007 if (cc.settings.bannerPosition == "cc-push") { 1008 //detect body margin 1009 jQuery('html').animate({marginTop: 0}, 400); 1010 } 1011 } 1012 cc.checkapproval(); 1013 cc.reloadifnecessary(); 1014 1015 return false; 1016 }, 1017 1018 showminiconsent: function () { 1019 if (jQuery('#cc-tag').length == 0) { 1020 var 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>'; 1021 jQuery('body').prepend(data); 1022 jQuery('#cc-tag').addClass(cc.settings.style); 1023 if (cc.settings.hideprivacysettingstab == 1) { 1024 if (cc.settings.hidepopupprivatesettings == 1){ 1025 jQuery('#cc-tag').fadeIn(); 1026 } 1027 } else { 1028 jQuery('#cc-tag').hide(); 1029 } 1030 jQuery('.cc-privacy-link').click(cc.showmodal); 1031 jQuery('#cc-tag-button').click(cc.showmodal); 1032 1033 1034 1035 // disabilito tutti gli iframe id_social_ 1036 if (cc.approved['social'] == 'no'){ 1037 var iframe_id_social = jQuery("div[id^='id_social']") 1038 iframe_id_social.each(function(){ 1039 jQuery(this).children().click(cc.showmodal); 1040 }) 1041 } 1042 1043 // disabilito tutti gli iframe id_analytics_ 1044 if (cc.approved['analytics'] == 'no'){ 1045 var iframe_id_analytics = jQuery("div[id^='id_analytics']") 1046 iframe_id_analytics.each(function(){ 1047 jQuery(this).children().click(cc.showmodal); 1048 }) 1049 } 1050 } 1051 1052 }, 1053 getsize: function (obj) { 1054 var size = 0, key; 1055 for (key in obj) { 1056 if (obj.hasOwnProperty(key)) size++; 1057 } 1058 return size; 1059 }, 1060 1061 1062 1063 showmodal: function () { 1064 1065 jQuery(document).bind('keyup', cc.onkeyup); 1066 jQuery('body').prepend('<div id="cc-modal-overlay"></div>'); 1067 jQuery(this).blur(); 1068 if (cc.ismobile) { 1069 cc.setupformobile(); 1070 } 1071 data = '<div id="cc-modal">' + 1072 '<div id="cc-modal-wrapper">' + 1073 '<h2>' + cc.strings.privacySettingsDialogTitleA + '</h2>' + 1074 '<p class="cc-subtitle">' + cc.strings.privacySettingsDialogSubtitle + '</p>' + 1075 1076 '<div class="cc-content">' + 1077 '</div>' + 1078 1079 '<div class="cc-clear"></div>' + 1080 1081 '<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>' + 1082 '<div id="cc-modal-footer-buttons">' + 1083 '<div class="cc-clear"></div>' + 1084 '</div>' + 1085 '</div>'; 1086 jQuery('body').prepend(data); 1087 if (cc.settings.confirmClick == 1) 1088 jQuery('#cc-modal').addClass(cc.settings.style).click(cc.closemodals); 1089 if (cc.settings.confirmScroll == 1) 1090 jQuery(window).addClass(cc.settings.style).scroll(cc.closemodals); 1091 1092 if (cc.ismobile) { 1093 jQuery('#cc-modal').addClass("cc-mobile"); 1094 } 1095 cc.reloadmodal(); 1096 jQuery('#cc-modal').fadeIn(); 1097 jQuery('#cc-modal-overlay').fadeIn(); 1098 jQuery('#cc-modal-wrapper').click(function () { 1099 cc.noclosewin = true; 1100 }); 1101 jQuery('#cc-modal .cc-modal-closebutton a').click(function () { 1102 cc.showhidemodal(); 1103 cc.reloadifnecessary(); 1104 return false; 1105 }); 1106 1107 jQuery('#cc-modal-global').click(function () { 1108 cc.frommodal = true; 1109 cc.gotosettings(); 1110 return false; 1111 }); 1112 jQuery('#cc-tag-button').unbind('click').click(cc.showhidemodal); 1113 jQuery('.cc-privacy-link').unbind('click').click(cc.showhidemodal); 1114 1115 //parte aggiuntiva 1116 if (cc.approved['social'] == 'no'){ 1117 var iframe_id_social = jQuery("div[id^='id_social']") 1118 iframe_id_social.each(function(){ 1119 jQuery(this).children().unbind('click').click(cc.showmodal); 1120 }) 1121 }
1122 if (cc.approved['analytics'] == 'no'){ 1123 var iframe_id_analytics = jQuery("div[id^='id_analytics']") 1124 iframe_id_analytics.each(function(){ 1125 jQuery(this).children().unbind('click').click(cc.showmodal); 1126 }) 1127 } 1128 1129 return false; 1130 }, 1131 1132 closepreferencesmodal: function () { 1133 jQuery.each(cc.defaultCookies, function (key, value) { 1134 value = jQuery('#cc-globalpreference-selector-' + key).val(); 1135 if (cc.approved[key] != "yes" && cc.approved[key] != "no") { 1136 cc.approved[key] = value; 1137 cc.setcookie('cc_' + key, cc.approved[key], cc.settings.cookieExpire); 1138 } 1139 1140 }); 1141 1142 1143 jQuery('#cc-notification').hide().remove(); 1144 jQuery(this).blur(); 1145 jQuery('#cc-settingsmodal').fadeOut(null, function () { 1146 jQuery('#cc-settingsmodal').remove(); 1147 }); 1148 if (!cc.frommodal) { 1149 cc.checkapproval(); 1150 cc.reloadifnecessary(); 1151 } else { 1152 cc.frommodal = false; 1153 cc.showhidemodal(); 1154 } 1155 return false; 1156 }, 1157 1158 showhidemodal: function () { 1159 jQuery(this).blur(); 1160 cc.checkedlocal = false;
1161 if (jQuery('#cc-modal').is(":visible") && !cc.frommodal) { 1162 cc.closingmodal = true; 1163 jQuery('#cc-modal-overlay').fadeToggle(null, function () { 1164 cc.closingmodal = false; 1165 }); 1166 jQuery.each(cc.cookies, function (key, value) { 1167 thisval = jQuery('#cc-preference-selector-' + key).val(); 1168 1169 if (key == "necessary") { 1170 thisval = "yes"; 1171 } 1172 1173 if (thisval == "no") { 1174 var str_domain = window.location.hostname; 1175 var id = str_domain.indexOf("www"); 1176 if (id != -1) 1177 var s_domain = str_domain.substring(id+3); 1178 cc.cookies[key].approved = false; 1179 cc.approved[key] = "no"; 1180 cc.setcookie('cc_' + key, cc.approved[key], cc.settings.cookieExpire); 1181 var i, x, Arraycookie = document.cookie.split(";"); 1182 for (i = 0; i < Arraycookie.length; i++) { 1183 x = Arraycookie[i].substr(0, Arraycookie[i].indexOf("=")); 1184 x = x.replace(/^\s+|\s+$/g, ""); 1185 if (key == 'analytics'){ 1186 cc.removecookieAnalytics(x,'/',s_domain); 1187 } 1188 } 1189 1190 } else if (thisval == "yes") { 1191 cc.cookies[key].approved = true; 1192 cc.approved[key] = "yes"; 1193 cc.setcookie('cc_' + key, cc.approved[key], cc.settings.cookieExpire); 1194 1195 1196 } else { 1197 cc.cookies[key].approved = false; 1198 cc.deletecookie(key); 1199 delete cc.approved[key]; 1200 } 1201 cc.cookies[key].asked = false; 1202 1203 }); 1204 cc.checkapproval(); 1205 } else if (!jQuery('#cc-settingsmodal').is(":visible") && !jQuery('#cc-modal').is(":visible")) { 1206 cc.closingmodal = true; 1207 jQuery('#cc-modal-overlay').fadeToggle(null, function () { 1208 cc.closingmodal = false; 1209 }); 1210 } 1211 if (cc.ismobile) { 1212 jQuery('#cc-modal').toggle(); 1213 } else { 1214 jQuery('#cc-modal').fadeToggle(); 1215 } 1216 return false; 1217 }, 1218 1219 1220 reloadmodal: function () { 1221 jQuery('#cc-modal-wrapper .cc-content').html(''); 1222 if (cc.getsize(cc.cookies) > 0) { 1223 jQuery('#cc-modal-wrapper .cc-content').append('<ul></ul>'); 1224 jQuery.each(cc.cookies, function (key, value) { 1225 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>'); 1226 if (value.link) { 1227 jQuery('#cc-preference-element-' + key + ' label span').append(' <a target="_blank" href="' + value.link + '" class="cc-learnmore-link">' + cc.strings.learnMore + '</a>'); 1228 } 1229 jQuery('#cc-change-button-allsites').unbind('click').click(function () { 1230 cc.frommodal = true; 1231 cc.gotosettings(); 1232 return false; 1233 }); 1234 jQuery('#cc-preference-selector-' + key).change(function () { 1235 1236 }); 1237 if (key == "necessary") { 1238 jQuery('#cc-preference-selector-' + key).remove(); 1239 } 1240 if (cc.approved[key] == "yes") { 1241 jQuery('#cc-preference-selector-' + key).val("yes") 1242 } 1243 else if (cc.approved[key] == "no") { 1244 jQuery('#cc-preference-selector-' + key).val("no") 1245 } 1246 else { 1247 jQuery('#cc-preference-selector-' + key).val("global") 1248 } 1249 1250 }); 1251 } else { 1252 jQuery('#cc-modal-wrapper .cc-content').append('<p>' + cc.strings.notUsingCookies + '</p>'); 1253 } 1254 jQuery('.cc-content').append('<div class="cc-clear"></div>'); 1255 }, 1256 1257 gotosettings: function () { 1258 if (jQuery('#cc-modal').is(":visible")) { 1259 cc.showhidemodal(); 1260 } 1261 jQuery(this).blur(); 1262 if (cc.ismobile) { 1263 cc.setupformobile(); 1264 jQuery('#cc-notification').remove(); 1265 } 1266 if (cc.frommodal) { 1267 buttontext = cc.strings.backToSiteSettings; 1268 } else { 1269 buttontext = cc.strings.closeWindow; 1270 } 1271 1272 data = '<div id="cc-settingsmodal">' + 1273 '<div id="cc-settingsmodal-wrapper">' + 1274 '<div class="cc-content">' + 1275 '</div>' + 1276 '<div class="cc-clear"></div>' + 1277 '<p id="cc-settingsmodal-closebutton" class="cc-settingsmodal-closebutton"><a class="cc-link" href="#" title="' + buttontext + '"><span>' + buttontext + '</span></a></p>' + 1278 '<div id="cc-settingsmodal-footer-buttons">' + 1279 '<p id="cc-settingsmodal-secondclosebutton" class="cc-settingsmodal-closebutton"><a class="cc-link" href="#" title="' + buttontext + '"><span>' + buttontext + '</span></a></p>' + 1280 '</div>' + 1281 '</div>' + 1282 '</div>'; 1283 jQuery('body').prepend(data); 1284 if (cc.settings.confirmClick == 1) 1285 jQuery('#cc-settingsmodal').addClass(cc.settings.style).click(cc.closemodals); 1286 if (cc.settings.confirmScroll == 1) 1287 jQuery('#cc-settingsmodal').addClass(cc.settings.style).scroll(cc.closemodals); 1288 1289 jQuery('#cc-settingsmodal-wrapper').click(function () { 1290 cc.noclosewin = true; 1291 }); 1292 if (cc.ismobile) { 1293 jQuery('#cc-settingsmodal').addClass("cc-mobile"); 1294 } 1295 jQuery('#cc-settingsmodal').fadeIn(); 1296 jQuery('.cc-settingsmodal-closebutton').click(cc.closepreferencesmodal); 1297 1298 return false;
1299 }, 1300 1301 setupformobile: function () { 1302 if (!cc.hassetupmobile) { 1303 cc.hassetupmobile = true; 1304 jQuery('head').append('<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">'); 1305 if (cc.settings.style == 'cc-light') { 1306 bgcol = '#e1e1e1'; 1307 } else { 1308 bgcol = '#1d1d1d' 1309 } 1310 } 1311 }, 1312 1313 onfirstload: function () { 1314 if (!cc.setupcomplete && cc.initobj) { 1315 1316 if (!(window.jQuery)) { 1317 cc.jqueryattempts++; 1318 if (cc.jqueryattempts >= 5) { 1319 return; 1320 } 1321 setTimeout(cc.onfirstload, 200); 1322 return; 1323 } 1324 1325 cc.setupcomplete = true; 1326 cc.setup(); 1327 1328 } 1329 setTimeout(cc.afterload, 50); 1330 cc.checkapproval(); 1331 1332 }, 1333 1334 afterload: function () { 1335 jQuery('.cc-button-enableall').addClass('cc-link').click(cc.onlocalconsentgiven); 1336 jQuery('.cc-button-enable-all').addClass('cc-link').click(cc.onlocalconsentgiven); 1337 jQuery.each(cc.cookies, function (key, value) { 1338 jQuery('.cc-button-enable-' + key).addClass('cc-link').click(cc.onlocalconsentgiven); 1339 }); 1340 }, 1341 1342 1343 jsonserviceapi:function(data){ 1344 var searchstates = ''; 1345 var acronyms_countries = jQuery.map(data, function(value, index) { return[value]; }); 1346 for (var i = 0; i <= acronyms_countries.length; i++){ 1347 1348 if (acronyms_countries[i] instanceof Object){ 1349 var elem_acronyms_countries = jQuery.map(acronyms_countries[i], function(value, index) { return[value]; }); 1350 for (var j = 0; j <= elem_acronyms_countries.length; j++){ 1351 if (jQuery.inArray(elem_acronyms_countries[j], cc.eumemberstates) >=0){ 1352 searchstates = elem_acronyms_countries[j] 1353 break; 1354 }else if(jQuery.inArray(elem_acronyms_countries[j], cc.noteumemberstates) >= 0){ 1355 searchstates = elem_acronyms_countries[j] 1356 break; 1357 } 1358 } 1359 }else{ 1360 // controllo se il paese è della comunità europea 1361 if (jQuery.inArray(acronyms_countries[i], cc.eumemberstates) >=0){ 1362 searchstates = acronyms_countries[i] 1363 break; 1364 }else if(jQuery.inArray(acronyms_countries[i], cc.noteumemberstates) >= 0){ 1365 searchstates = acronyms_countries[i] 1366 break; 1367 } 1368 } 1369 } 1370 if (searchstates == '') searchstates = 'error' 1371 return searchstates; 1372 1373 }, 1374 1375 1376 messageLanguage :function () { 1377 var ajaxResponse = ''; 1378 var objectLanguage = ''; 1379 var lang = cc.localeLanguage(); 1380 var url = ''; 1381 if (lang != 0) { 1382 url = window.location.protocol+"//"+window.location.hostname + '/?type=10005&L=' + lang; 1383 console.log("URL: " + url); 1384 } 1385 else { 1386 url = window.location.protocol+"//"+window.location.hostname + '/?type=10005'; 1387 console.log("URL: " + url); 1388 } 1389 1390 jQuery.ajax({ 1391 async: false, 1392 type:'POST', 1393 //inserire indirizzo della root 1394 url: url, 1395 dataType : 'text', 1396 success : function (response) 1397 { 1398 ajaxResponse = response; 1399 }, 1400 error: function( req, status, err ) { 1401 console.log( 'something went wrong:', status, err ); 1402 ajaxResponse = 'error' 1403 } 1404 }); 1405 if (ajaxResponse != 'error'){ 1406 var indResponse = ajaxResponse.split('","') 1407 var strMessage = []; 1408 for (var i = 0; i < indResponse.length; i++){ 1409 strMessage[i] = indResponse[i].replace('["',''); 1410 if (i == 21){ 1411 idx = indResponse[i].indexOf('"]'); 1412 strMessage[i] = indResponse[i].substring(0, idx); 1413 } 1414 } 1415 1416 objectLanguage = {
1417 strings:{ 1418 jqueryWarning: strMessage[0], 1419 invalidKeyWarning: strMessage[1], 1420 socialDefaultTitle: strMessage[2], 1421 analyticsDefaultTitle: strMessage[3], 1422 socialDefaultDescription: strMessage[4], 1423 analyticsDefaultDescription: strMessage[5], 1424 notificationTitle: strMessage[6], 1425 seeDetails: strMessage[7], 1426 seeDetailsImplicit: strMessage[8], 1427 hideDetails: strMessage[9], 1428 savePreference: strMessage[10], 1429 allowCookies: strMessage[11], 1430 allowCookiesImplicit: strMessage[12], 1431 privacySettings: strMessage[13], 1432 privacySettingsDialogTitleA: strMessage[14], 1433 privacySettingsDialogSubtitle: strMessage[15], 1434 closeWindow: strMessage[16], 1435 preferenceConsent: strMessage[17], 1436 preferenceDecline: strMessage[18], 1437 notificationTitleImplicit: strMessage[19], 1438 informationCookies:strMessage[20], 1439 textOff:strMessage[21] 1440 } 1441 } 1442 return objectLanguage.strings; 1443 } 1444 else 1445 return ajaxResponse; 1446 }, 1447 1448 localeLanguage :function () { 1449 1450 var aip_cookie_language = jQuery('meta[name=aip_cookielaw_language]').attr('content'); 1451 if (aip_cookie_language !== undefined) 1452 return aip_cookie_language; 1453 else 1454 return 0; 1455 1456 } 1457 1458} 1459 1460if (!(window.jQuery)) { 1461 var s = document.createElement('script'); 1462 s.setAttribute('src', 'https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'); 1463 s.setAttribute('type', 'text/javascript'); 1464 document.getElementsByTagName('head')[0].appendChild(s); 1465 1466 if (window.onload != null) { 1467 var oldOnload = window.onload; 1468 window.onload = function (e) { 1469 oldOnload(e); 1470 cc.onfirstload(); 1471 }; 1472 } else { 1473 1474 window.onload = cc.onfirstload; 1475 } 1476 1477} else { 1478 jQuery(document).ready(cc.onfirstload); 1479} 1480 1481/** 1482 * jQuery.browser.mobile (http://detectmobilebrowser.com/) 1483 * 1484 * jQuery.browser.mobile will be true if the browser is a mobile device - modified so that cc.ismobile is true 1485 * 1486 **/ 1487(function (a) { 1488 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)) 1489})(navigator.userAgent || navigator.vendor || window.opera); 1490 1491 1492/** 1493 * Load web font 1494 * 1495 **/ 1496 1497/* 1498WebFontConfig = { 1499 google: { families: [ 'Open+Sans:400,600:latin' ] } 1500}; 1501(function () { 1502 var wf = document.createElement('script'); 1503 wf.src = ('https:' == document.location.protocol ? 'https' : 'http') + 1504 '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; 1505 wf.type = 'text/javascript'; 1506 wf.async = 'true'; 1507 var s = document.getElementsByTagName('script')[0]; 1508 s.parentNode.insertBefore(wf, s); 1509})(); 1510*/
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.