1 2 function setFontSize(fontSize) { 3 saveSettings('fontSize', fontSize); 4 $('html').removeClass('fs-small fs-normal fs-big').addClass(fontSize); 5 } 6 7 function setColorSite(color) { 8 saveSettings('color', color); 9 $('html').removeClass('color1 color2 color3 color4 color5').addClass(color); 10 } 11 12 function setFontFamily(fontFamily) { 13 saveSettings('fontFamily', fontFamily); 14 $('html').removeClass('serif sans-serif').addClass(fontFamily); 15 } 16 17 function setSpacing(letterSpace) { 18 saveSettings('letterSpace', letterSpace); 19 $('html').removeClass('spacing-normal spacing-big spacing-small').addClass(letterSpace); 20 } 21 22 function setImageVisible(showImgs) { 23 saveSettings('showImgs', showImgs); 24 $('html').removeClass('imagesoff imageson').addClass(showImgs); 25 $('.a-images a').attr('rel', (showImgs=='imagesoff')?'imageson':'imagesoff'); 26 } 27 28 function setNormal(normalVer) { 29 saveSettings('normalVer', normalVer); 30 $('html').removeClass('specialversion normalvesion').addClass(normalVer); 31 } 32 33 function setDefSpecialSettings() { 34 setColorSite('color1'); 35 setFontFamily('sans-serif'); 36 setFontSize('fs-normal'); 37 setSpacing('spacing-small'); 38 setNormal('specialversion'); 39 setImageVisible('imageson'); 40 } 41 42 function setNormalMode() { 43 setColorSite(def_settings.color); 44 setFontFamily(def_settings.fontFamily); 45 setFontSize(def_settings.fontSize); 46 setSpacing(def_settings.letterSpace); 47 setNormal(def_settings.normalVer); 48 setImageVisible(def_settings.showImgs); 49 } 50 51 function setUserSettings() { 52 var getSettings = { 53 color: $.cookie('color') || window.def_settings.color, 54 fontFamily: $.cookie('fontFamily') || window.def_settings.fontFamily, 55 fontSize: $.cookie('fontSize') || window.def_settings.fontSize, 56 letterSpace: $.cookie('letterSpace') || window.def_settings.letterSpace, 57 normalVer: $.cookie('normalVer') || window.def_settings.normalVer, 58 showImgs: $.cookie('showImgs') || window.def_settings.showImgs 59 }; 60 setColorSite(getSettings.color); 61 setFontFamily(getSettings.fontFamily); 62 setFontSize(getSettings.fontSize); 63 setSpacing(getSettings.letterSpace); 64 setNormal(getSettings.normalVer); 65 setImageVisible(getSettings.showImgs); 66 } 67 68 function saveSettings(name, value) { 69 $.cookie(name, value, { expires: 2*365, path: '/', secure: false }); 70 } 71 72 73$(document).ready(function(){ 74 window.def_settings = { 75 color: '', 76 fontFamily: '', 77 fontSize: '', 78 letterSpace: '', 79 normalVer: 'normalvesion', 80 showImgs: 'imageson' 81 }; 82 setUserSettings(); 83 84 $('.choose-font-family a').click(function(){ 85 setFontFamily($(this).data('set')); 86 return false; 87 }); 88 $('.choose-letter-spacing a').click(function(){ 89 setSpacing($(this).data('set')); 90 return false; 91 }); 92 $('.a-images a').click(function(){ 93 setImageVisible($(this).data('set')); 94 return false; 95 }); 96 97 $('.a-fontsize a').click(function(){ 98 setFontSize($(this).data('set')); 99 return false; 100 }); 101 $('.a-colors a, .choose-colors a').click(function(){ 102 setColorSite($(this).data('set')); 103 return false; 104 }); 105 106 $('.a-settings a,.saveit .closepopped').click(function(){ 107 $('.popped').slideToggle('fast'); 108 return false; 109 }); 110 111 $('.saveit .default, #specialversion').click(function(){ 112 setDefSpecialSettings(); 113 return false; 114 }); 115 116 $('#normalversion').click(function(){ 117 setNormalMode($(this).data('set')); 118 return false; 119 }); 120 121});
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.