1CLI_ACCEPT_COOKIE_NAME =(typeof CLI_ACCEPT_COOKIE_NAME !== 'undefined' ? CLI_ACCEPT_COOKIE_NAME : 'viewed_cookie_policy'); 2CLI_ACCEPT_COOKIE_EXPIRE =(typeof CLI_ACCEPT_COOKIE_EXPIRE !== 'undefined' ? CLI_ACCEPT_COOKIE_EXPIRE : 365); 3CLI_COOKIEBAR_AS_POPUP=(typeof CLI_COOKIEBAR_AS_POPUP !== 'undefined' ? CLI_COOKIEBAR_AS_POPUP : false); 4var CLI_Cookie={ 5 set: function (name, value, days) { 6 if (days) { 7 var date = new Date(); 8 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 9 var expires = "; expires=" + date.toGMTString(); 10 } else 11 var expires = ""; 12 document.cookie = name + "=" + value + expires + "; path=/"; 13 if(days<1) 14 { 15 host_name=window.location.hostname; 16 document.cookie = name + "=" + value + expires + "; path=/; domain=."+host_name+";"; 17 if(host_name.indexOf("www")!=1) 18 { 19 var host_name_withoutwww=host_name.replace('www',''); 20 document.cookie = name + "=" + value + expires + "; path=/; domain="+host_name_withoutwww+";"; 21 } 22 host_name=host_name.substring(host_name.lastIndexOf(".", host_name.lastIndexOf(".")-1)); 23 document.cookie = name + "=" + value + expires + "; path=/; domain="+host_name+";"; 24 } 25 }, 26 read: function (name) { 27 var nameEQ = name + "="; 28 var ca = document.cookie.split(';'); 29 for (var i = 0; i < ca.length; i++) { 30 var c = ca[i]; 31 while (c.charAt(0) == ' ') { 32 c = c.substring(1, c.length); 33 } 34 if (c.indexOf(nameEQ) === 0) { 35 return c.substring(nameEQ.length, c.length); 36 } 37 } 38 return null; 39 }, 40 erase: function (name) { 41 this.set(name, "", -10); 42 }, 43 exists: function (name) { 44 return (this.read(name) !== null); 45 }, 46 getallcookies:function() 47 { 48 var pairs = document.cookie.split(";"); 49 var cookieslist = {}; 50 for (var i = 0; i < pairs.length; i++) { 51 var pair = pairs[i].split("="); 52 cookieslist[(pair[0] + '').trim()] = unescape(pair[1]); 53 } 54 return cookieslist; 55 } 56} 57var CLI= 58{ 59 bar_config:{}, 60 showagain_config:{}, 61 set:function(args) 62 { 63 if(typeof JSON.parse !== "function") 64 { 65 console.log("CookieLawInfo requires JSON.parse but your browser doesn't support it"); 66 return; 67 } 68 this.settings = JSON.parse(args.settings); 69 this.bar_elm=jQuery(this.settings.notify_div_id); 70 this.showagain_elm = jQuery(this.settings.showagain_div_id); 71 72 /* buttons */ 73 this.main_button=jQuery('.cli-plugin-main-button'); 74 this.main_link = jQuery('.cli-plugin-main-link'); 75 this.reject_link = jQuery('.cookie_action_close_header_reject'); 76 this.delete_link=jQuery(".cookielawinfo-cookie-delete"); 77 78 if(this.settings.cookie_bar_as=='popup') 79 { 80 CLI_COOKIEBAR_AS_POPUP=true; 81 } 82 this.configBar(); 83 this.toggleBar(); 84 this.attachDelete(); 85 this.attachEvents(); 86 this.configButtons(); 87 var cli_hidebar_on_readmore=this.hideBarInReadMoreLink(); 88 if(this.settings.scroll_close===true && cli_hidebar_on_readmore===false) 89 { 90 window.addEventListener("scroll",CLI.closeOnScroll, false); 91 } 92 }, 93 hideBarInReadMoreLink:function() 94 { 95 if(CLI.settings.button_2_hidebar===true && this.main_link.length>0 && this.main_link.hasClass('cli-minimize-bar')) 96 { 97 this.hideHeader(); 98 this.showagain_elm.slideDown(this.settings.animate_speed_show); 99 return true; 100 } 101 return false; 102 }, 103 attachEvents:function() 104 { 105 jQuery('.cli_action_button').click(function(e){ 106 e.preventDefault(); 107 var elm=jQuery(this); 108 var button_action=elm.attr('data-cli_action'); 109 var open_link=elm[0].hasAttribute("href") && elm.attr("href") != '#' ? true : false; 110 var new_window=false; 111 if(button_action=='accept') 112 { 113 CLI.accept_close(); 114 new_window=CLI.settings.button_1_new_win ? true : false; 115 }else if(button_action=='reject') 116 { 117 CLI.reject_close(); 118 new_window=CLI.settings.button_3_new_win ? true : false; 119 } 120 if(open_link) 121 { 122 if(new_window) 123 { 124 window.open(elm.attr("href"),'_blank'); 125 }else 126 { 127 window.location.href =elm.attr("href"); 128 } 129 } 130 }); 131 }, 132 attachDelete:function() 133 { 134 this.delete_link.click(function () { 135 CLI_Cookie.erase(CLI_ACCEPT_COOKIE_NAME); 136 for(var k in Cli_Data.nn_cookie_ids) 137 { 138 CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]); 139 } 140 return false; 141 }); 142 }, 143 configButtons:function() 144 { 145 /*[cookie_button] */ 146 this.main_button.css('color',this.settings.button_1_link_colour); 147 if(this.settings.button_1_as_button) 148 { 149 this.main_button.css('background-color',this.settings.button_1_button_colour); 150 this.main_button.hover(function () { 151 jQuery(this).css('background-color',CLI.settings.button_1_button_hover); 152 },function (){ 153 jQuery(this).css('background-color',CLI.settings.button_1_button_colour); 154 }); 155 } 156 157 /* [cookie_link] */ 158 this.main_link.css('color',this.settings.button_2_link_colour); 159 if(this.settings.button_2_as_button) 160 { 161 this.main_link.css('background-color',this.settings.button_2_button_colour); 162 this.main_link.hover(function () { 163 jQuery(this).css('background-color',CLI.settings.button_2_button_hover); 164 },function (){ 165 jQuery(this).css('background-color',CLI.settings.button_2_button_colour); 166 }); 167 } 168 169 170 /* [cookie_reject] */ 171 this.reject_link.css('color',this.settings.button_3_link_colour); 172 if(this.settings.button_3_as_button) 173 { 174 this.reject_link.css('background-color',this.settings.button_3_button_colour); 175 this.reject_link.hover(function () { 176 jQuery(this).css('background-color',CLI.settings.button_3_button_hover); 177 },function () { 178 jQuery(this).css('background-color',CLI.settings.button_3_button_colour); 179 }); 180 } 181 }, 182 toggleBar:function() 183 { 184 if(CLI_COOKIEBAR_AS_POPUP) 185 { 186 this.barAsPopUp(1); 187 } 188 if(CLI.settings.cookie_bar_as=='widget') 189 { 190 this.barAsWidget(1); 191 } 192 if(!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME)) 193 { 194 this.displayHeader(); 195 }else 196 { 197 this.hideHeader(); 198 } 199 if(this.settings.show_once_yn) 200 { 201 setTimeout(function(){ 202 CLI.close_header(); 203 },CLI.settings.show_once); 204 } 205 206 this.showagain_elm.click(function (e) { 207 e.preventDefault(); 208 CLI.showagain_elm.slideUp(CLI.settings.animate_speed_hide,function() 209 { 210 CLI.bar_elm.slideDown(CLI.settings.animate_speed_show); 211 if(CLI_COOKIEBAR_AS_POPUP) 212 { 213 CLI.showPopupOverlay(); 214 } 215 }); 216 }); 217 }, 218 configShowAgain:function() 219 { 220 this.showagain_config = { 221 'background-color': this.settings.background, 222 'color':this.l1hs(this.settings.text), 223 'position': 'fixed', 224 'font-family': this.settings.font_family 225 }; 226 if(this.settings.border_on) 227 { 228 var border_to_hide = 'border-' + this.settings.notify_position_vertical; 229 this.showagain_config['border'] = '1px solid ' + this.l1hs(this.settings.border); 230 this.showagain_config[border_to_hide] = 'none'; 231 } 232 var cli_win=jQuery(window); 233 var cli_winw=cli_win.width(); 234 var showagain_x_pos=this.settings.showagain_x_position; 235 if(cli_winw<300) 236 { 237 showagain_x_pos=10; 238 this.showagain_config.width=cli_winw-20; 239 }else 240 { 241 this.showagain_config.width='auto'; 242 } 243 var cli_defw=cli_winw>400 ? 500 : cli_winw-20; 244 if(CLI_COOKIEBAR_AS_POPUP) /* cookie bar as popup */ 245 { 246 var sa_pos=this.settings.popup_showagain_position; 247 var sa_pos_arr=sa_pos.split('-'); 248 if(sa_pos_arr[1]=='left') 249 { 250 this.showagain_config.left=showagain_x_pos; 251 }else if(sa_pos_arr[1]=='right') 252 { 253 this.showagain_config.right=showagain_x_pos; 254 } 255 if(sa_pos_arr[0]=='top') 256 { 257 this.showagain_config.top=0; 258 259 }else if(sa_pos_arr[0]=='bottom') 260 { 261 this.showagain_config.bottom=0; 262 } 263 this.bar_config['position'] = 'fixed'; 264 265 }else if(this.settings.cookie_bar_as=='widget') 266 { 267 this.showagain_config.bottom=0; 268 if(this.settings.widget_position=='left') 269 { 270 this.showagain_config.left=showagain_x_pos; 271 }else if(this.settings.widget_position=='right') 272 { 273 this.showagain_config.right=showagain_x_pos; 274 } 275 } 276 else 277 { 278 if(this.settings.notify_position_vertical == "top") 279 { 280 this.showagain_config.top = '0'; 281 } 282 else if(this.settings.notify_position_vertical == "bottom") 283 { 284 this.bar_config['position'] = 'fixed'; 285 this.bar_config['bottom'] = '0'; 286 this.showagain_config.bottom = '0'; 287 } 288 if(this.settings.notify_position_horizontal == "left") 289 { 290 this.showagain_config.left =showagain_x_pos; 291 }else if(this.settings.notify_position_horizontal == "right") 292 { 293 this.showagain_config.right =showagain_x_pos; 294 } 295 } 296 this.showagain_elm.css(this.showagain_config); 297 }, 298 configBar:function() 299 { 300 this.bar_config = { 301 'background-color':this.settings.background, 302 'color':this.settings.text, 303 'font-family':this.settings.font_family 304 }; 305 if(this.settings.notify_position_vertical=="top") 306 { 307 this.bar_config['top'] = '0'; 308 if(this.settings.header_fix === true) 309 { 310 this.bar_config['position'] = 'fixed'; 311 } 312 }else 313 { 314 this.bar_config['bottom'] = '0'; 315 } 316 this.configShowAgain(); 317 this.bar_elm.css(this.bar_config).hide(); 318 }, 319 l1hs:function(str) 320 { 321 if (str.charAt(0) == "#") { 322 str = str.substring(1, str.length); 323 } else { 324 return "#" + str; 325 } 326 return this.l1hs(str); 327 }, 328 close_header:function() 329 { 330 CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'yes',CLI_ACCEPT_COOKIE_EXPIRE); 331 this.hideHeader(); 332 }, 333 accept_close:function() 334 { 335 this.hidePopupOverlay(); 336 CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'yes',CLI_ACCEPT_COOKIE_EXPIRE); 337 if(this.settings.notify_animate_hide) 338 { 339 this.bar_elm.slideUp(this.settings.animate_speed_hide); 340 }else 341 { 342 this.bar_elm.hide(); 343 } 344 if(this.settings.showagain_tab) 345 { 346 this.showagain_elm.slideDown(this.settings.animate_speed_show); 347 } 348 if(this.settings.accept_close_reload === true) 349 { 350 this.reload_current_page(); 351 } 352 return false; 353 }, 354 reject_close:function() 355 { 356 this.hidePopupOverlay(); 357 for(var k in Cli_Data.nn_cookie_ids) 358 { 359 CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]); 360 } 361 CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'no',CLI_ACCEPT_COOKIE_EXPIRE); 362 if(this.settings.notify_animate_hide) 363 { 364 this.bar_elm.slideUp(this.settings.animate_speed_hide); 365 } else 366 { 367 this.bar_elm.hide(); 368 } 369 if(this.settings.showagain_tab) 370 { 371 this.showagain_elm.slideDown(this.settings.animate_speed_show); 372 } 373 if(this.settings.reject_close_reload === true) 374 { 375 this.reload_current_page(); 376 } 377 return false; 378 }, 379 reload_current_page:function() 380 { 381 if(typeof cli_flush_cache!=='undefined' && cli_flush_cache==1) 382 { 383 window.location.href=this.add_clear_cache_url_query(); 384 }else 385 { 386 window.location.reload(true); 387 } 388 }, 389 add_clear_cache_url_query:function() 390 { 391 var cli_rand=new Date().getTime()/1000; 392 var cli_url=window.location.href; 393 var cli_hash_arr=cli_url.split('#'); 394 var cli_urlparts= cli_hash_arr[0].split('?'); 395 if(cli_urlparts.length>=2) 396 { 397 var cli_url_arr=cli_urlparts[1].split('&'); 398 cli_url_temp_arr=new Array(); 399 for(var cli_i=0; cli_i<cli_url_arr.length; cli_i++) 400 { 401 var cli_temp_url_arr=cli_url_arr[cli_i].split('='); 402 if(cli_temp_url_arr[0]=='cli_action') 403 { 404 405 }else 406 { 407 cli_url_temp_arr.push(cli_url_arr[cli_i]); 408 } 409 } 410 cli_urlparts[1]=cli_url_temp_arr.join('&'); 411 cli_url=cli_urlparts.join('?')+(cli_url_temp_arr.length>0 ? '&': '')+'cli_action='; 412 }else 413 { 414 cli_url=cli_hash_arr[0]+'?cli_action='; 415 } 416 cli_url+=cli_rand; 417 if(cli_hash_arr.length>1) 418 { 419 cli_url+='#'+cli_hash_arr[1]; 420 } 421 return cli_url; 422 }, 423 closeOnScroll:function() 424 { 425 if(window.pageYOffset > 100 && !CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)) 426 { 427 CLI.accept_close(); 428 if(CLI.settings.scroll_close_reload === true) 429 { 430 window.location.reload(); 431 } 432 window.removeEventListener("scroll",CLI.closeOnScroll,false); 433 } 434 }, 435 displayHeader:function() 436 { 437 if(this.settings.notify_animate_show) 438 { 439 this.bar_elm.slideDown(this.settings.animate_speed_show); 440 }else 441 { 442 this.bar_elm.show(); 443 } 444 this.showagain_elm.hide(); 445 if(CLI_COOKIEBAR_AS_POPUP) 446 { 447 this.showPopupOverlay(); 448 } 449 }, 450 hideHeader:function() 451 { 452 if(this.settings.showagain_tab) 453 { 454 if(this.settings.notify_animate_show) 455 { 456 this.showagain_elm.slideDown(this.settings.animate_speed_show); 457 } else { 458 this.showagain_elm.show(); 459 } 460 }else 461 { 462 this.showagain_elm.hide(); 463 } 464 this.bar_elm.slideUp(this.settings.animate_speed_show); 465 this.hidePopupOverlay(); 466 }, 467 hidePopupOverlay:function() 468 { 469 jQuery('body').removeClass("cli-barmodal-open"); 470 jQuery(".cli-popupbar-overlay").removeClass("cli-show"); 471 }, 472 showPopupOverlay:function() 473 { 474 if(this.settings.popup_overlay) 475 { 476 jQuery('body').addClass("cli-barmodal-open"); 477 jQuery(".cli-popupbar-overlay").addClass("cli-show"); 478 } 479 }, 480 barAsWidget:function(a) 481 { 482 var cli_elm=this.bar_elm; 483 var cli_win=jQuery(window); 484 var cli_winh=cli_win.height()-40; 485 var cli_winw=cli_win.width(); 486 var cli_defw=cli_winw>400 ? 300 : cli_winw-30; 487 cli_elm.css({ 488 'width':cli_defw,'height':'auto','max-height':cli_winh,'padding':'25px 15px','overflow':'auto','position':'fixed','box-sizing':'border-box' 489 }); 490 if(this.settings.widget_position=='left') 491 { 492 cli_elm.css({ 493 'left':'15px','right':'auto','bottom':'15px','top':'auto' 494 });
495 }else 496 { 497 cli_elm.css({ 498 'left':'auto','right':'15px','bottom':'15px','top':'auto' 499 }); 500 } 501 if(a) 502 { 503 this.setResize(); 504 } 505 }, 506 barAsPopUp:function(a) 507 { 508 if(typeof cookie_law_info_bar_as_popup==='function') 509 { 510 return false; 511 } 512 var cli_elm=this.bar_elm; 513 var cli_win=jQuery(window); 514 var cli_winh=cli_win.height()-40; 515 var cli_winw=cli_win.width(); 516 var cli_defw=cli_winw>700 ? 500 : cli_winw-20; 517 518 cli_elm.css({ 519 'width':cli_defw,'height':'auto','max-height':cli_winh,'bottom':'','top':'50%','left':'50%','margin-left':(cli_defw/2)*-1,'margin-top':'-100px','padding':'25px 15px','overflow':'auto' 520 }).addClass('cli-bar-popup cli-modal-content'); 521 522 523 cli_h=cli_elm.height(); 524 li_h=cli_h<200 ? 200 : cli_h; 525 cli_elm.css({'top':'50%','margin-top':((cli_h/2)+30)*-1}); 526 setTimeout(function(){ 527 cli_elm.css({ 528 'bottom':'' 529 }); 530 },100); 531 if(a) 532 { 533 this.setResize(); 534 } 535 }, 536 setResize:function() 537 { 538 var resizeTmr=null; 539 jQuery(window).resize(function() { 540 clearTimeout(resizeTmr); 541 resizeTmr=setTimeout(function() 542 { 543 if(CLI_COOKIEBAR_AS_POPUP) 544 { 545 CLI.barAsPopUp(); 546 } 547 if(CLI.settings.cookie_bar_as=='widget') 548 { 549 CLI.barAsWidget(); 550 } 551 CLI.configShowAgain(); 552 },500); 553 }); 554 } 555} 556jQuery(document).ready(function() { 557 if(typeof cli_cookiebar_settings!='undefined') 558 { 559 CLI.set({ 560 settings:cli_cookiebar_settings 561 }); 562 } 563});
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.