home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 2000 April
/
VPR0004A.BIN
/
OLS
/
CSSH102
/
CSSH102.LZH
/
csshtml
/
validateh.mac
< prev
Wrap
Text File
|
1999-12-20
|
6KB
|
201 lines
////////////////////////////////////////////////////////////
// validateh.mac
// Toshiyuki Akutsu <locrian@mbd.sphere.ne.jp>
// Mon, 20 Dec 1999 21:30:54
////////////////////////////////////////////////////////////
openreg "CURRENTUSER", "Software\\Hidemaruo\\Hidemaru\\Env";
if( ! result ) endmacro;
$__macroPath = getregstr( "MacroPath" );
closereg;
if( $__macroPath == "" ) $__macroPath = hidemarudir;
if( rightstr( $__macroPath, 1 ) != "\\" ) $__macroPath = $__macroPath + "\\";
$__INI = $__macroPath + "csshtml\\csshtml.ini";
////////////////////////////////////////////////////////////
writeininum $__INI,"SUBMACRO","SUCCESS",0;
#__INTERVAL = getininum($__INI,"CSSHTML","__INTERVAL");
#__NAMEMAX = getininum($__INI,"CSSHTML","__NAMEMAX");
#__DQUOT = getininum($__INI,"CSSHTML","__DQUOT");
#__PRE = getininum($__INI,"CSSHTML","__PRE");
#__CR = getininum($__INI,"CSSHTML","__CR");
#__ANCHOR = getininum($__INI,"CSSHTML","__ANCHOR");
$__TIME = getinistr($__INI,"CSSHTML","__TIME");
if( #__DQUOT ) $__Q = "\"";
else $__Q = "'";
////////////////////////////////////////////////////////////
disableinvert; disabledraw;
escape;
title "1/16 &"; replaceallfast "&", "&";
title "2/16 <"; replaceallfast "<", "<";
title "3/16 >"; replaceallfast ">", ">";
title "4/16 ""; replaceallfast "\"", """;
if( #__CR ){
title "5/16 cr";
$$tmp = "<SPAN CLASS="+ $__Q + "h200" + $__Q + ">";
replaceallfast "\\n", $$tmp + "↓</SPAN>\\n", regular;
replaceallfast "</SPAN>\\n" + $$tmp, "\\n", regular;
}
if( #__ANCHOR ) call insertAnchorAndIndex;
if( #__PRE == 0 ){
title "11/16 <br>";
replaceallfast "\\n", "<BR>\\n", regular;
}
title "12/16 url";
$$sb = "‰℃" + $__TIME + "h11℃‰\\f[^‰]+\\f‰℃" + $__TIME + "/SPAN℃‰";
$$rb = "<A HREF=" + $__Q + "\\1" + $__Q + " CLASS=" + $__Q + "h11" + $__Q + ">\\1</A>";
replaceallfast $$sb, $$rb, regular;
title "13/16 mailto";
$$sb = "‰℃" + $__TIME + "h12℃‰\\f[^‰]+\\f‰℃" + $__TIME + "/SPAN℃‰";
$$rb = "<A HREF="+ $__Q + "mailto:\\1" + $__Q +" CLASS="+ $__Q +"h12"+ $__Q+">\\1</A>";
replaceallfast $$sb, $$rb, regular;
//残りの全てを有効にする。
title "14/16 validate 1";
$$sb = "‰℃" + $__TIME + "\\fh[0-9][0-9]\\f℃‰";
$$rb = "<SPAN CLASS=" + $__Q + "\\1" + $__Q + ">";
replaceallfast $$sb, $$rb, regular;
title "15/16 validate 2";
replaceallfast "‰℃" + $__TIME + "/SPAN℃‰", "</SPAN>", casesense;
//後は、ボディ。
title "wait a moment...";
gofileend;
if( #__PRE ) insert "\n</PRE>";
insert "\n</BODY>\n</HTML>\n";
gofiletop;
insert "\n<HTML>\n<HEAD>\n";
$$tmp = getinistr($__INI,"CSSHTML","GENERATOR");
insert " " + $$tmp + "\n";
insert " <TITLE>" + leftstr(basename2,strlen(basename2)-4) + "</TITLE>\n";
// STYLE
insert " <STYLE TYPE=" + $__Q + "TEXT/CSS" + $__Q + ">\n<!--\n";
$$tmp = getinistr($__INI,"CLIENTFILE","BODY_STYLE");
insert $$tmp + "\n"; //BODY{ }
insert "/* フォント指定が無効なブラウザの場合、font-family:\"???\";を削除して下さい。*/\n";
if( #__CR ){
$$tmp = getinistr($__INI,"CLIENTFILE","RCOLOR");
insert ".h200{ color:#" + $$tmp + " }\n";
}
##cx = x; ##cy = y;
##size = getininum($__INI,"ALL_HILIGHT_CLASS","SIZE");
##i = 0;
while( ##i < ##size ){
$$num = str(##i);
$$class = getinistr($__INI,"ALL_HILIGHT_CLASS",$$num);
$$buf = " CLASS=" + $__Q + $$class + $__Q + ">";
searchdown $$buf, casesense;
if( result ){
escape; moveto ##cx, ##cy;
$$name = getinistr($__INI,"ALL_HILIGHT_NAME",$$num);
insert "." + $$class + "{ } /* " + $$name + " */\n";
##cx = x; ##cy = y;
gofiletop;
}
##i = ##i + 1;
}
moveto ##cx, ##cy;
insert "\n-->\n </STYLE>\n</HEAD>\n";
// END STYLE
insert "<BODY>\n";
if( #__PRE ) insert "<PRE>\n";
gofiletop;
clearcliphist; setclipboard "";
title 0;
writeininum $__INI,"SUBMACRO","SUCCESS",1;
endmacro;
// End of validateh.mac
////////////////////////////////////////////////////////////
insertAnchorAndIndex:
//<A NAME=""></A>を前に挿入
##num[0] = -1; ##num[1] = -1; ##num[2] = -1; ##num[3] = -1;
$$H[0] = "h06"; $$H[1] = "h09"; $$H[2] = "h05"; $$H[3] = "h08";
$$sH = "h0[";
if( #__ANCHOR & 0x01 ) $$sH = $$sH + "6";
if( #__ANCHOR & 0x02 ) $$sH = $$sH + "9";
if( #__ANCHOR & 0x04 ) $$sH = $$sH + "5";
if( #__ANCHOR & 0x08 ) $$sH = $$sH + "8";
$$sH = $$sH + "]";
$$sb = "‰℃" + $__TIME + $$sH + "℃‰";
$$ancr = $__Q + "></A>"; //全共通
##i = 0;
while( ##i < 4 ){
$$ancl[##i] = "<A NAME=" + $__Q + $$H[##i] + "A";
$$ahref[##i] = "<A HREF=" + $__Q + "#" + $$H[##i] + "A";
$$class[##i] = $__Q + " CLASS=" + $__Q + $$H[##i] + $__Q + ">";
##i = ##i + 1;
}
gofileend; $$eof = "/" + str(lineno) + " anchor";
##tickcount = tickcount + 500;
gofiletop; insertfix "\n"; // ★(1)
setclipboard "";
##h = 0;
searchdown $$sb, regular;
while( result )
{
##ancx = seltopx; ##ancy = seltopy;
##namex = selendx; ##namey = selendy;
escape;
right 17;
if( code == '6' ) ##h = 0;
else if( code == '9' ) ##h = 1;
else if( code == '5' ) ##h = 2;
else ##h = 3;
moveto ##namex, ##namey;
##i = 0;
while( ##i < #__NAMEMAX ){
right;
if( code != 0x81F1 ) ##i = ##i + 1;
else break;
}
$$name = gettext( ##namex, ##namey, x, y );
##num[##h] = ##num[##h] + 1;
$$num = rightstr("000"+str(##num[##h]),4);
addclipboard $$ahref[##h] + $$num + $$class[##h] + $$name + "</A>\n";
moveto ##ancx, ##ancy;
insert $$ancl[##h] + $$num + $$ancr;
if( tickcount > ##tickcount ){
title str(lineno) + $$eof;
##tickcount = tickcount + #__INTERVAL;
}
finddown;
}
title "10/16 index";
$__MK = "‰℃‰℃" + $__TIME + "InDeXeNd℃‰℃‰";
addclipboard $__MK;
gofiletop; paste;
// PasteCursorFix == 0 にしてある。
gofiletop; right;
searchup "^" + $__MK, regular;
if( ! result ){
gofiletop;
insertfix "<HR>\n";
searchdown "^" + $__MK, regular;
if( result ){ delete; insert "<HR><!-- END OF INDEX -->"; }
}else{
delete; delete;
}
return;
// end insertAnchorAndIndex
////////////////////////////////////////////////////////////