1function cli_show_cookiebar(p) { 2 /* plugin version 1.5.3 */ 3 var Cookie = { 4 set: function(name,value,days) { 5 if (days) { 6 var date = new Date(); 7 date.setTime(date.getTime()+(days*24*60*60*1000)); 8 var expires = "; expires="+date.toGMTString(); 9 } 10 else var expires = ""; 11 document.cookie = name+"="+value+expires+"; path=/"; 12 }, 13 read: function(name) { 14 var nameEQ = name + "="; 15 var ca = document.cookie.split(';'); 16 for(var i=0;i < ca.length;i++) { 17 var c = ca[i]; 18 while (c.charAt(0)==' ') { 19 c = c.substring(1,c.length); 20 } 21 if (c.indexOf(nameEQ) === 0) { 22 return c.substring(nameEQ.length,c.length); 23 } 24 } 25 return null; 26 }, 27 erase: function(name) { 28 this.set(name,"",-1); 29 }, 30 exists: function(name) { 31 return (this.read(name) !== null); 32 } 33 }; 34 35 var ACCEPT_COOKIE_NAME = 'viewed_cookie_policy', 36 ACCEPT_COOKIE_EXPIRE = 365, 37 json_payload = p.settings; 38 39 if (typeof JSON.parse !== "function") { 40 console.log("CookieLawInfo requires JSON.parse but your browser doesn't support it"); 41 return; 42 } 43 var settings = JSON.parse(json_payload); 44 45 var cached_header = jQuery(settings.notify_div_id), 46 cached_showagain_tab = jQuery(settings.showagain_div_id), 47 btn_accept = jQuery('#cookie_hdr_accept'), 48 btn_decline = jQuery('#cookie_hdr_decline'), 49 btn_moreinfo = jQuery('#cookie_hdr_moreinfo'), 50 btn_settings = jQuery('#cookie_hdr_settings'); 51 52 cached_header.hide(); 53 if ( !settings.showagain_tab ) { 54 cached_showagain_tab.hide(); 55 } 56 57 var hdr_args = { 58 'background-color': settings.background, 59 'color': settings.text, 60 'font-family': settings.font_family 61 }; 62 if ( settings.notify_position_vertical == "top" ) { 63 if ( settings.header_fix === true ) { 64 hdr_args['position'] = 'fixed'; 65 } 66 hdr_args['top'] = '0'; 67 } else { 68 hdr_args['bottom'] = '0'; 69 } 70 71 var showagain_args = { 72 'background-color': settings.background, 73 'color': l1hs(settings.text), 74 'position': 'fixed', 75 'font-family': settings.font_family 76 }; 77 if ( settings.border_on ) { 78 var border_to_hide = 'border-' + settings.notify_position_vertical; 79 showagain_args['border'] = '1px solid ' + l1hs(settings.border); 80 showagain_args[border_to_hide] = 'none'; 81 } 82 if ( settings.notify_position_vertical == "top" ) { 83 if ( settings.border_on ) { 84 hdr_args['border-bottom'] = '4px solid ' + l1hs(settings.border); 85 } 86 showagain_args.top = '0'; 87 } 88 else if ( settings.notify_position_vertical == "bottom" ) { 89 if ( settings.border_on ) { 90 hdr_args['border-top'] = '4px solid ' + l1hs(settings.border); 91 } 92 hdr_args['position'] = 'fixed'; 93 hdr_args['bottom'] = '0'; 94 showagain_args.bottom = '0'; 95 } 96 if ( settings.notify_position_horizontal == "left" ) { 97 showagain_args.left = settings.showagain_x_position; 98 } 99 else if ( settings.notify_position_horizontal == "right" ) { 100 showagain_args.right = settings.showagain_x_position; 101 } 102 cached_header.css( hdr_args ); 103 cached_showagain_tab.css( showagain_args ); 104 105 if (!Cookie.exists(ACCEPT_COOKIE_NAME)) { 106 displayHeader(); 107 } 108 else { 109 cached_header.hide(); 110 } 111 112 if ( settings.show_once_yn ) { 113 setTimeout(close_header, settings.show_once); 114 } 115 function close_header() { 116 Cookie.set(ACCEPT_COOKIE_NAME, 'yes', ACCEPT_COOKIE_EXPIRE); 117 hideHeader(); 118 } 119 120 var main_button = jQuery('.cli-plugin-main-button'); 121 main_button.css( 'color', settings.button_1_link_colour ); 122 123 if ( settings.button_1_as_button ) { 124 main_button.css('background-color', settings.button_1_button_colour); 125 126 main_button.hover(function() { 127 jQuery(this).css('background-color', settings.button_1_button_hover); 128 }, 129 function() { 130 jQuery(this).css('background-color', settings.button_1_button_colour); 131 }); 132 } 133 var main_link = jQuery('.cli-plugin-main-link'); 134 main_link.css( 'color', settings.button_2_link_colour ); 135 136 if ( settings.button_2_as_button ) { 137 main_link.css('background-color', settings.button_2_button_colour); 138 139 main_link.hover(function() { 140 jQuery(this).css('background-color', settings.button_2_button_hover); 141 }, 142 function() { 143 jQuery(this).css('background-color', settings.button_2_button_colour); 144 }); 145 } 146 147 cached_showagain_tab.click(function(e) { 148 e.preventDefault(); 149 cached_showagain_tab.slideUp(settings.animate_speed_hide, function slideShow() { 150 cached_header.slideDown(settings.animate_speed_show); 151 }); 152 }); 153 154 jQuery("#cookielawinfo-cookie-delete").click(function() { 155 Cookie.erase(ACCEPT_COOKIE_NAME); 156 return false;
157 }); 158 159 jQuery("#cookie_action_close_header").click(function(e) { 160 e.preventDefault(); 161 accept_close(); 162 }); 163 164 function accept_close() { 165 Cookie.set(ACCEPT_COOKIE_NAME, 'yes', ACCEPT_COOKIE_EXPIRE); 166 167 if (settings.notify_animate_hide) { 168 cached_header.slideUp(settings.animate_speed_hide); 169 } 170 else { 171 cached_header.hide(); 172 } 173 cached_showagain_tab.slideDown(settings.animate_speed_show); 174 return false; 175 } 176 177 function closeOnScroll() { 178 if (window.pageYOffset > 100 && !Cookie.read(ACCEPT_COOKIE_NAME)) { 179 accept_close(); 180 if (settings.scroll_close_reload === true) { 181 location.reload(); 182 } 183 window.removeEventListener("scroll", closeOnScroll, false); 184 } 185 } 186 if (settings.scroll_close === true) { 187 window.addEventListener("scroll", closeOnScroll, false); 188 } 189 190 function displayHeader() { 191 if (settings.notify_animate_show) { 192 cached_header.slideDown(settings.animate_speed_show); 193 } 194 else { 195 cached_header.show(); 196 } 197 cached_showagain_tab.hide(); 198 } 199 function hideHeader() { 200 if (settings.notify_animate_show) { 201 cached_showagain_tab.slideDown(settings.animate_speed_show); 202 } 203 else { 204 cached_showagain_tab.show(); 205 } 206 cached_header.slideUp(settings.animate_speed_show); 207 } 208}; 209function l1hs(str){if(str.charAt(0)=="#"){str=str.substring(1,str.length);}else{return "#"+str;}return l1hs(str);}
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.