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