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