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