1jQuery(document).ready(function($) { 2 3 $(document).foundation(); 4 5 /** Accessibility Cookie **/ 6 function createCookie(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 } 15 16 function readCookie(name) { 17 var nameEQ = name + "="; 18 var ca = document.cookie.split(';'); 19 for (var i = 0; i < ca.length; i++) { 20 var c = ca[i]; 21 while (c.charAt(0) == ' ') c = c.substring(1, c.length); 22 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); 23 } 24 return null; 25 } 26 27 function eraseCookie(name) { 28 createCookie(name, ""); 29 } 30 31 /** Accessibility Widget **/ 32 // var tmp_link = $('#tmp-link').attr('data-link'); 33 var lc = "css/a11y-contrast.css"; 34 var ld = "css/a11y-desaturate.css"; 35 var lf = "css/a11y-fontsize.css"; 36 37 if (readCookie('a11y-high-contrast')) { 38 $('body').addClass('contrast'); 39 $('head').append($("<link id='highContrastStylesheet' rel='stylesheet' type='text/css' href="+lc+" >")); 40 $('#accessibility-contrast').attr('aria-checked', true).addClass('active'); 41 }; 42 43 $('.toggle-contrast').on('click', function () { 44 if (!$(this).hasClass('active')) { 45 $('body').addClass('contrast'); 46 $('head').append($("<link id='highContrastStylesheet' rel='stylesheet' type='text/css' href="+lc+" >")); 47 $(this).attr('aria-checked', true).addClass('active'); 48 createCookie('a11y-high-contrast', '1'); 49 return false; 50 } else { 51 $('#highContrastStylesheet').remove(); 52 $('body').removeClass('contrast'); 53 $(this).removeAttr('aria-checked').removeClass('active'); 54 eraseCookie('a11y-high-contrast'); 55 return false; 56 } 57 }); 58 59 if (readCookie('a11y-desaturated')) { 60 $('body').addClass('desaturated'); 61 $('head').append($("<link id='desaturateStylesheet' rel='stylesheet' type='text/css' href="+ld+" >")); 62 $('#accessibility-grayscale').attr('aria-checked', true).addClass('active'); 63 }; 64 65 $('.toggle-grayscale').on('click', function () { 66 if (!$(this).hasClass('active')) { 67 $('head').append($("<link id='desaturateStylesheet' rel='stylesheet' type='text/css' href="+ld+" >")); 68 $('body').addClass('desaturated'); 69 $(this).attr('aria-checked', true).addClass('active'); 70 createCookie('a11y-desaturated', '1'); 71 return false; 72 } else { 73 $('#desaturateStylesheet').remove(); 74 $('body').removeClass('desaturated'); 75 $(this).removeAttr('aria-checked').removeClass('active'); 76 eraseCookie('a11y-desaturated'); 77 return false; 78 } 79 }); 80 81 82 /** Back to Top **/ 83 var offset = 220; 84 var duration = 500; 85 $(window).scroll(function() { 86 if ($(this).scrollTop() > offset) { 87 $('#back-to-top').fadeIn(duration); 88 } else { 89 $('#back-to-top').fadeOut(duration); 90 } 91 }); 92 93 $('#back-to-top').click(function(event) { 94 event.preventDefault(); 95 $('html, body').animate({scrollTop: 0}, duration); 96 return false; 97 }); 98 99 var a = $('#main-content').position().top; 100 b = $('.sticky').height(); 101 c = a-b; 102 $('#stc').click(function(event) { 103 event.preventDefault(); 104 $('html, body').animate({scrollTop:c}, duration); 105 return false; 106 }); 107 108 var d = $('#gwt-standard-footer').position().top; 109 $('#stf').click(function(event) { 110 event.preventDefault(); 111 $('html, body').animate({scrollTop:d}, duration); 112 return false; 113 }); 114 115 116});
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.