1/* 2=========================================================== 3ãã©ã³ããµã¤ãºå¤æ´ã¹ã¯ãªããï¼ã¿ã¤ãCï¼ 4Last Updated:09/21/2001 5 6insomnia!Web Labo. 7http://www3.airnet.ne.jp/insomnia/ 8http://www3.airnet.ne.jp/insomnia/labo/fsc/fscC.html 9=========================================================== 10*/ 11 12/* 13========== ::: åæè¨å® ::: ========== 14*/ 15 16// å¤ã®åä½ãè¨å®ï¼å¿ ãããã«ã¯ãªã¼ããã¯ãªã¼ãã§æ¬ãï¼ 17var fontSizeUnit = "%"; 18 19// ä¸åã®æä½ã§å¤åãããå¤ãè¨å®ï¼ããã«ã¯ãªã¼ããã¯ãªã¼ãã§æ¬ããªãï¼ 20var perOrder = 20; 21 22// åæç¶æ ã®å¤ãè¨å®ï¼ããã«ã¯ãªã¼ããã¯ãªã¼ãã§æ¬ããªãï¼ 23var defaultSize = 62.5; 24 25// ã¯ããã¼ã®ååï¼å¿ ãããã«ã¯ãªã¼ããã¯ãªã¼ãã§æ¬ãï¼ 26var ckName = "ckfontsize"; 27 28// ã¯ããã¼ã®æå¹æéï¼æ¥ï¼ï¼ããã«ã¯ãªã¼ããã¯ãªã¼ãã§æ¬ããªãï¼ 29var ckDays = 2; 30 31// ã¯ããã¼ã®ãã¹ï¼å¿ ãããã«ã¯ãªã¼ããã¯ãªã¼ãã§æ¬ããæå®ãä¸è¦ã®å ´åã¯"/"ã«ããï¼ 32var ckPath = "/"; 33 34/* 35========== ::: ãã¼ã¸èªã¿è¾¼ã¿æã®å¤ãè¨å® ::: ========== 36*/ 37 38// ã¯ããã¼èªã¿åºã 39var fsCK = GetCookie( ckName ); 40 41if ( fsCK == null ){ 42 var currentSize = defaultSize; //ã¯ããã¼ãç¡ããã°ç¾å¨ã®å¤ãåæç¶æ ã®å¤ã«è¨å® 43} 44else{ 45 var currentSize = eval( fsCK ); //ã¯ããã¼ãããã°ç¾å¨ã®å¤ãã¯ããã¼ã®å¤ã«è¨å® 46 if(isNaN(currentSize)){ 47 currentSize = defaultSize; 48 } 49} 50 51/* 52========== ::: headå ã«styleè¦ç´ ãåºå ::: ========== 53*/ 54 55currentSize_h1 = currentSize + 50; 56currentSize_h2 = currentSize + 30; 57currentSize_h3 = currentSize + 20; 58currentSize_h4 = currentSize + 10; 59currentSize_h5 = currentSize; 60currentSize_t_h2 = currentSize + 20; 61currentSize_t_h3 = currentSize + 10; 62document.writeln( '<style type="text/css" media="screen,print,tv">' ); 63// document.write( 'body,th,td{font-size:' + currentSize + fontSizeUnit+ '}' ); 64document.write( 'html{font-size:' + currentSize + fontSizeUnit+ '}' ); 65document.write( 'h1{font-size:' + currentSize_h1 + fontSizeUnit+ '}' ); 66document.write( 'h2{font-size:' + currentSize_h2 + fontSizeUnit+ '}' ); 67document.write( 'h3{font-size:' + currentSize_h3 + fontSizeUnit+ '}' ); 68document.write( 'h4{font-size:' + currentSize_h4 + fontSizeUnit+ '}' ); 69document.write( 'h5,h6{font-size:' + currentSize_h5 + fontSizeUnit+ '}' ); 70document.write( '#mainmenu h2{font-size:' + currentSize_t_h2 + fontSizeUnit+ '}' ); 71document.write( '#mainmenu h3,#contentmenu h2,#contentmenu h3{font-size:' + currentSize_t_h3 + fontSizeUnit+ '}' ); 72document.writeln( '</style>' ); 73 74/*=================================== 75 [颿° fsc] 76 弿°CMDã«æ¸¡ãããå¤ã«å¿ã㦠77 夿´å¾ã®å¤ãç®åºãã¯ããã¼ã«æ¸ãè¾¼ãã 78====================================*/ 79 80function fsc( CMD ){ 81 // æ¡å¤§ï¼ç¾æç¹ã®å¤ã«ä¸åã®æä½ã§å¤åãããå¤ãå ãã¦æä½å¾ã®å¤"newSize"ã«ä»£å ¥ 82 if ( CMD == "larger" ){ 83 var newSize = Number( currentSize + perOrder ); 84 SetCookie( ckName , newSize ); //ã¯ããã¼æ¸ã込㿠85 } 86 87 // 縮å°ï¼ç¾æç¹ã®å¤ããä¸åã®æä½ã§å¤åãããå¤ãå¼ãæä½å¾ã®å¤ã«ä»£å ¥ 88 // ç¾æç¹ã®ãµã¤ãºã®å¤ãä¸åã®æä½ã§å¤åãããå¤ã¨åããªããã®ã¾ã¾æä½å¾ã®å¤ã«ä»£å ¥ 89 if ( CMD == "smaller" ){ 90 if ( currentSize != perOrder ){ 91 var newSize = Number( currentSize - perOrder ); 92 SetCookie( ckName , newSize ); //ã¯ããã¼æ¸ã込㿠93 } 94 else{ 95 var newSize = Number( currentSize ); 96 } 97 } 98 99 // å ã«æ»ãï¼æä½å¾ã®å¤ãåæå¤ã«ãã 100 if ( CMD == "default" ){ 101 DeleteCookie( ckName ); //ã¯ããã¼åé¤ 102 } 103 104 // ãã¼ã¸ã®åèªã¿è¾¼ã¿ 105 // åèªã¿è¾¼ã¿ããããã¨ã§å¤æ´å¾ã®å¤ãåæ ããstyleè¦ç´ ãåºåããã 106 location.reload(); 107} 108 109// _______________________________________ end of function fsc() ___ 110 111/*=================================== 112 [颿° SetCookie] 113 ã¯ããã¼ã«å¤ãæ¸ãè¾¼ã 114====================================*/ 115function SetCookie( name , value ){ 116 var dobj = new Date(); 117 dobj.setTime(dobj.getTime() + 24 * 60 * 60 * ckDays * 1000); 118 var expiryDate = dobj.toGMTString(); 119 document.cookie = name + '=' + escape(value) + ';expires=' + expiryDate + ';path=' + ckPath; 120 121} 122 123/*=================================== 124 [颿° GetCookie] 125 ã¯ããã¼ãåå¾ãã 126====================================*/ 127function GetCookie (name){ 128 var arg = name + "="; 129 var alen = arg.length; 130 var clen = document.cookie.length; 131 var i = 0; 132 while (i < clen){ 133 var j = i + alen; 134 if (document.cookie.substring(i, j) == arg) 135 return getCookieVal (j); 136 i = document.cookie.indexOf(" ", i) + 1; 137 if (i == 0) break; 138 } 139 return null; 140} 141 142/*=================================== 143 [颿° getCookieVal] 144 ã¯ããã¼ã®å¤ãæ½åºãã 145====================================*/ 146function getCookieVal (offset){ 147 var endstr = document.cookie.indexOf (";", offset); 148 if (endstr == -1) 149 endstr = document.cookie.length; 150 return unescape(document.cookie.substring(offset,endstr)); 151} 152 153/*=================================== 154 [颿° DeleteCookie] 155 ã¯ããã¼ãåé¤ãã 156====================================*/ 157function DeleteCookie(name){ 158 if (GetCookie(name)){ 159 document.cookie = name + '=' + 160 '; expires=Thu, 01-Jan-70 00:00:01 GMT;path='+ckPath; 161 } 162} 163 164/* FONTã¿ã°ã®ãµã¤ãºãªã©ãã¹ã¿ã¤ã«æå®ã«å¤æãã颿°ï¼convert_some_tag_to_styleï¼ã®å®ç¾© 165 * 2009.07.23 Netcrew N.I追è¨
166*/ 167function convert_some_tag_to_style(){ 168 var font_tags = document.getElementsByTagName('font'); 169 170 for(i=0,L=font_tags.length;i<L;i++){ 171 switch(font_tags[i].getAttribute("size")){ 172 case "+3": 173 font_tags[i].style.fontSize=currentSize_h1+fontSizeUnit; 174 break; 175 case "+2": 176 font_tags[i].style.fontSize=currentSize_h2+fontSizeUnit; 177 break; 178 case "+1": 179 font_tags[i].style.fontSize=currentSize_h3+fontSizeUnit; 180 break; 181 case "+0": 182 default: 183 break; 184 case "-1": 185 font_tags[i].style.fontSize=currentSize_h4+fontSizeUnit; 186 break; 187 case "-2": 188 font_tags[i].style.fontSize=currentSize_h5+fontSizeUnit; 189 break; 190 case "-3": 191 font_tags[i].style.fontSize=currentSize_h5+fontSizeUnit; 192 break; 193 } 194 font_tags[i].removeAttribute("size"); 195 } 196} 197 198 199window.onload = convert_some_tag_to_style; 200 201//EOF
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.