home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 April / VPR0004A.BIN / OLS / CSSH102 / CSSH102.LZH / csshtml / validateh.mac < prev   
Text File  |  1999-12-20  |  6KB  |  201 lines

  1. ////////////////////////////////////////////////////////////
  2. // validateh.mac
  3. // Toshiyuki Akutsu <locrian@mbd.sphere.ne.jp>
  4. // Mon, 20 Dec 1999 21:30:54
  5. ////////////////////////////////////////////////////////////
  6.     openreg "CURRENTUSER", "Software\\Hidemaruo\\Hidemaru\\Env";
  7.     if( ! result ) endmacro;
  8.     $__macroPath = getregstr( "MacroPath" );
  9.     closereg;
  10.     if( $__macroPath == "" ) $__macroPath = hidemarudir;
  11.     if( rightstr( $__macroPath, 1 ) != "\\" ) $__macroPath = $__macroPath + "\\";
  12.     $__INI = $__macroPath + "csshtml\\csshtml.ini";
  13. ////////////////////////////////////////////////////////////
  14.     writeininum $__INI,"SUBMACRO","SUCCESS",0;
  15.  
  16.     #__INTERVAL = getininum($__INI,"CSSHTML","__INTERVAL");
  17.     #__NAMEMAX = getininum($__INI,"CSSHTML","__NAMEMAX");
  18.     #__DQUOT = getininum($__INI,"CSSHTML","__DQUOT");
  19.  
  20.     #__PRE = getininum($__INI,"CSSHTML","__PRE");
  21.     #__CR = getininum($__INI,"CSSHTML","__CR");
  22.     #__ANCHOR = getininum($__INI,"CSSHTML","__ANCHOR");
  23.  
  24.     $__TIME = getinistr($__INI,"CSSHTML","__TIME");
  25.  
  26.     if( #__DQUOT ) $__Q = "\"";
  27.     else $__Q = "'";
  28. ////////////////////////////////////////////////////////////
  29.  
  30.     disableinvert; disabledraw;
  31.     escape;
  32. title "1/16 &"; replaceallfast "&", "&";
  33. title "2/16 <"; replaceallfast "<", "<";
  34. title "3/16 >"; replaceallfast ">", ">";
  35. title "4/16 ""; replaceallfast "\"", """;
  36.  
  37.     if( #__CR ){
  38. title "5/16 cr";
  39.         $$tmp = "<SPAN CLASS="+ $__Q + "h200" + $__Q + ">";
  40.         replaceallfast "\\n", $$tmp + "↓</SPAN>\\n", regular;
  41.         replaceallfast "</SPAN>\\n" + $$tmp, "\\n", regular;
  42.     }
  43.  
  44.     if( #__ANCHOR ) call insertAnchorAndIndex;
  45.  
  46.     if( #__PRE == 0 ){
  47. title "11/16 <br>";
  48.         replaceallfast "\\n", "<BR>\\n", regular;
  49.     }
  50.  
  51. title "12/16 url";
  52. $$sb = "‰℃" + $__TIME + "h11℃‰\\f[^‰]+\\f‰℃" + $__TIME + "/SPAN℃‰";
  53. $$rb = "<A HREF=" + $__Q + "\\1" + $__Q + " CLASS=" + $__Q + "h11" + $__Q + ">\\1</A>";
  54.     replaceallfast $$sb, $$rb, regular;
  55.  
  56. title "13/16 mailto";
  57. $$sb = "‰℃" + $__TIME + "h12℃‰\\f[^‰]+\\f‰℃" + $__TIME + "/SPAN℃‰";
  58. $$rb = "<A HREF="+ $__Q + "mailto:\\1" + $__Q +" CLASS="+ $__Q +"h12"+ $__Q+">\\1</A>";
  59.         replaceallfast $$sb, $$rb, regular;
  60.  
  61. //残りの全てを有効にする。
  62. title "14/16 validate 1";
  63.     $$sb = "‰℃" + $__TIME + "\\fh[0-9][0-9]\\f℃‰";
  64.     $$rb = "<SPAN CLASS=" + $__Q + "\\1" + $__Q + ">";
  65.     replaceallfast $$sb, $$rb, regular;
  66. title "15/16 validate 2";
  67.     replaceallfast "‰℃" + $__TIME + "/SPAN℃‰", "</SPAN>", casesense;
  68.  
  69. //後は、ボディ。
  70. title "wait a moment...";
  71.     gofileend;
  72.     if( #__PRE ) insert "\n</PRE>";
  73.     insert "\n</BODY>\n</HTML>\n";
  74.  
  75.     gofiletop;
  76.     insert "\n<HTML>\n<HEAD>\n";
  77.     $$tmp = getinistr($__INI,"CSSHTML","GENERATOR");
  78.     insert " " + $$tmp + "\n";
  79.     insert " <TITLE>" + leftstr(basename2,strlen(basename2)-4) + "</TITLE>\n";
  80.  
  81. // STYLE
  82.     insert " <STYLE TYPE=" + $__Q + "TEXT/CSS" + $__Q + ">\n<!--\n";
  83.     $$tmp = getinistr($__INI,"CLIENTFILE","BODY_STYLE");
  84.     insert $$tmp + "\n"; //BODY{ }
  85. insert "/* フォント指定が無効なブラウザの場合、font-family:\"???\";を削除して下さい。*/\n";
  86.  
  87.     if( #__CR ){
  88.         $$tmp = getinistr($__INI,"CLIENTFILE","RCOLOR");
  89.         insert ".h200{ color:#" + $$tmp + " }\n";
  90.     }
  91.  
  92.     ##cx = x; ##cy = y;
  93.     ##size = getininum($__INI,"ALL_HILIGHT_CLASS","SIZE");
  94.     ##i = 0;
  95.     while( ##i < ##size ){
  96.         $$num = str(##i);
  97.         $$class = getinistr($__INI,"ALL_HILIGHT_CLASS",$$num);
  98.         $$buf = " CLASS=" + $__Q + $$class + $__Q + ">";
  99.         searchdown $$buf, casesense;
  100.         if( result ){
  101.             escape; moveto ##cx, ##cy;
  102.             $$name = getinistr($__INI,"ALL_HILIGHT_NAME",$$num);
  103.             insert "." + $$class + "{ } /* " + $$name + " */\n";
  104.             ##cx = x; ##cy = y;
  105.             gofiletop;
  106.         }
  107.         ##i = ##i + 1;
  108.     }
  109.     moveto ##cx, ##cy;
  110.  
  111.     insert "\n-->\n </STYLE>\n</HEAD>\n";
  112. // END STYLE
  113.     insert "<BODY>\n";
  114.     if( #__PRE ) insert "<PRE>\n";
  115.     gofiletop;
  116.  
  117.     clearcliphist; setclipboard "";
  118.     title 0;
  119.     writeininum $__INI,"SUBMACRO","SUCCESS",1;
  120.  
  121. endmacro;
  122. // End of validateh.mac
  123. ////////////////////////////////////////////////////////////
  124. insertAnchorAndIndex:
  125.  
  126. //<A NAME=""></A>を前に挿入
  127.     ##num[0] = -1; ##num[1] = -1; ##num[2] = -1; ##num[3] = -1;
  128.     $$H[0] = "h06"; $$H[1] = "h09"; $$H[2] = "h05"; $$H[3] = "h08";
  129.     $$sH = "h0[";
  130.     if( #__ANCHOR & 0x01 ) $$sH = $$sH + "6";
  131.     if( #__ANCHOR & 0x02 ) $$sH = $$sH + "9";
  132.     if( #__ANCHOR & 0x04 ) $$sH = $$sH + "5";
  133.     if( #__ANCHOR & 0x08 ) $$sH = $$sH + "8";
  134.     $$sH = $$sH + "]";
  135.     $$sb = "‰℃" + $__TIME + $$sH + "℃‰";
  136.     $$ancr = $__Q + "></A>"; //全共通
  137.     ##i = 0;
  138.     while( ##i < 4 ){
  139.         $$ancl[##i] = "<A NAME=" + $__Q + $$H[##i] + "A";
  140.         $$ahref[##i] = "<A HREF=" + $__Q + "#" + $$H[##i] + "A";
  141.         $$class[##i] = $__Q + " CLASS=" + $__Q + $$H[##i] + $__Q + ">";
  142.         ##i = ##i + 1;
  143.     }
  144.     gofileend; $$eof = "/" + str(lineno) + " anchor";
  145.     ##tickcount = tickcount + 500;
  146.     gofiletop; insertfix "\n"; // ★(1)
  147.     setclipboard "";
  148.     ##h = 0;
  149.     searchdown $$sb, regular;
  150.     while( result )
  151.     {
  152.         ##ancx = seltopx; ##ancy = seltopy;
  153.         ##namex = selendx; ##namey = selendy;
  154.         escape;
  155.         right 17;
  156.         if( code == '6' ) ##h = 0;
  157.         else if( code == '9' ) ##h = 1;
  158.         else if( code == '5' ) ##h = 2;
  159.         else ##h = 3;
  160.  
  161.         moveto ##namex, ##namey;
  162.         ##i = 0;
  163.         while( ##i < #__NAMEMAX ){
  164.             right;
  165.             if( code != 0x81F1 ) ##i = ##i + 1;
  166.             else break;
  167.         }
  168.         $$name = gettext( ##namex, ##namey, x, y );
  169.         ##num[##h] = ##num[##h] + 1;
  170.         $$num = rightstr("000"+str(##num[##h]),4);
  171.         addclipboard $$ahref[##h] + $$num + $$class[##h] + $$name + "</A>\n";
  172.         moveto ##ancx, ##ancy;
  173.         insert $$ancl[##h] + $$num + $$ancr;
  174.         if( tickcount > ##tickcount ){
  175.             title str(lineno) + $$eof;
  176.             ##tickcount = tickcount + #__INTERVAL;
  177.         }
  178.         finddown;
  179.     }
  180.  
  181. title "10/16 index";
  182.  
  183.     $__MK = "‰℃‰℃" + $__TIME + "InDeXeNd℃‰℃‰";
  184.     addclipboard $__MK;
  185.     gofiletop; paste;
  186.     // PasteCursorFix == 0 にしてある。
  187.     gofiletop; right;
  188.     searchup "^" + $__MK, regular;
  189.     if( ! result ){
  190.         gofiletop;
  191.         insertfix "<HR>\n";
  192.         searchdown "^" + $__MK, regular;
  193.         if( result ){ delete; insert "<HR><!-- END OF INDEX -->"; }
  194.     }else{
  195.         delete; delete;
  196.     }
  197.  
  198. return;
  199. // end insertAnchorAndIndex
  200. ////////////////////////////////////////////////////////////
  201.