1/** 2* Styleswitch stylesheet switcher built on jQuery 3* Under an Attribution, Share Alike License 4* By Kelvin Luck ( http://www.kelvinluck.com/ ) 5**/ 6 7(function($) 8{ 9 $(document).ready(function() { 10 $('.styleswitch').click(function() 11 { 12 switchStylestyle(this.getAttribute("data-rel")); 13 return false; 14 }); 15 var c = readCookie('style'); 16 if (c) switchStylestyle(c); 17 }); 18 19 function switchStylestyle(styleName) 20 { 21 $('link[rel*=style][title]').each(function(i) 22 { 23 this.disabled = true; 24 if (this.getAttribute('title') == styleName) this.disabled = false; 25 }); 26 createCookie('style', styleName, 365); 27 } 28})(jQuery); 29// cookie functions http://www.quirksmode.org/js/cookies.html 30function createCookie(name,value,days) 31{ 32 if (days) 33 { 34 var date = new Date(); 35 date.setTime(date.getTime()+(days*24*60*60*1000)); 36 var expires = "; expires="+date.toGMTString(); 37 } 38 else var expires = ""; 39 document.cookie = name+"="+value+expires+"; path=/"; 40} 41function readCookie(name) 42{ 43 var nameEQ = name + "="; 44 var ca = document.cookie.split(';'); 45 for(var i=0;i < ca.length;i++) 46 { 47 var c = ca[i]; 48 while (c.charAt(0)==' ') c = c.substring(1,c.length); 49 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 50 } 51 return null; 52} 53function eraseCookie(name) 54{ 55 createCookie(name,"",-1); 56} 57// /cookie functions
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.