1function setSheet(id, sheet) { 2 if (sheet === '') { 3 document.getElementById(id).removeAttribute('href'); 4 } else { 5 document.getElementById(id).setAttribute('href', sheet); 6 } 7} 8 9function createCookie(name, value, days) { 10 if (days) { 11 var date = new Date(); 12 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 13 var expires = '; expires=' + date.toGMTString(); 14 } else { 15 expires = ''; 16 } 17 document.cookie = name + '=' + value + expires + '; path=/'; 18} 19 20function readCookie(name) { 21 var nameEQ = name + '='; 22 var ca = document.cookie.split(';'); 23 for (var i = 0; i < ca.length; i++) { 24 var c = ca[i]; 25 while (c.charAt(0) == ' ') { 26 c = c.substring(1, c.length); 27 } 28 if (c.indexOf(nameEQ) == 0) { 29 return c.substring(nameEQ.length, c.length); 30 } 31 } 32 33 return null; 34} 35 36var colorSheets = ['', 'assets/templates/grad/css/cb.css']; 37 38var textSheets = ['', 'assets/templates/grad/css/text.css']; 39 40var linkSheets = ['', 'assets/templates/grad/css/link.css']; 41 42function setColor(index) { 43 setSheet('color', colorSheets[index]); 44} 45 46function setText(index) { 47 setSheet('text', textSheets[index]); 48} 49 50function setLink(index) { 51 setSheet('link', linkSheets[index]); 52} 53 54function toggleColor() { 55 var style = JSON.parse(readCookie('style')); 56 style['color'] = (style['color'] + 1) % colorSheets.length; 57 createCookie('style', JSON.stringify(style)); 58 setColor(style['color']); 59} 60 61function toggleText() { 62 var style = JSON.parse(readCookie('style')); 63 style['text'] = (style['text'] + 1) % textSheets.length; 64 createCookie('style', JSON.stringify(style)); 65 setText(style['text']); 66} 67 68function toggleLink() { 69 var style = JSON.parse(readCookie('style')); 70 style['link'] = (style['link'] + 1) % linkSheets.length; 71 createCookie('style', JSON.stringify(style)); 72 setLink(style['link']); 73} 74 75function initializeStyle() { 76 var cookie = readCookie('style'); 77 if (cookie == null) { 78 cookie = JSON.stringify({'color': 0, 'text': 0, 'link': 0}); 79 createCookie('style', cookie, 1); 80 } 81 var style = JSON.parse(cookie); 82 setColor(style['color']); 83 setText(style['text']); 84 setLink(style['link']); 85 86} 87 88initializeStyle(); 89 90// window.onload = function(e) { 91// initializeStyle(); 92// };
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.