1 |
<!-- Show list of anchors and forms
|
2 |
#name Show list of anchors
|
3 |
#context default anchor control
|
4 |
-->
|
5 |
<script language="JScript" defer="defer">
|
6 |
var doc = external.menuArguments.document;
|
7 |
var myself = replace_specials (doc.location.href);
|
8 |
var itext = '';
|
9 |
for (var i = 0; i < doc.body.all.length; i++) {
|
10 |
var el = doc.body.all(i);
|
11 |
var tn = el.tagName;
|
12 |
if (tn == 'A') { // map is not supported.
|
13 |
var hid = ''; if (el.id) hid = el.id
|
14 |
else {el.id = 'x-f-anchor-' + i; hid = el.id}
|
15 |
var Ahref = el.href; var htext;
|
16 |
if (el.innerText) htext = el.innerText
|
17 |
else htext = '(anchor)';
|
18 |
if (el.title) {
|
19 |
if (htext) htext += ' '; htext += '[' + el.title + ']';
|
20 |
}
|
21 |
if (el.rel) htext += ' {' + el.rel + '}';
|
22 |
if (el.rev) htext += ' {<-' + el.rev + '}';
|
23 |
if (el.hreflang) htext += ' {language=' + el.hreflang + '}';
|
24 |
if (el.type) htext += ' {media-type=' + el.type + '}';
|
25 |
if (el.charset) htext += ' {charset=' + el.charset + '}';
|
26 |
htext = replace_specials (htext);
|
27 |
itext += '<li class="x-f-anchor-' + tn + '">'
|
28 |
+ '<a href="' + myself + '#' + hid
|
29 |
+ '" class="x-f-a-title" target="_self">' + htext
|
30 |
+ '</a>: ';
|
31 |
if (Ahref) {
|
32 |
Ahref = replace_specials (Ahref);
|
33 |
itext += '<<a href="' + Ahref
|
34 |
+ '" class="x-f-a-href" target="_self">'
|
35 |
+ Ahref + '</a>>'
|
36 |
} else itext += '(none)';
|
37 |
itext += '</li>';
|
38 |
} else if (tn == 'FORM') {
|
39 |
var hid = '';
|
40 |
if (el.id) hid = el.id
|
41 |
else {
|
42 |
el.id = 'x-f-form-' + i; hid = el.id;
|
43 |
}
|
44 |
var htext = '(form)';
|
45 |
if (el.title)
|
46 |
htext += ' [' + el.title + ']';
|
47 |
htext = replace_specials (htext);
|
48 |
if (el.action) {
|
49 |
var eact = replace_specials ("" + el.action);
|
50 |
itext += '<li class="x-f-anchor-FORM"><a href="' + myself
|
51 |
+ '#' + hid
|
52 |
+ '" class="x-f-form-title" target="_self">'
|
53 |
+ htext + '</a>: <<span class="x-f-form-action">'
|
54 |
+ eact + '</span>>';
|
55 |
} else
|
56 |
itext += '<li class="x-f-anchor-FORM"><a href="'
|
57 |
+ myself + '#' + hid + '" target="_self">'
|
58 |
+ htext + '</a>: (none)';
|
59 |
}
|
60 |
}
|
61 |
// insert anchor list
|
62 |
if (itext) {
|
63 |
itext = '<ins class="x-f-anchor"><ul>' + itext + '</ul></ins>';
|
64 |
doc.body.all(0).outerHTML = itext + doc.body.all(0).outerHTML;
|
65 |
}
|
66 |
function replace_specials (rt) {
|
67 |
rt = rt.replace(/&/g,'&');
|
68 |
rt = rt.replace(/</g,'<');
|
69 |
rt = rt.replace(/>/g,'>');
|
70 |
return rt;
|
71 |
}
|
72 |
</script>
|
73 |
<!--
|
74 |
Copyright 2002 wakaba E<lt>w@suika.fam.cxE<gt>.
|
75 |
|
76 |
This program is free software; you can redistribute it and/or modify
|
77 |
it under the terms of the GNU General Public License as published by
|
78 |
the Free Software Foundation; either version 2 of the License, or
|
79 |
(at your option) any later version.
|
80 |
|
81 |
This program is distributed in the hope that it will be useful,
|
82 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
83 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
84 |
GNU General Public License for more details.
|
85 |
|
86 |
You should have received a copy of the GNU General Public License
|
87 |
along with this program; see the file COPYING. If not, write to
|
88 |
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
89 |
Boston, MA 02111-1307, USA.
|
90 |
|
91 |
$Date: $
|
92 |
-->
|