1CLI_ACCEPT_COOKIE_NAME =(typeof CLI_ACCEPT_COOKIE_NAME !== 'undefined' ? CLI_ACCEPT_COOKIE_NAME : 'viewed_cookie_policy'); 2CLI_PREFERNCE_COOKIE =(typeof CLI_PREFERNCE_COOKIE !== 'undefined' ? CLI_PREFERNCE_COOKIE : 'CookieLawInfoConsent'); 3CLI_ACCEPT_COOKIE_EXPIRE =(typeof CLI_ACCEPT_COOKIE_EXPIRE !== 'undefined' ? CLI_ACCEPT_COOKIE_EXPIRE : 365); 4CLI_COOKIEBAR_AS_POPUP=(typeof CLI_COOKIEBAR_AS_POPUP !== 'undefined' ? CLI_COOKIEBAR_AS_POPUP : false); 5var CLI_Cookie={ 6 set: function (name, value, days) { 7 var secure = ""; 8 if ( true === Boolean( Cli_Data.secure_cookies ) ) secure = ";secure"; 9 if (days) { 10 var date = new Date(); 11 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 12 var expires = "; expires=" + date.toGMTString(); 13 } else 14 var expires = ""; 15 document.cookie = name + "=" + value + secure + expires + "; path=/"; 16 if(days<1) 17 { 18 host_name=window.location.hostname; 19 document.cookie = name + "=" + value + expires + "; path=/; domain=."+host_name+";"; 20 if(host_name.indexOf("www")!=1) 21 { 22 var host_name_withoutwww=host_name.replace('www',''); 23 document.cookie = name + "=" + value + secure + expires + "; path=/; domain="+host_name_withoutwww+";"; 24 } 25 host_name=host_name.substring(host_name.lastIndexOf(".", host_name.lastIndexOf(".")-1)); 26 document.cookie = name + "=" + value + secure + expires + "; path=/; domain="+host_name+";"; 27 } 28 }, 29 read: function (name) { 30 var nameEQ = name + "="; 31 var ca = document.cookie.split(';'); 32 for (var i = 0; i < ca.length; i++) { 33 var c = ca[i]; 34 while (c.charAt(0) == ' ') { 35 c = c.substring(1, c.length); 36 } 37 if (c.indexOf(nameEQ) === 0) { 38 return c.substring(nameEQ.length, c.length); 39 } 40 } 41 return null; 42 }, 43 erase: function (name) { 44 this.set(name, "", -10); 45 }, 46 exists: function (name) { 47 return (this.read(name) !== null); 48 }, 49 getallcookies:function() 50 { 51 var pairs = document.cookie.split(";"); 52 var cookieslist = {}; 53 for (var i = 0; i < pairs.length; i++) { 54 var pair = pairs[i].split("="); 55 cookieslist[(pair[0] + '').trim()] = unescape(pair[1]); 56 } 57 return cookieslist; 58 } 59} 60var CLI= 61{ 62 bar_config:{}, 63 showagain_config:{}, 64 allowedCategories:[], 65 js_blocking_enabled: false, 66 set:function(args) 67 { 68 if(typeof JSON.parse !== "function") 69 { 70 console.log("CookieLawInfo requires JSON.parse but your browser doesn't support it"); 71 return; 72 } 73 if(typeof args.settings!=='object') 74 { 75 this.settings = JSON.parse(args.settings); 76 } 77 else 78 { 79 this.settings = args.settings; 80 } 81 this.js_blocking_enabled = Boolean( Cli_Data.js_blocking ); 82 this.settings = args.settings; 83 this.bar_elm = jQuery(this.settings.notify_div_id); 84 this.showagain_elm = jQuery(this.settings.showagain_div_id); 85 this.settingsModal = jQuery('#cliSettingsPopup'); 86 87 /* buttons */ 88 this.main_button=jQuery('.cli-plugin-main-button'); 89 this.main_link = jQuery('.cli-plugin-main-link'); 90 this.reject_link = jQuery('.cookie_action_close_header_reject'); 91 this.delete_link=jQuery(".cookielawinfo-cookie-delete"); 92 this.settings_button=jQuery('.cli_settings_button'); 93 this.accept_all_button = jQuery('.wt-cli-accept-all-btn'); 94 if(this.settings.cookie_bar_as=='popup') 95 { 96 CLI_COOKIEBAR_AS_POPUP=true; 97 } 98 this.mayBeSetPreferenceCookie(); 99 this.addStyleAttribute(); 100 this.configBar(); 101 this.toggleBar(); 102 this.attachDelete(); 103 this.attachEvents(); 104 this.configButtons(); 105 this.reviewConsent(); 106 var cli_hidebar_on_readmore=this.hideBarInReadMoreLink(); 107 if( Boolean( this.settings.scroll_close ) ===true && cli_hidebar_on_readmore===false) 108 { 109 window.addEventListener("scroll",CLI.closeOnScroll, false); 110 } 111 112 }, 113 hideBarInReadMoreLink:function() 114 { 115 if( Boolean( CLI.settings.button_2_hidebar ) === true && this.main_link.length>0 && this.main_link.hasClass('cli-minimize-bar')) 116 { 117 this.hideHeader(); 118 cliBlocker.cookieBar( false ); 119 this.showagain_elm.slideDown(this.settings.animate_speed_show); 120 return true; 121 } 122 return false;
123 }, 124 attachEvents:function() 125 { 126 jQuery(document).on('click','.wt-cli-privacy-btn',function(e){ 127 e.preventDefault(); 128 CLI.accept_close(); 129 CLI.settingsPopUpClose(); 130 }); 131 132 jQuery('.cli_action_button').on("click", function(e) { 133 e.preventDefault(); 134 var elm=jQuery(this); 135 var button_action=elm.attr('data-cli_action'); 136 var open_link=elm[0].hasAttribute("href") && elm.attr("href") != '#' ? true : false; 137 var new_window=false; 138 if(button_action=='accept') 139 { 140 CLI.accept_close(); 141 new_window= Boolean( CLI.settings.button_1_new_win ) ? true : false; 142 143 } 144 else if( button_action == 'accept_all') { 145 CLI.enableAllCookies(); 146 CLI.accept_close(); 147 new_window=CLI.settings.button_7_new_win ? true : false; 148 } 149 else if(button_action=='reject') 150 { 151 CLI.disableAllCookies(); 152 CLI.reject_close(); 153 new_window= Boolean( CLI.settings.button_3_new_win ) ? true : false; 154 } 155 if(open_link) 156 { 157 if(new_window) 158 { 159 window.open(elm.attr("href"),'_blank'); 160 }else 161 { 162 window.location.href =elm.attr("href"); 163 } 164 } 165 }); 166 this.settingsPopUp(); 167 this.settingsTabbedAccordion(); 168 this.toggleUserPreferenceCheckBox(); 169 this.hideCookieBarOnClose(); 170 this.cookieLawInfoRunCallBacks(); 171 172 }, 173 toggleUserPreferenceCheckBox:function() 174 { 175 176 jQuery('.cli-user-preference-checkbox').each(function(){ 177 178 categoryCookie = 'cookielawinfo-'+jQuery(this).attr('data-id'); 179 categoryCookieValue = CLI_Cookie.read(categoryCookie); 180 if( categoryCookieValue == null ) 181 { 182 if(jQuery(this).is(':checked')) 183 { 184 CLI_Cookie.set(categoryCookie,'yes',CLI_ACCEPT_COOKIE_EXPIRE); 185 }else 186 { 187 CLI_Cookie.set(categoryCookie,'no',CLI_ACCEPT_COOKIE_EXPIRE); 188 } 189 } 190 else 191 { 192 if(categoryCookieValue == "yes") 193 { 194 jQuery(this).prop("checked",true); 195 } 196 else 197 { 198 jQuery(this).prop("checked",false); 199 } 200 201 } 202 203 }); 204 jQuery('.cli-user-preference-checkbox').on("click", function(e) { 205 var dataID = jQuery(this).attr('data-id'); 206 var currentToggleElm = jQuery('.cli-user-preference-checkbox[data-id='+dataID+']'); 207 if(jQuery(this).is(':checked')) 208 { 209 CLI_Cookie.set('cookielawinfo-'+dataID,'yes',CLI_ACCEPT_COOKIE_EXPIRE); 210 currentToggleElm.prop('checked',true); 211 }else 212 { 213 CLI_Cookie.set('cookielawinfo-'+dataID,'no',CLI_ACCEPT_COOKIE_EXPIRE); 214 currentToggleElm.prop('checked',false); 215 } 216 CLI.checkCategories(); 217 CLI.generateConsent(); 218 }); 219 220 }, 221 settingsPopUp:function() 222 { 223 jQuery(document).on('click','.cli_settings_button',function(e){ 224 e.preventDefault(); 225 CLI.settingsModal.addClass("cli-show").css({'opacity':0}).animate({'opacity':1}); 226 CLI.settingsModal.removeClass('cli-blowup cli-out').addClass("cli-blowup"); 227 jQuery('body').addClass("cli-modal-open"); 228 jQuery(".cli-settings-overlay").addClass("cli-show"); 229 jQuery("#cookie-law-info-bar").css({'opacity':.1}); 230 if(!jQuery('.cli-settings-mobile').is(':visible')) 231 { 232 CLI.settingsModal.find('.cli-nav-link:eq(0)').trigger("click"); 233 } 234 }); 235 jQuery('#cliModalClose').on("click", function(e) { 236 CLI.settingsPopUpClose(); 237 }); 238 CLI.settingsModal.on("click", function(e) { 239 if(!(document.getElementsByClassName('cli-modal-dialog')[0].contains(e.target))) 240 { 241 CLI.settingsPopUpClose(); 242 } 243 }); 244 jQuery('.cli_enable_all_btn').on("click", function(e) { 245 var cli_toggle_btn = jQuery(this); 246 var enable_text = cli_toggle_btn.attr('data-enable-text'); 247 var disable_text= cli_toggle_btn.attr('data-disable-text'); 248 if(cli_toggle_btn.hasClass('cli-enabled')){ 249 CLI.disableAllCookies(); 250 cli_toggle_btn.html(enable_text); 251 } 252 else 253 { 254 CLI.enableAllCookies(); 255 cli_toggle_btn.html(disable_text); 256 257 } 258 jQuery(this).toggleClass('cli-enabled'); 259 }); 260 261 this.privacyReadmore(); 262 }, 263 settingsTabbedAccordion:function() 264 { 265 jQuery(".cli-tab-header").on("click", function(e) { 266 if(!(jQuery(e.target).hasClass('cli-slider') || jQuery(e.target).hasClass('cli-user-preference-checkbox'))) 267 { 268 if (jQuery(this).hasClass("cli-tab-active")) { 269 jQuery(this).removeClass("cli-tab-active"); 270 jQuery(this) 271 .siblings(".cli-tab-content") 272 .slideUp(200); 273 274 } else { 275 jQuery(".cli-tab-header").removeClass("cli-tab-active"); 276 jQuery(this).addClass("cli-tab-active"); 277 jQuery(".cli-tab-content").slideUp(200); 278 jQuery(this) 279 .siblings(".cli-tab-content") 280 .slideDown(200); 281 } 282 } 283 }); 284 }, 285 settingsPopUpClose:function() 286 { 287 this.settingsModal.removeClass('cli-show'); 288 this.settingsModal.addClass('cli-out'); 289 jQuery('body').removeClass("cli-modal-open"); 290 jQuery(".cli-settings-overlay").removeClass("cli-show"); 291 jQuery("#cookie-law-info-bar").css({'opacity':1}); 292 }, 293 privacyReadmore:function() 294 { 295 var el= jQuery('.cli-privacy-content .cli-privacy-content-text'); 296 if( el.length > 0 ) { 297 var clone= el.clone(), 298 originalHtml= clone.html(), 299 originalHeight= el.outerHeight(), 300 Trunc = { 301 addReadmore:function(textBlock) 302 { 303 if(textBlock.html().length > 250) 304 { 305 jQuery('.cli-privacy-readmore').show(); 306 } 307 else 308 { 309 jQuery('.cli-privacy-readmore').hide(); 310 } 311 }, 312 truncateText : function( textBlock ) { 313 var strippedText = jQuery('<div />').html(textBlock.html());
314 strippedText.find('table').remove(); 315 textBlock.html(strippedText.html()); 316 currentText = textBlock.text(); 317 if(currentText.trim().length > 250){ 318 var newStr = currentText.substring(0, 250); 319 textBlock.empty().html(newStr).append('...'); 320 } 321 }, 322 replaceText: function ( textBlock, original ){ 323 return textBlock.html(original); 324 } 325 326 }; 327 Trunc.addReadmore(el); 328 Trunc.truncateText(el); 329 jQuery('a.cli-privacy-readmore').on("click", function(e) { 330 e.preventDefault(); 331 if(jQuery('.cli-privacy-overview').hasClass('cli-collapsed')) 332 { 333 Trunc.truncateText(el); 334 jQuery('.cli-privacy-overview').removeClass('cli-collapsed'); 335 el.css('height', '100%'); 336 } 337 else 338 { 339 jQuery('.cli-privacy-overview').addClass('cli-collapsed'); 340 Trunc.replaceText(el, originalHtml); 341 } 342 343 344 }); 345 } 346 347 }, 348 attachDelete:function() 349 { 350 this.delete_link.on("click", function(e) { 351 CLI_Cookie.erase(CLI_ACCEPT_COOKIE_NAME); 352 for(var k in Cli_Data.nn_cookie_ids) 353 { 354 CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]); 355 } 356 CLI.generateConsent(); 357 return false; 358 }); 359 360 }, 361 configButtons:function() 362 { 363 /*[cookie_button] */ 364 this.main_button.css('color',this.settings.button_1_link_colour); 365 if( Boolean( this.settings.button_1_as_button ) ) 366 { 367 this.main_button.css('background-color',this.settings.button_1_button_colour); 368 369 this.main_button.on('mouseenter', function(){ 370 jQuery(this).css('background-color',CLI.settings.button_1_button_hover); 371 }) 372 .on('mouseleave', function(){ 373 jQuery(this).css('background-color',CLI.settings.button_1_button_colour); 374 }); 375 } 376 377 /* [cookie_link] */ 378 this.main_link.css('color',this.settings.button_2_link_colour); 379 if( Boolean( this.settings.button_2_as_button ) ) 380 { 381 this.main_link.css('background-color',this.settings.button_2_button_colour); 382 383 this.main_link.on('mouseenter', function(){ 384 jQuery(this).css('background-color',CLI.settings.button_2_button_hover); 385 }) 386 .on('mouseleave', function(){ 387 jQuery(this).css('background-color',CLI.settings.button_2_button_colour); 388 }); 389 390 } 391 /* [cookie_reject] */ 392 this.reject_link.css('color',this.settings.button_3_link_colour); 393 if( Boolean( this.settings.button_3_as_button ) ) 394 { 395 396 this.reject_link.css('background-color',this.settings.button_3_button_colour); 397 this.reject_link.on('mouseenter', function(){ 398 jQuery(this).css('background-color',CLI.settings.button_3_button_hover); 399 }) 400 .on('mouseleave', function(){ 401 jQuery(this).css('background-color',CLI.settings.button_3_button_colour); 402 }); 403 } 404 /* [cookie_settings] */ 405 this.settings_button.css('color',this.settings.button_4_link_colour); 406 if( Boolean( this.settings.button_4_as_button ) ) 407 { 408 this.settings_button.css('background-color',this.settings.button_4_button_colour); 409 this.settings_button.on('mouseenter', function(){ 410 jQuery(this).css('background-color',CLI.settings.button_4_button_hover); 411 }) 412 .on('mouseleave', function(){ 413 jQuery(this).css('background-color',CLI.settings.button_4_button_colour); 414 }); 415 } 416 /* [cookie_accept_all] */ 417 this.accept_all_button.css('color',this.settings.button_7_link_colour); 418 if(this.settings.button_7_as_button) 419 { 420 this.accept_all_button.css('background-color',this.settings.button_7_button_colour); 421 this.accept_all_button.on('mouseenter', function(){ 422 jQuery(this).css('background-color',CLI.settings.button_7_button_hover); 423 }) 424 .on('mouseleave', function(){ 425 jQuery(this).css('background-color',CLI.settings.button_7_button_colour); 426 }); 427 } 428 }, 429 toggleBar:function() 430 { 431 if(CLI_COOKIEBAR_AS_POPUP) 432 { 433 this.barAsPopUp(1); 434 } 435 if(CLI.settings.cookie_bar_as=='widget') 436 { 437 this.barAsWidget(1); 438 } 439 if(!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME)) 440 { 441 this.displayHeader(); 442 }else 443 { 444 this.hideHeader(); 445 } 446 if( Boolean( this.settings.show_once_yn )) 447 { 448 setTimeout(function(){ 449 CLI.close_header(); 450 },CLI.settings.show_once); 451 } 452 if( CLI.js_blocking_enabled === false ) { 453 if( Boolean( Cli_Data.ccpaEnabled ) === true ) { 454 if( Cli_Data.ccpaType === 'ccpa' && Boolean( Cli_Data.ccpaBarEnabled ) === false ) { 455 cliBlocker.cookieBar( false ); 456 } 457 } else { 458 jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove(); 459 } 460 } 461 462 this.showagain_elm.on("click", function(e) { 463 e.preventDefault(); 464 CLI.showagain_elm.slideUp(CLI.settings.animate_speed_hide,function() 465 { 466 CLI.bar_elm.slideDown(CLI.settings.animate_speed_show); 467 if(CLI_COOKIEBAR_AS_POPUP) 468 { 469 CLI.showPopupOverlay(); 470 } 471 }); 472 }); 473 }, 474 configShowAgain:function() 475 { 476 this.showagain_config = { 477 'background-color': this.settings.background, 478 'color':this.l1hs(this.settings.text), 479 'position': 'fixed', 480 'font-family': this.settings.font_family 481 }; 482 if(Boolean( this.settings.border_on ) ) 483 { 484 var border_to_hide = 'border-' + this.settings.notify_position_vertical; 485 this.showagain_config['border'] = '1px solid ' + this.l1hs(this.settings.border); 486 this.showagain_config[border_to_hide] = 'none'; 487 } 488 var cli_win=jQuery(window); 489 var cli_winw=cli_win.width(); 490 var showagain_x_pos=this.settings.showagain_x_position; 491 if(cli_winw<300) 492 { 493 showagain_x_pos=10; 494 this.showagain_config.width=cli_winw-20; 495 }else 496 { 497 this.showagain_config.width='auto'; 498 } 499 var cli_defw=cli_winw>400 ? 500 : cli_winw-20; 500 if(CLI_COOKIEBAR_AS_POPUP) /* cookie bar as popup */ 501 { 502 var sa_pos=this.settings.popup_showagain_position; 503 var sa_pos_arr=sa_pos.split('-'); 504 if(sa_pos_arr[1]=='left') 505 { 506 this.showagain_config.left=showagain_x_pos; 507 }else if(sa_pos_arr[1]=='right') 508 { 509 this.showagain_config.right=showagain_x_pos; 510 } 511 if(sa_pos_arr[0]=='top') 512 { 513 this.showagain_config.top=0; 514 515 }else if(sa_pos_arr[0]=='bottom') 516 { 517 this.showagain_config.bottom=0; 518 } 519 this.bar_config['position'] = 'fixed'; 520 521 }else if(this.settings.cookie_bar_as=='widget') 522 { 523 this.showagain_config.bottom=0; 524 if(this.settings.widget_position=='left') 525 { 526 this.showagain_config.left=showagain_x_pos; 527 }else if(this.settings.widget_position=='right') 528 { 529 this.showagain_config.right=showagain_x_pos; 530 } 531 } 532 else 533 { 534 if(this.settings.notify_position_vertical == "top") 535 { 536 this.showagain_config.top = '0'; 537 } 538 else if(this.settings.notify_position_vertical == "bottom") 539 { 540 this.bar_config['position'] = 'fixed'; 541 this.bar_config['bottom'] = '0'; 542 this.showagain_config.bottom = '0'; 543 } 544 if(this.settings.notify_position_horizontal == "left") 545 { 546 this.showagain_config.left =showagain_x_pos; 547 }else if(this.settings.notify_position_horizontal == "right") 548 { 549 this.showagain_config.right =showagain_x_pos; 550 } 551 } 552 this.showagain_elm.css(this.showagain_config); 553 }, 554 configBar:function() 555 { 556 this.bar_config = { 557 'background-color':this.settings.background, 558 'color':this.settings.text, 559 'font-family':this.settings.font_family 560 }; 561 if(this.settings.notify_position_vertical=="top") 562 { 563 this.bar_config['top'] = '0'; 564 if( Boolean( this.settings.header_fix ) === true) 565 { 566 this.bar_config['position'] = 'fixed'; 567 } 568 }else 569 { 570 this.bar_config['bottom'] = '0'; 571 } 572 this.configShowAgain(); 573 this.bar_elm.css(this.bar_config).hide(); 574 }, 575 l1hs:function(str) 576 { 577 if (str.charAt(0) == "#") { 578 str = str.substring(1, str.length); 579 } else { 580 return "#" + str; 581 } 582 return this.l1hs(str); 583 }, 584 close_header:function() 585 { 586 CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'yes',CLI_ACCEPT_COOKIE_EXPIRE); 587 this.hideHeader(); 588 }, 589 accept_close:function() 590 { 591 this.hidePopupOverlay(); 592 this.generateConsent(); 593 this.cookieLawInfoRunCallBacks(); 594 595 CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'yes',CLI_ACCEPT_COOKIE_EXPIRE); 596 if( Boolean( this.settings.notify_animate_hide ) ) 597 { 598 if( CLI.js_blocking_enabled === true ) { 599 this.bar_elm.slideUp( this.settings.animate_speed_hide, cliBlocker.runScripts ); 600 } else { 601 this.bar_elm.slideUp( this.settings.animate_speed_hide ); 602 } 603 604 }else 605 { 606 if( CLI.js_blocking_enabled === true ) { 607 this.bar_elm.hide( 0, cliBlocker.runScripts ); 608 609 } else { 610 this.bar_elm.hide(); 611 } 612 } 613 if( Boolean( this.settings.showagain_tab ) ) 614 { 615 this.showagain_elm.slideDown(this.settings.animate_speed_show); 616 } 617 if( Boolean( this.settings.accept_close_reload ) === true ) 618 { 619 this.reload_current_page(); 620 } 621 return false;
622 }, 623 reject_close:function() 624 { 625 this.hidePopupOverlay(); 626 this.generateConsent(); 627 this.cookieLawInfoRunCallBacks(); 628 for(var k in Cli_Data.nn_cookie_ids) 629 { 630 CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]); 631 } 632 CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'no',CLI_ACCEPT_COOKIE_EXPIRE); 633 634 if( Boolean( this.settings.notify_animate_hide ) ) 635 { 636 if( CLI.js_blocking_enabled === true ) { 637 638 this.bar_elm.slideUp(this.settings.animate_speed_hide, cliBlocker.runScripts); 639 640 } else { 641 642 this.bar_elm.slideUp(this.settings.animate_speed_hide); 643 } 644 645 } else 646 { 647 if( CLI.js_blocking_enabled === true ) { 648 649 this.bar_elm.hide( cliBlocker.runScripts ); 650 651 } else { 652 653 this.bar_elm.hide(); 654 655 } 656 657 } 658 if( Boolean( this.settings.showagain_tab ) ) 659 { 660 this.showagain_elm.slideDown(this.settings.animate_speed_show); 661 } 662 if( Boolean( this.settings.reject_close_reload ) === true ) 663 { 664 this.reload_current_page(); 665 } 666 return false; 667 }, 668 reload_current_page:function() 669 { 670 671 window.location.reload(true); 672 }, 673 closeOnScroll:function() 674 { 675 if(window.pageYOffset > 100 && !CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)) 676 { 677 CLI.accept_close(); 678 if( Boolean( CLI.settings.scroll_close_reload ) === true) 679 { 680 window.location.reload(); 681 } 682 window.removeEventListener("scroll",CLI.closeOnScroll,false); 683 } 684 }, 685 displayHeader:function() 686 { 687 if( Boolean( this.settings.notify_animate_show ) ) 688 { 689 this.bar_elm.slideDown(this.settings.animate_speed_show); 690 }else 691 { 692 this.bar_elm.show(); 693 } 694 this.showagain_elm.hide(); 695 if(CLI_COOKIEBAR_AS_POPUP) 696 { 697 this.showPopupOverlay(); 698 } 699 }, 700 hideHeader:function() 701 { 702 if( Boolean( this.settings.showagain_tab ) ) 703 { 704 if( Boolean( this.settings.notify_animate_show ) ) 705 { 706 this.showagain_elm.slideDown(this.settings.animate_speed_show); 707 } else { 708 this.showagain_elm.show(); 709 } 710 }else 711 { 712 this.showagain_elm.hide(); 713 } 714 this.bar_elm.slideUp(this.settings.animate_speed_show); 715 this.hidePopupOverlay(); 716 }, 717 hidePopupOverlay:function() 718 { 719 jQuery('body').removeClass("cli-barmodal-open"); 720 jQuery(".cli-popupbar-overlay").removeClass("cli-show"); 721 }, 722 showPopupOverlay:function() 723 { 724 if( this.bar_elm.length ) { 725 if( Boolean( this.settings.popup_overlay ) ) 726 { 727 jQuery('body').addClass("cli-barmodal-open"); 728 jQuery(".cli-popupbar-overlay").addClass("cli-show"); 729 } 730 } 731 732 }, 733 barAsWidget:function(a) 734 { 735 var cli_elm=this.bar_elm; 736 cli_elm.attr('data-cli-type','widget'); 737 var cli_win=jQuery(window); 738 var cli_winh=cli_win.height()-40; 739 var cli_winw=cli_win.width(); 740 var cli_defw=cli_winw>400 ? 300 : cli_winw-30; 741 cli_elm.css({ 742 'width':cli_defw,'height':'auto','max-height':cli_winh,'overflow':'auto','position':'fixed','box-sizing':'border-box' 743 }); 744 if ( this.checkifStyleAttributeExist() === false ) { 745 cli_elm.css({'padding':'25px 15px'}); 746 } 747 if(this.settings.widget_position=='left') 748 { 749 cli_elm.css({ 750 'left':'15px','right':'auto','bottom':'15px','top':'auto' 751 }); 752 }else 753 { 754 cli_elm.css({ 755 'left':'auto','right':'15px','bottom':'15px','top':'auto' 756 }); 757 } 758 if(a) 759 { 760 this.setResize(); 761 } 762 }, 763 barAsPopUp:function(a) 764 { 765 if(typeof cookie_law_info_bar_as_popup==='function') 766 { 767 return false; 768 } 769 var cli_elm=this.bar_elm; 770 cli_elm.attr('data-cli-type','popup'); 771 var cli_win=jQuery(window); 772 var cli_winh=cli_win.height()-40; 773 var cli_winw=cli_win.width(); 774 var cli_defw=cli_winw>700 ? 500 : cli_winw-20; 775 776 cli_elm.css({ 777 'width':cli_defw,'height':'auto','max-height':cli_winh,'bottom':'','top':'50%','left':'50%','margin-left':(cli_defw/2)*-1,'margin-top':'-100px','overflow':'auto' 778 }).addClass('cli-bar-popup cli-modal-content'); 779 if ( this.checkifStyleAttributeExist() === false ) { 780 cli_elm.css({'padding':'25px 15px'}); 781 } 782 cli_h=cli_elm.height(); 783 li_h=cli_h<200 ? 200 : cli_h; 784 cli_elm.css({'top':'50%','margin-top':((cli_h/2)+30)*-1}); 785 setTimeout(function(){ 786 cli_elm.css({ 787 'bottom':'' 788 }); 789 },100); 790 if(a) 791 { 792 this.setResize(); 793 } 794 }, 795 setResize:function() 796 { 797 var resizeTmr=null; 798 jQuery(window).resize(function() { 799 clearTimeout(resizeTmr); 800 resizeTmr=setTimeout(function() 801 { 802 if(CLI_COOKIEBAR_AS_POPUP) 803 { 804 CLI.barAsPopUp(); 805 } 806 if(CLI.settings.cookie_bar_as=='widget') 807 { 808 CLI.barAsWidget(); 809 } 810 CLI.configShowAgain(); 811 },500); 812 }); 813 }, 814 enableAllCookies:function() 815 { 816 817 jQuery('.cli-user-preference-checkbox').each(function(){ 818 var cli_chkbox_elm=jQuery(this); 819 var cli_chkbox_data_id=cli_chkbox_elm.attr('data-id'); 820 if(cli_chkbox_data_id!='checkbox-necessary') 821 { 822 cli_chkbox_elm.prop('checked',true); 823 CLI_Cookie.set('cookielawinfo-'+cli_chkbox_data_id,'yes',CLI_ACCEPT_COOKIE_EXPIRE); 824 } 825 }); 826 }, 827 disableAllCookies:function() 828 { 829 jQuery('.cli-user-preference-checkbox').each(function(){ 830 831 var cli_chkbox_elm=jQuery(this); 832 var cli_chkbox_data_id=cli_chkbox_elm.attr('data-id'); 833 cliCategorySlug = cli_chkbox_data_id.replace('checkbox-',''); 834 if(Cli_Data.strictlyEnabled.indexOf(cliCategorySlug) === -1) 835 {
836 cli_chkbox_elm.prop('checked',false); 837 CLI_Cookie.set('cookielawinfo-'+cli_chkbox_data_id,'no',CLI_ACCEPT_COOKIE_EXPIRE); 838 } 839 }); 840 }, 841 hideCookieBarOnClose: function() { 842 jQuery(document).on('click','.cli_cookie_close_button',function(e){ 843 e.preventDefault(); 844 var elm=jQuery(this); 845 var button_action = elm.attr('data-cli_action'); 846 if( Cli_Data.ccpaType === 'ccpa' ) 847 { 848 CLI.enableAllCookies(); 849 } 850 CLI.accept_close(); 851 }); 852 }, 853 checkCategories:function() 854 { 855 var cliAllowedCategories = []; 856 var cli_categories = {}; 857 jQuery('.cli-user-preference-checkbox').each(function() 858 { var status=false; 859 cli_chkbox_elm=jQuery(this); 860 cli_chkbox_data_id=cli_chkbox_elm.attr('data-id'); 861 cli_chkbox_data_id=cli_chkbox_data_id.replace('checkbox-',''); 862 cli_chkbox_data_id_trimmed=cli_chkbox_data_id.replace('-','_') 863 if(jQuery(cli_chkbox_elm).is(':checked')) 864 { 865 status=true; 866 cliAllowedCategories.push(cli_chkbox_data_id); 867 } 868 869 cli_categories[cli_chkbox_data_id_trimmed]= status; 870 }); 871 CLI.allowedCategories = cliAllowedCategories; 872 },
873 cookieLawInfoRunCallBacks:function() 874 { 875 this.checkCategories(); 876 if(CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)=='yes') 877 { 878 if("function" == typeof CookieLawInfo_Accept_Callback){ 879 CookieLawInfo_Accept_Callback(); 880 } 881 } 882 }, 883 generateConsent:function() 884 { 885 var preferenceCookie = CLI_Cookie.read(CLI_PREFERNCE_COOKIE); 886 cliConsent = {}; 887 if(preferenceCookie !== null) { 888 cliConsent = window.atob(preferenceCookie); 889 cliConsent = JSON.parse(cliConsent); 890 } 891 cliConsent.ver = Cli_Data.consentVersion; 892 categories = []; 893 jQuery('.cli-user-preference-checkbox').each(function(){ 894 categoryVal = ''; 895 cli_chkbox_data_id = jQuery(this).attr('data-id'); 896 cli_chkbox_data_id = cli_chkbox_data_id.replace('checkbox-',''); 897 if(jQuery(this).is(':checked')) 898 { 899 categoryVal = true; 900 } 901 else 902 { 903 categoryVal = false; 904 } 905 cliConsent[cli_chkbox_data_id] = categoryVal; 906 }); 907 cliConsent = JSON.stringify(cliConsent); 908 cliConsent = window.btoa(cliConsent); 909 CLI_Cookie.set(CLI_PREFERNCE_COOKIE,cliConsent,CLI_ACCEPT_COOKIE_EXPIRE); 910 }, 911 addStyleAttribute:function() 912 { 913 var bar=this.bar_elm; 914 var styleClass=''; 915 if(jQuery(bar).find('.cli-bar-container').length > 0) 916 { 917 styleClass = jQuery('.cli-bar-container').attr('class'); 918 styleClass = styleClass.replace('cli-bar-container',''); 919 styleClass = styleClass.trim(); 920 jQuery(bar).attr('data-cli-style',styleClass); 921 } 922 }, 923 getParameterByName: function( name, url ) { 924 if (!url) url = window.location.href; 925 name = name.replace(/[\[\]]/g, '\\$&'); 926 var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), 927 results = regex.exec(url); 928 if (!results) return null; 929 if (!results[2]) return ''; 930 return decodeURIComponent(results[2].replace(/\+/g, ' ')); 931 }, 932 CookieLawInfo_Callback: function( enableBar, enableBlocking ) { 933 enableBar = typeof enableBar !== 'undefined' ? enableBar : true; 934 enableBlocking = typeof enableBlocking !== 'undefined' ? enableBlocking : true; 935 if( CLI.js_blocking_enabled === true && Boolean( Cli_Data.custom_integration ) === true ) { 936 cliBlocker.cookieBar( enableBar ); 937 cliBlocker.runScripts( enableBlocking ); 938 } 939 }, 940 checkifStyleAttributeExist: function() 941 { 942 var exist = false; 943 var attr = this.bar_elm.attr('data-cli-style'); 944 if (typeof attr !== typeof undefined && attr !== false) { 945 exist = true; 946 } 947 return exist; 948 }, 949 reviewConsent : function() 950 { 951 jQuery(document).on('click','.cli_manage_current_consent,.wt-cli-manage-consent-link',function(){ 952 CLI.displayHeader(); 953 }); 954 }, 955 mayBeSetPreferenceCookie: function() { 956 if( CLI.getParameterByName('cli_bypass') === "1" ) { 957 CLI.generateConsent(); 958 } 959 } 960} 961var cliBlocker = 962{ 963 blockingStatus: true, 964 scriptsLoaded: false, 965 ccpaEnabled : false, 966 ccpaRegionBased : false, 967 ccpaApplicable : false, 968 ccpaBarEnabled: false, 969 cliShowBar: true , 970 isBypassEnabled: CLI.getParameterByName('cli_bypass'), 971 checkPluginStatus: function(callbackA , callbackB ) 972 { 973 this.ccpaEnabled = Boolean( Cli_Data.ccpaEnabled ); 974 this.ccpaRegionBased = Boolean( Cli_Data.ccpaRegionBased ); 975 this.ccpaBarEnabled = Boolean( Cli_Data.ccpaBarEnabled ); 976 977 if( Boolean( Cli_Data.custom_integration ) === true ) { 978 callbackA( false ); 979 } 980 else { 981 if( this.ccpaEnabled === true ) { 982 this.ccpaApplicable = true; 983 if( Cli_Data.ccpaType === 'ccpa') { 984 if( this.ccpaBarEnabled !== true ) { 985 this.cliShowBar = false; 986 this.blockingStatus = false; 987 } 988 } 989 } else { 990 jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove(); 991 } 992 if ( cliBlocker.isBypassEnabled === "1") { 993 cliBlocker.blockingStatus = false; 994 } 995 callbackA( this.cliShowBar ); 996 callbackB( this.blockingStatus); 997 } 998 999 1000 }, 1001 cookieBar: function( showbar ) 1002 { 1003 showbar = typeof showbar !== 'undefined' ? showbar : true; 1004 cliBlocker.cliShowBar = showbar; 1005 if(cliBlocker.cliShowBar === false) 1006 { 1007 CLI.bar_elm.hide(); 1008 CLI.showagain_elm.hide(); 1009 CLI.settingsModal.removeClass('cli-blowup cli-out'); 1010 CLI.hidePopupOverlay(); 1011 jQuery(".cli-settings-overlay").removeClass("cli-show"); 1012 } 1013 else 1014 { 1015 if(!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME)) 1016 { 1017 CLI.displayHeader(); 1018 } 1019 else 1020 {
1021 CLI.hideHeader(); 1022 } 1023 } 1024 }, 1025 removeCookieByCategory : function() 1026 { 1027 1028 if(cliBlocker.blockingStatus === true) 1029 { 1030 if(CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) !== null) 1031 { 1032 var non_necessary_cookies = Cli_Data.non_necessary_cookies; 1033 for (var key in non_necessary_cookies) { 1034 currentCategory = key; 1035 if(CLI.allowedCategories.indexOf(currentCategory) === -1) 1036 { 1037 var nonNecessaryCookies = non_necessary_cookies[currentCategory]; 1038 for(var i=0; i < nonNecessaryCookies.length; i++) 1039 { 1040 if(CLI_Cookie.read(nonNecessaryCookies[i]) !== null) 1041 { 1042 CLI_Cookie.erase(nonNecessaryCookies[i]); 1043 } 1044 1045 } 1046 } 1047 } 1048 } 1049 } 1050 }, 1051 runScripts:function( blocking ) 1052 { 1053 blocking = typeof blocking !== 'undefined' ? blocking : true; 1054 cliBlocker.blockingStatus = blocking; 1055 srcReplaceableElms = ['iframe','IFRAME','EMBED','embed','OBJECT','object','IMG','img']; 1056 var genericFuncs = 1057 { 1058 1059 renderByElement: function( callback ) 1060 { 1061 cliScriptFuncs.renderScripts(); 1062 callback(); 1063 cliBlocker.scriptsLoaded = true; 1064 }, 1065 1066 }; 1067 var cliScriptFuncs = 1068 { 1069 // trigger DOMContentLoaded 1070 scriptsDone:function() 1071 { 1072 if (typeof Cli_Data.triggerDomRefresh !== 'undefined') { 1073 if( Boolean( Cli_Data.triggerDomRefresh ) === true ) 1074 { 1075 var DOMContentLoadedEvent = document.createEvent('Event') 1076 DOMContentLoadedEvent.initEvent('DOMContentLoaded', true, true) 1077 window.document.dispatchEvent(DOMContentLoadedEvent); 1078 } 1079 } 1080 }, 1081 seq :function(arr, callback, index) { 1082 // first call, without an index 1083 if (typeof index === 'undefined') { 1084 index = 0 1085 } 1086 1087 arr[index](function () { 1088 index++ 1089 if (index === arr.length) { 1090 callback() 1091 } else { 1092 cliScriptFuncs.seq(arr, callback, index) 1093 } 1094 }) 1095 }, 1096 /* script runner */ 1097 insertScript:function($script,callback) { 1098 var s =''; 1099 var scriptType = $script.getAttribute('data-cli-script-type'); 1100 var elementPosition = $script.getAttribute('data-cli-element-position'); 1101 var isBlock = $script.getAttribute('data-cli-block'); 1102 var s = document.createElement('script'); 1103 var ccpaOptedOut = cliBlocker.ccpaOptedOut(); 1104 s.type = 'text/plain'; 1105 if($script.async) 1106 { 1107 s.async = $script.async; 1108 } 1109 if($script.defer) 1110 { 1111 s.defer = $script.defer; 1112 } 1113 if ($script.src) { 1114 s.onload = callback 1115 s.onerror = callback 1116 s.src = $script.src 1117 } else { 1118 s.textContent = $script.innerText 1119 } 1120 var attrs = jQuery($script).prop("attributes"); 1121 for (var ii = 0; ii < attrs.length; ++ii) { 1122 if (attrs[ii].nodeName !== 'id') { 1123 s.setAttribute(attrs[ii].nodeName,attrs[ii].value); 1124 } 1125 } 1126 if(cliBlocker.blockingStatus === true) 1127 { 1128 1129 if(( CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)=='yes' && CLI.allowedCategories.indexOf(scriptType) !== -1 ) ) 1130 { 1131 s.setAttribute('data-cli-consent','accepted'); 1132 s.type = 'text/javascript'; 1133 } 1134 if( cliBlocker.ccpaApplicable === true ) { 1135 if( ccpaOptedOut === true || CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) == null ) { 1136 s.type = 'text/plain'; 1137 } 1138 } 1139 } 1140 else 1141 { 1142 s.type = 'text/javascript'; 1143 } 1144 1145 if($script.type != s.type) 1146 { 1147 if(elementPosition === 'head') { 1148 document.head.appendChild(s); 1149 } else { 1150 document.body.appendChild(s); 1151 } 1152 if (!$script.src) { 1153 callback() 1154 } 1155 $script.parentNode.removeChild($script); 1156 1157 } 1158 else { 1159 1160 callback(); 1161 } 1162 }, 1163 renderScripts:function() 1164 { 1165 var $scripts = document.querySelectorAll('script[data-cli-class="cli-blocker-script"]'); 1166 if($scripts.length > 0) 1167 { 1168 var runList = [] 1169 var typeAttr 1170 Array.prototype.forEach.call($scripts, function ($script) { 1171 // only run script tags without the type attribute 1172 // or with a javascript mime attribute value 1173 typeAttr = $script.getAttribute('type') 1174 runList.push(function (callback) { 1175 cliScriptFuncs.insertScript($script, callback) 1176 }) 1177 }) 1178 cliScriptFuncs.seq(runList, cliScriptFuncs.scriptsDone); 1179 } 1180 } 1181 }; 1182 genericFuncs.renderByElement( cliBlocker.removeCookieByCategory ); 1183 }, 1184 ccpaOptedOut : function () { 1185 var ccpaOptedOut = false;
1186 var preferenceCookie = CLI_Cookie.read(CLI_PREFERNCE_COOKIE); 1187 if( preferenceCookie !== null ) { 1188 cliConsent = window.atob(preferenceCookie); 1189 cliConsent = JSON.parse(cliConsent); 1190 if( typeof cliConsent.ccpaOptout !== 'undefined') { 1191 ccpaOptedOut = cliConsent.ccpaOptout; 1192 } 1193 } 1194 return ccpaOptedOut; 1195 } 1196} 1197jQuery(document).ready(function() { 1198 if(typeof cli_cookiebar_settings!='undefined') 1199 { 1200 CLI.set({ 1201 settings:cli_cookiebar_settings 1202 }); 1203 if( CLI.js_blocking_enabled === true ) { 1204 cliBlocker.checkPluginStatus(cliBlocker.cookieBar,cliBlocker.runScripts); 1205 } 1206 } 1207});
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.