1function sogo_change_font_cookie(increase){ 2 var storeVal = readCookie('sogo_font_increase'); 3 if (storeVal && storeVal == increase) { 4 return false; 5 } 6 createCookie('sogo_font_increase', increase, 365); 7 location.reload(); 8} 9 10function sogo_change_fonts(container) { 11 var increase = readCookie('sogo_font_increase'); 12 13 if(increase){ 14 $('p,span,a,h1,h2,h3,h4,h5,h6,td,th,label,.dataTables_info', container || 'body').each(function () { 15 var element = $(this); 16 17 if (!element.hasClass('sogo_font-increased')) { 18 var fontsize = parseInt(element.css('font-size')) * increase; 19 20 element.css({ 21 'font-size': fontsize + "px" 22 }); 23 24 element.addClass('sogo_font-increased') 25 } 26 }); 27 } 28} 29 30function sogo_set_accessibility(){ 31 // remove link targets 32 $('a[target="_blank"]').removeAttr('target'); 33 34 35 // Thanks to WebAIM.org 36 if (document.location.hash && document.location.hash != '#') { 37 var anchorUponArrival = document.location.hash; 38 setTimeout(function () { 39 $(anchorUponArrival).scrollTo({duration: 1500}); 40 $(anchorUponArrival).focus(); 41 }, 100); 42 } 43} 44 45(function ($) { 46 'use strict'; 47 48 $(document).ready(function () { 49 var body = $('body'); 50 if (readCookie('sogo_accessibility')) { 51 body.addClass('sogo_accessibility'); 52 } 53 if (readCookie('sogo_bnc')) { 54 body.addClass('sogo_blank_white'); 55 } 56 if (readCookie('sogo_sogo_readable_font')) { 57 body.addClass('sogo_readable_font'); 58 } 59 if (readCookie('sogo_underline_links')) { 60 body.addClass('sogo_underline_links'); 61 } 62 if (readCookie('sogo_contrasts')) { 63 body.addClass('sogo_contrasts'); 64 var file = $('#contrasts').data('css'); 65 loadjscssfile(file, 'css', 'sogo_contrasts_css'); 66 } 67 if (readCookie('sogo_contrasts_white')) { 68 body.addClass('sogo_contrasts_white'); 69 var file = $('#contrasts_white').data('css'); 70 loadjscssfile(file, 'css','sogo_contrasts_css_white'); 71 } 72 if (readCookie('sogo_font_2')) { 73 body.addClass('sogo_font_2'); 74 } 75 if (readCookie('sogo_font_3')) { 76 body.addClass('sogo_font_3'); 77 } 78 sogo_change_fonts(); 79 80 // open socgoacc 81 $('.toggle_sogoacc').click(function () { 82 $('#sogoacc').slideToggle(); 83 body.addClass('sogo_accessibility'); 84 }); 85 86 $('a[href="#sogo_access_statement"]').click(function(e){ 87 $('#sogo_access_statement').show(); 88 $('#sogo_overlay').show(); 89 }); 90 $('#close_sogo_access_statement').click(function(){ 91 $('#sogo_access_statement').hide(); 92 $('#sogo_overlay').hide(); 93 }); 94 95 $('#sogo_accessibility').click(function () { 96 eraseSogoCookie(); 97 location.reload(true); 98 return false; 99 100 101 // if (body.hasClass('sogo_accessibility')) { 102 // eraseSogoCookie(); 103 // console.log('erased'); 104 105 // location.reload(); 106 // return false; 107 // } 108 }); 109 110 $('#b_n_c').click(function () { 111 if (body.hasClass('sogo_blank_white')) { 112 eraseCookie('sogo_bnc'); 113 } else { 114 createCookie('sogo_bnc', 'true', 365); 115 } 116 body.toggleClass('sogo_blank_white'); 117 $('#sogoacc').slideUp(); 118 119 }); 120 121 122 123 $('#contrasts').click(function () { 124 var id = $('#sogo_contrasts_css'); 125 if (id.length > 0) { 126 eraseCookie('sogo_contrasts'); 127 id.remove(); 128 } else { 129 createCookie('sogo_contrasts', 'true', 365); 130 var file = $(this).data('css'); 131 loadjscssfile(file, 'css','sogo_contrasts_css'); 132 } 133 body.toggleClass('sogo_contrasts');
134 $('#sogoacc').slideUp(); 135 }); 136 137 $('#contrasts_white').click(function () { 138 var id = $('#sogo_contrasts_css_white'); 139 if (id.length > 0) { 140 eraseCookie('sogo_contrasts_white'); 141 id.remove(); 142 } else { 143 createCookie('sogo_contrasts_white', 'true', 365); 144 var file = $(this).data('css'); 145 loadjscssfile(file, 'css','sogo_contrasts_css_white'); 146 } 147 body.toggleClass('sogo_contrasts_white'); 148 $('#sogoacc').slideUp(); 149 }); 150 $('#animation_off').click(function () { 151 if (body.hasClass('sogo_blank_white')) { 152 eraseCookie('sogo_animation_off'); 153 } else { 154 createCookie('sogo_animation_off', 'true', 365); 155 } 156 body.toggleClass('sogo_animation_off'); 157 $('#sogoacc').slideUp(); 158 }); 159 160 $('#readable_font').click(function () { 161 if (body.hasClass('sogo_readable_font')) { 162 eraseCookie('sogo_readable_font'); 163 } else { 164 createCookie('sogo_readable_font', 'true', 365); 165 } 166 body.toggleClass('sogo_readable_font'); 167 $('#sogoacc').slideUp(); 168 }); 169 $('#underline_links').click(function () { 170 if (body.hasClass('sogo_underline_links')) { 171 eraseCookie('sogo_underline_links'); 172 } else { 173 createCookie('sogo_underline_links', 'true', 365); 174 } 175 body.toggleClass('sogo_underline_links'); 176 $('#sogoacc').slideUp(); 177 }); 178 179 180 181 182 $('#sogo_a1').click(function () { 183 eraseCookie('sogo_font_increase'); 184 eraseCookie('sogo_font_2'); 185 eraseCookie('sogo_font_3'); 186 location.reload(); 187 }); 188 189 $('#sogo_a2').click(function () { 190 createCookie('sogo_font_2', 'true', 365); 191 eraseCookie('sogo_font_3'); 192 sogo_change_font_cookie($(this).data('size')); 193 194 }); 195 196 $('#sogo_a3').click(function () { 197 createCookie('sogo_font_3', 'true', 365); 198 eraseCookie('sogo_font_2'); 199 sogo_change_font_cookie($(this).data('size')); 200 }); 201 }); 202 203 $(window).load(function(){ 204 // set image alt 205 $("img").each(function () { 206 var img = $(this); 207 if (!img.attr("alt") || img.attr("alt") == "") 208 img.attr("alt", " "); 209 }); 210 }); 211})(jQuery); 212 213 214// load file js/css via js 215function loadjscssfile(filename, filetype, id ) { 216 if (filetype == "js") { //if filename is a external JavaScript file 217 // alert('called'); 218 var fileref = document.createElement('script') 219 fileref.setAttribute("type", "text/javascript") 220 fileref.setAttribute("src", filename) 221 } 222 else if (filetype == "css") { //if filename is an external CSS file 223 var fileref = document.createElement("link") 224 fileref.setAttribute("id", id) 225 fileref.setAttribute("rel", "stylesheet") 226 fileref.setAttribute("type", "text/css") 227 fileref.setAttribute("href", filename) 228 } 229 if (typeof fileref != "undefined") 230 document.getElementsByTagName("head")[0].appendChild(fileref) 231} 232 233function createCookie(name, value, days) { 234 if (days) { 235 var date = new Date(); 236 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 237 var expires = "; expires=" + date.toGMTString(); 238 } else 239 var expires = ""; 240 document.cookie = name + "=" + value + expires + "; path=/"; 241} 242 243function readCookie(name) { 244 var nameEQ = name + "="; 245 var ca = document.cookie.split(';'); 246 for (var i = 0; i < ca.length; i++) { 247 var c = ca[i]; 248 while (c.charAt(0) == ' ') c = c.substring(1, c.length); 249 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); 250 } 251 return null; 252} 253function eraseSogoCookie( ) { 254 var nameEQ = name + "="; 255 var ca = document.cookie.split(';'); 256 for (var i = 0; i < ca.length; i++) { 257 var c = ca[i]; 258 if(c.indexOf('sogo') > 0){ 259 var e = c.indexOf('='); 260 eraseCookie(c.substring(0,e)); 261 } 262 } 263 return null; 264}
265function eraseCookie(name) { 266 // createCookie(name, "", -1); 267 createCookie(name, ""); 268}
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.