1 |
wakaba |
1.1 |
<!-- Show comments (<!- - ... - ->), <!DOCTYPE ...>,
|
2 |
|
|
<?...?>, etc.
|
3 |
|
|
#name Show comments
|
4 |
|
|
#context default
|
5 |
|
|
-->
|
6 |
|
|
<script language="JScript" defer="defer">
|
7 |
|
|
var doc = external.menuArguments.document;
|
8 |
|
|
var itext = '';
|
9 |
|
|
// comments before HEAD element
|
10 |
|
|
for (var i = 0; i < doc.all.length; i++) {
|
11 |
|
|
var el = doc.all(i);
|
12 |
|
|
if (el.tagName == "!") {
|
13 |
|
|
if (el.parentElement == null) {
|
14 |
|
|
var ot = el.text;
|
15 |
|
|
ot = ot.replace(/&/g,'&');
|
16 |
|
|
ot = ot.replace(/</g,'<');
|
17 |
|
|
ot = ot.replace(/>/g,'>');
|
18 |
|
|
itext += '<pre class="x-f-comment">' + ot + '</pre>';
|
19 |
|
|
}
|
20 |
|
|
}
|
21 |
|
|
}
|
22 |
|
|
// comments before BODY element
|
23 |
|
|
var head = doc.getElementsByTagName('head').item(0);
|
24 |
|
|
for (var i = 0; i < head.all.length; i++) {
|
25 |
|
|
var el = head.all(i);
|
26 |
|
|
if (el.tagName == "!") {
|
27 |
|
|
var ot = el.text;
|
28 |
|
|
ot = ot.replace(/&/g,'&');
|
29 |
|
|
ot = ot.replace(/</g,'<');
|
30 |
|
|
ot = ot.replace(/>/g,'>');
|
31 |
|
|
itext += '<pre class="x-f-comment">' + ot + '</pre>';
|
32 |
|
|
}
|
33 |
|
|
}
|
34 |
|
|
// comments after start tag of BODY element
|
35 |
|
|
for (var i = 0; i < doc.body.all.length; i++) {
|
36 |
|
|
var el = doc.body.all(i);
|
37 |
|
|
if (el.tagName == "!") {
|
38 |
|
|
var ot = el.text;
|
39 |
|
|
ot = ot.replace(/&/g,'&');
|
40 |
|
|
ot = ot.replace(/</g,'<');
|
41 |
|
|
ot = ot.replace(/>/g,'>');
|
42 |
|
|
ot = ot.replace(/ /g,' ');
|
43 |
|
|
el.outerHTML = '<ins class="x-f-comment">' + ot + '</ins>';
|
44 |
|
|
i += 2;
|
45 |
|
|
}
|
46 |
|
|
}
|
47 |
|
|
// insert comments before BODY element
|
48 |
|
|
if (itext) {
|
49 |
|
|
itext = '<ins class="x-f-header-comments">' + itext + '</ins>';
|
50 |
|
|
doc.body.all(0).outerHTML = itext + doc.body.all(0).outerHTML;
|
51 |
|
|
}
|
52 |
|
|
</script>
|
53 |
|
|
<!--
|
54 |
|
|
Copyright 2002 wakaba E<lt>w@suika.fam.cxE<gt>.
|
55 |
|
|
|
56 |
|
|
This program is free software; you can redistribute it and/or modify
|
57 |
|
|
it under the terms of the GNU General Public License as published by
|
58 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
59 |
|
|
(at your option) any later version.
|
60 |
|
|
|
61 |
|
|
This program is distributed in the hope that it will be useful,
|
62 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
63 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
64 |
|
|
GNU General Public License for more details.
|
65 |
|
|
|
66 |
|
|
You should have received a copy of the GNU General Public License
|
67 |
|
|
along with this program; see the file COPYING. If not, write to
|
68 |
|
|
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
69 |
|
|
Boston, MA 02111-1307, USA.
|
70 |
|
|
|
71 |
|
|
$Date: $
|
72 |
|
|
-->
|