home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 November
/
VPR9711A.ISO
/
VPR_DATA
/
Special
/
Koda202
/
koda202.lzh
/
kodama
/
htmlink.mac
< prev
next >
Wrap
Text File
|
1997-08-06
|
9KB
|
266 lines
//こだマクロ(HTML作成)
//htmlink.mac
//このマクロは「秀丸エディタ」用のマクロです。
//97080613
imglk:
title "リンク、イメージ - こだマクロ";
#menu = getininum ( hidemarudir + "\\htmini.txt" , "Link" , "defnum" );
#i = 0;
while ( #menu + 1 > #i ) {
$top[#i] = getinistr ( hidemarudir + "\\htmini.txt" , "Link" , "def" + str ( #i ) );
$menu[#i] = leftstr ( $top[#i] , strstr ( $top[#i] , ":" ) );
$command[#i] = rightstr ( $top[#i] , strlen ( $top[#i] ) - strstr ( $top[#i] , ":" ) - 1 );
#i = #i + 1;
}
menuarray $menu, #menu + 1;
if ( result == 0 ) endmacro;
else if ( $command[result-1] == "ah" ) call ahref;
else if ( $command[result-1] == "img" ) call image;
else if ( $command[result-1] == "name" ) call aname;
else if ( $command[result-1] == "clip" ) call clipmap;
endmacro;
clipmap:
title "クリッカブルマップ - こだマクロ";
$mapmsg2 = "マップにつかうイメージに名前がついてますか?";
question $mapmsg2;
if ( result == no ){
call img;
backspace;
backspace;
$mapmsg1 = "マップでつかうイメージに名前を付けてください。";
$mapname = input ( $mapmsg1 );
$out = $out + " USEMAP=\"#" + $mapname + "\">" + "\n";
}
$mapmsg3 = "マップに使うイメージの名前を指定してください。";
$mapname2 = input ( $mapmsg3 );
$out = $out + "<MAP NAME=\"" + $mapname2 + "\">" + "\n";
area:
title "領域 - こだマクロ";
$mapmsg4 = "領域の形状を指定してください。";
message $mapmsg4;
$keijyou1[0] = "(&Rect)四角";
$keijyou1[1] = "(&Circle)円";
$keijyou1[2] = "(&Polygon)多角形";
$keijyou1[3] = "(&Default)指定領域外";
$keijyou2[1] = "RECT";
$keijyou2[2] = "CIRCLE";
$keijyou2[3] = "POLYGON";
$keijyou2[4] = "DEFAULT";
menuarray $keijyou1,4;
#re = result;
$keijyou = $keijyou2[#re];
$mapmsg41 = "領域を示す座標を指定してください。";
$mapmsg42 = "イメージ左上隅を(0,0)にするピクセル値で始点と終点の";
$mapmsg43 = "2つに座標を,で区切ってx1,y1,x2,y2…の形で入力";
$mapmsg4 = $mapmsg41 + "\n" + $mapmsg42 + "\n" + $mapmsg43;
$zahyou = input ( $mapmsg4 );
call zenkaku $zahyou;
$zahyou = $$return;
$mapmsg51 = "リンクする先のURLを指定してください。";
$mapmsg52 = "(指定なし=どこにもリンクしない)";
$mapmsg5 = $mapmsg51 + "\n" + $mapmsg52;
$ink = input ( $mapmsg5 );
if ( $ink == "" ) $rinkusaki = " NOHREF";
else $rinkusaki = " HREF=\"" + $rinku + "\"";
$out = $out + "<area shape=\"" + $keijyou + "\" coords=\"";
insert $zahyou + "\"" + $rinkusaki + ">" + "\n";
question "指定領域をまだ指定しますか?";
if ( result == yes ) goto area;
else $out = $out + "</MAP>" + "\n";
return;
image:
title "イメージのロード - こだマクロ";
call img;
insert $$return;
return;
img:
$imsg11 = "(SRC指定したイメージが大きくロードに時間がかかる時指定)";
$imsg12 = "(GraphicImageが表示できないブラウザの場合に表示)";
$imsg[11] = "ロードするイメージファイルを指定";
$imsg[12] = "イメージの横幅をピクセル値または%値で指定";
$imsg[13] = "イメージの高さをピクセル値または%値で指定";
$imsg[14] = "イメージの外枠の幅をピクセル値で指定";
$imsg[15] = "イメージの左右に空ける空白をピクセル値で指定";
$imsg[16] = "イメージの上下に空ける空白をピクセル値で指定";
$imsg[17] = "先に表示されるイメージファイル" + $imsg11;
$imsg[18] = "イメージの代わりに表示するテキスト" + $imsg12;
$imsrc = input ( $imsg[11] );
if ( $imsrc == "" ) {
$mes90 = "イメージファイルを指定してください。" + "\n";
$mes91 = "止めるなら、ESCキーをおし続けてマクロを終了させて";
$mes92 = "\n" + "ください。";
message $mes90 + $mes91 + $mes92;
goto img;
}
$impos[0] = "イメージの最下部にテキストを表示(デフォルト)";
$impos[1] = "(&Top)イメージの最上部にテキストを表示";
$impos[2] = "(&Center)イメージの中央部にテキストを表示";
$impos[3] = "(&Right)イメージ左寄せ、右側に複数行のテキストを表示";
$impos[4] = "(&Left)イメージ右寄せ、左側に複数行のテキストを表示";
$impos2[1] = "";
$impos2[2] = "top";
$impos2[3] = "center";
$impos2[4] = "right";
$impos2[5] = "left";
menuarray $impos,5;
#re = result;
$imposi = $impos2[#re];
$imwid = input ( $imsg[12] );
call zenkaku $imwid;
$imwid = $$return;
$imhei = input ( $imsg[13] );
call zenkaku $imhei;
$imhei = $$return;
$imbor = input ( $imsg[14] );
call zenkaku $imbor;
$imbor = $$return;
$imh = input ( $imsg[15] );
call zenkaku $imh;
$imh = $$return;
$imv = input ( $imsg[16] );
call zenkaku $imv;
$imv = $$return;
$imlow = input ( $imsg[17] );
$imalt = input ( $imsg[18] );
$out="<IMG ";
if ( $imsrc == "" ) goto img;
$out = $out + "SRC=\"" + $imsrc +"\" ";
if ( $imwid == "" ) $out = $out + "";
else $out = $out + "WIDTH=\"" + $imwid + "\" ";
if ( $imposi == "" ) $out = $out + "";
else $out = $out + "ALIGN=\"" + $imposi + "\" ";
if ( $imhei == "" ) $out = $out + "";
else $out = $out + "HEIGHT=\"" + $imhei + "\" ";
if ( $imbor == "" ) $out = $out + "";
else $out = $out + "BORDER=\"" + $imbor + "\" ";
if ( $imh == "" ) $out = $out + "";
else $out = $out + "HSPACE=\"" + $imh + "\" ";
if ( $imv == "" ) $out = $out + "";
else $out = $out + "VSPACE=\"" + $imv + "\" ";
if ( $imlow == "" || $imlow == ".gif" ) $out = $out + "";
else $out = $out + "LOWSRC=\"" + $imlow + "\" ";
if ( $imalt == "" || $imalt == ".txt" ) $out = $out + "";
else $out = $out + "ALT=\"" + $imalt + "\" ";
$out = $out + ">";
return $out;
ahref:
$getline = "";
title "リンク先の指定 - こだマクロ";
#i = 0;
#menu = getininum ( hidemarudir + "\\htmini.txt" , "Link" , "ahrefnum" );
while ( #menu + 1 > #i ) {
$top[#i] = getinistr ( hidemarudir + "\\htmini.txt" , "Link" , "ahrefdef" + str ( #i ) );
$menu[#i] = leftstr ( $top[#i] , strstr ( $top[#i] , ";" ) );
$command[#i] = rightstr ( $top[#i] , strlen ( $top[#i] ) - strstr ( $top[#i] , ";" ) - 1 );
#i = #i + 1;
}
menuarray $menu, #menu + 1;
#re = result-1;
if ( result == 0 ) endmacro;
title $menu[#re];
if ( strstr ( $top[#re] , "画像" ) != -1 ) {
call img;
$getline = $$return;
question "テキストをいれますか?";
if ( result == no ) {
#notext = 1;
}
}
writeinistr hidemarudir + "\\htmini.txt" , "Line" , "message", "2";
getcliphist 1;
call ahref3 0;
$linkfor = $$return;
if ( strstr ( $linkfor , "mailto:" ) == -1 ) {
#menu = getininum ( hidemarudir + "\\htmini.txt" , "Link" , "targetnum" );
#i = 0;
while ( #menu + 1 > #i ) {
$top[#i] = getinistr ( hidemarudir + "\\htmini.txt" , "Link" , "targetdef" + str ( #i ) );
$menu[#i] = leftstr ( $top[#i] , strstr ( $top[#i] , ":" ) );
$command[#i] = rightstr ( $top[#i] , strlen ( $top[#i] ) - strstr ( $top[#i] , ":" ) - 1 );
#i = #i + 1;
}
title "ターゲットについて - こだマクロ";
menuarray $menu, #menu + 1;
if ( $command[result-1] == "指定" ) {
$command[result-1] = input ( "ターゲットの名前を入れてください。" );
}
if ( $command[result-1] != "" ) $target = " TARGET=\"" + $command[result-1] +"\"";
}
writeinistr hidemarudir + "\\htmini.txt" , "Line" , "message", "0";
if ( #notext != 1 ) {
title "リンクするテキストの内容について";
call ahref3 2;
$getline = $getline + $$return;
}
if ( strstr ( $getline , "mailto:" ) != -1 ) $getline = rightstr ( $getline , strlen ( $getline ) - 7 );
inputpos getinistr ( hidemarudir + "\\htmini.txt" , "Line" , "messagex" );
insert "<A HREF=\"" + $linkfor + "\"" + $target + ">" + $getline + "</A>";
writeininum hidemarudir + "\\htmini.txt" , "Link" , "ah2def" , 0;
return;
aname:
title "アンカー名の指定 - こだマクロ";
$aname = input ( "アンカー名を入れてください。" , "name" );
inputpos getinistr ( hidemarudir + "\\htmini.txt" , "Line" ,"message" + getinistr ( hidemarudir + "\\htmini.txt" , "Line" , "message" ) );
insert "<A NAME=\"" + $aname + "\"></A>";
return;
zenkaku:
writeinistr hidemarudir + "\\htmini.txt" , "Zenkaku" , "line" , $$1;
execmacro getinistr ( hidemarudir + "\\htmini.txt" , "Topmenu" , "macropath" ) + "htmzen.mac";
$out = getinistr ( hidemarudir + "\\htmini.txt" , "Zenkaku" , "line" );
writeinistr hidemarudir + "\\htmini.txt" , "Zenkaku" , "line" ,0;
return $out;
line:
$line = "";
execmacro getinistr ( hidemarudir + "\\htmini.txt" , "Topmenu" , "macropath" ) + "kodaline.mac";
#line = getininum ( hidemarudir + "\\htmini.txt" , "Line" , "line" );
#i = 0;
while ( #line > #i ){
$line = $line + getinistr ( hidemarudir + "\\htmini.txt" , "Line" , str ( #i ) ) + "\n";
writeinistr hidemarudir + "\\htmini.txt" , "Line" , str ( #i ) , 0;
#i = #i + 1;
}
$line = leftstr ( $line , strlen ( $line ) - 1 );
return $line;
ahref3:
#i = 0;
while ( 2 + ##1 > #i + ##1 ) {
$top[#i] = getinistr ( hidemarudir + "\\htmini.txt" , "Link" , "ah2def" + str ( #i + ##1 ) );
#i = #i + 1;
}
menuarray $top, 2;
if ( result == 0 ) endmacro;
else if ( $top[result-1] == "これから入力する" ) $ah3 = input ( "指定してください" , $command[#re] );
else {
call line;
if ( $command[#re] == "mailto:" && #mail == 0) $ah4 = $command[#re];
else $ah4 = "";
$ah3 = $ah4 + $$return;
#mail = 1;
}
return $ah3;