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