aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/w3mhelp.cgi.in
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-04-07 15:19:42 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-04-07 15:19:42 +0000
commitfed4922b04d11818684a66ca28c7591dbb274adb (patch)
treee60fc090ac73f9a29d5afb1e7e476aaa26f53462 /scripts/w3mhelp.cgi.in
parent[w3m-dev 03843] cleanup macros (diff)
downloadw3m-fed4922b04d11818684a66ca28c7591dbb274adb.tar.gz
w3m-fed4922b04d11818684a66ca28c7591dbb274adb.zip
[w3m-dev 03844] w3mhelp.cgi update
* scripts/w3mhelp-funcdesc.en.pl.in: add %menu_funcdesc * scripts/w3mhelp-funcdesc.ja.pl.in: add %menu_funcdesc update %title * scripts/w3mhelp-funcname.pl.in: add %menu_funcname add %menu_keyfunc * scripts/w3mhelp.cgi.in: modified for menu link to keymap From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'scripts/w3mhelp.cgi.in')
-rw-r--r--scripts/w3mhelp.cgi.in81
1 files changed, 73 insertions, 8 deletions
diff --git a/scripts/w3mhelp.cgi.in b/scripts/w3mhelp.cgi.in
index 761c9a3..4fc311f 100644
--- a/scripts/w3mhelp.cgi.in
+++ b/scripts/w3mhelp.cgi.in
@@ -1,5 +1,5 @@
#!@PERL@
-# $Id: w3mhelp.cgi.in,v 1.24 2003/01/23 18:37:22 ukai Exp $
+# $Id: w3mhelp.cgi.in,v 1.25 2003/04/07 15:19:46 ukai Exp $
if ( $^O =~ /^(ms)?(dos|win(32|nt)?)/i ) {
$CYGPATH = 1;
@@ -66,14 +66,15 @@ if (-f $keymap) {
local (%funckeydesc, $key, $fname, $desc);
-%funcname = (%funcname, %buf_funcname, %lineedit_funcname);
+%funcname = (%funcname, %buf_funcname, %lineedit_funcname, %menu_funcname);
-%funcdesc = (%funcdesc, %buf_funcdesc, %lineedit_funcdesc);
+%funcdesc = (%funcdesc, %buf_funcdesc, %lineedit_funcdesc, %menu_funcdesc);
while (($fname, $desc) = each %funcdesc) {
- $funckeydesc{$funcname{$fname}} = "$desc\n";
+ $funckeydesc{$funcname{$fname}} = "$fname\n$desc\n";
}
while (($key, $fname) = each %keyfunc) {
+ $keydata{$key} && next;
$funckeydesc{$funcname{$fname}} .= "$key,";
}
while (($key, $fname) = each %buf_keyfunc) {
@@ -82,6 +83,9 @@ while (($key, $fname) = each %buf_keyfunc) {
while (($key, $fname) = each %lineedit_keyfunc) {
$funckeydesc{$funcname{$fname}} .= "$key,";
}
+while (($key, $fname) = each %menu_keyfunc) {
+ $funckeydesc{$funcname{$fname}} .= "$key,";
+}
print <<HEADING;
Content-Type: text/html
@@ -111,10 +115,18 @@ for $otherlang (@docdirs) {
if ($d[1] ne $lang) {
$d[1] =~ s/[^A-Za-z0-9_\$\.\-]/sprintf('%%%02X', ord($&))/ge;
- print $script, $d[1], "\">$d[2] version</A><BR>\n";
+ print $script, $d[1], "\">$d[2] version</A>\n";
}
}
+$keymap =~ s/[<>&]/$htmlesc{$&}/ge;
+$head = "Show keymap file";
+if (defined($title{$head})) {
+ $head = $title{$head};
+ $head =~ s/[<>&]/$htmlesc{$&}/ge;
+}
+print "<P><A HREF=\"$keymap\">$head</A>\n";
+
&show_keymap("Page/Cursor motion",
split(" ", "pgFore pgBack movR movL movD movU
movR1 movL1 movD1 movU1 ldown1 lup1
@@ -157,15 +169,29 @@ for $otherlang (@docdirs) {
msgs msToggle wrapToggle execCmd setAlarm setOpt setEnv defKey
reinit execsh susp qquitfm quitfm"));
+&show_keymap_data("User defined keymaps");
+
+print "<BR>\n<HR WIDTH=80%>\n";
+
&show_keymap("Buffer selection mode",
split(" ", "buffer_next buffer_prev buffer_delete buffer_go"));
+print "<BR>\n<HR WIDTH=80%>\n";
+
&show_keymap("Line-edit mode",
split(" ", "lineedit_forward lineedit_back lineedit_backspace
lineedit_delete lineedit_kill_after lineedit_kill_before
lineedit_top lineedit_bottom lineedit_prev lineedit_next
lineedit_editor lineedit_complete lineedit_accept"));
+print "<BR>\n<HR WIDTH=80%>\n";
+
+&show_keymap("Popup menu",
+ split(" ", "menu_select menu_close menu_cancel menu_down menu_up
+ menu_line_up menu_line_down menu_top menu_last menu_next
+ menu_prev menu_search_fore menu_search_back menu_search_next
+ menu_search_prev menu_suspend"));
+
print <<PAGE;
<HR>
</BODY>
@@ -183,12 +209,17 @@ sub load_keymap {
s/^\s*keymap\s+// || next;
s/^(\"(\\\"|[^\"])+\"|\'(\\\'|[^\'])+\'|\S+)\s+(\S+)\s*// || next;
($key, $fname) = ($1, $4);
- ($data = $_) && next;
+ $data = $_;
$fname =~ tr/a-z/A-Z/;
defined($funcdesc{$fname}) || next;
$key =~ s/^["'](.*)["']$/$1/;
$key = &norm_key($key);
$keyfunc{$key} = $fname;
+ if ($data) {
+ $keydata{$key} = $data;
+ } else {
+ delete $keydata{$key};
+ }
}
}
@@ -227,13 +258,47 @@ sub show_keymap {
<table cellpadding=0>
PAGE
foreach $fid (@list) {
- local ($desc, $keys) = split("\n", $funckeydesc{$fid}, 2);
+ local ($name, $desc, $keys) = split("\n", $funckeydesc{$fid}, 3);
$keys =~ s/,$//;
$keys = '<NOT ASSIGNED>' if ($keys eq '');
$keys =~ s/[<>&]/$htmlesc{$&}/ge;
+ if ($name =~ /:/) {
+ $name = "";
+ } else {
+ $name =~ s/[<>&]/$htmlesc{$&}/ge;
+ $name = " (<b>$name</b>)";
+ }
$desc =~ s/[<>&]/$htmlesc{$&}/ge;
print <<PAGE;
-<TR><TD$attr>$keys<TD>$desc
+<TR><TD$attr>$keys<TD><NOBR>$desc$name</NOBR>
+PAGE
+ $attr = "";
+ }
+ print "</table>\n";
+}
+
+sub show_keymap_data {
+ local($head, @list) = @_;
+ local($fid);
+ local($attr) = " WIDTH=140";
+
+ if (defined($title{$head})) {
+ $head = $title{$head};
+ $head =~ s/[<>&]/$htmlesc{$&}/ge;
+ }
+
+ print <<PAGE;
+<H2>$head</H2>
+<table cellpadding=0>
+PAGE
+ foreach $keys (sort keys %keydata) {
+ $keys =~ s/[<>&]/$htmlesc{$&}/ge;
+ $name = $keyfunc{$keys};
+ $data = $keydata{$keys};
+ $name =~ s/[<>&]/$htmlesc{$&}/ge;
+ $data =~ s/[<>&]/$htmlesc{$&}/ge;
+ print <<PAGE;
+<TR><TD$attr>$keys<TD>$name<TD><NOBR>$data</NOBR>
PAGE
$attr = "";
}