1// Styles Switcher 2jQuery(document).ready(function(){ 3 4 // Show Colors Panel 5 jQuery('#show-panel').click(function(){ 6 if(jQuery(this).hasClass('show-panel')) { 7 jQuery('.colors-switcher').css({'right': 0}); 8 jQuery('#show-panel').removeClass('show-panel'); 9 jQuery('#show-panel').addClass('hide-panel'); 10 }else if(jQuery(this).hasClass('hide-panel')) { 11 jQuery('.colors-switcher').css({'right': '-100px'}); 12 jQuery('#show-panel').removeClass('hide-panel'); 13 jQuery('#show-panel').addClass('show-panel'); 14 } 15 }); 16 17}); 18 19function setActiveStyleSheet(title) { 20 var i, a, main; 21 for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { 22 if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { 23 a.disabled = true; 24 if(a.getAttribute("title") == title) a.disabled = false; 25 } 26 } 27} 28 29function getActiveStyleSheet() { 30 var i, a; 31 for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { 32 if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title"); 33 } 34 return null; 35} 36 37function getPreferredStyleSheet() { 38 var i, a; 39 for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { 40 if(a.getAttribute("rel").indexOf("style") != -1 41 && a.getAttribute("rel").indexOf("alt") == -1 42 && a.getAttribute("title") 43 ) return a.getAttribute("title"); 44 } 45 return null; 46} 47 48function createCookie(name,value,days) { 49 if (days) { 50 var date = new Date(); 51 date.setTime(date.getTime()+(days*24*60*60*1000)); 52 var expires = "; expires="+date.toGMTString(); 53 } 54 else expires = ""; 55 document.cookie = name+"="+value+expires+"; path=/"; 56} 57 58function readCookie(name) { 59 var nameEQ = name + "="; 60 var ca = document.cookie.split(';'); 61 for(var i=0;i < ca.length;i++) { 62 var c = ca[i]; 63 while (c.charAt(0)==' ') c = c.substring(1,c.length); 64 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 65 } 66 return null; 67} 68 69window.onload = function(e) { 70 var cookie = readCookie("style"); 71 var title = cookie ? cookie : getPreferredStyleSheet(); 72 setActiveStyleSheet(title); 73} 74 75window.onunload = function(e) { 76 var title = getActiveStyleSheet(); 77 createCookie("style", title, 365); 78} 79 80var cookie = readCookie("style"); 81var title = cookie ? cookie : getPreferredStyleSheet(); 82setActiveStyleSheet(title); 83
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.