/[suikacvs]/www/ie/iemenu/show-comment.html
Suika

Contents of /www/ie/iemenu/show-comment.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Sat Mar 30 13:47:56 2002 UTC (22 years, 8 months ago) by wakaba
Branch: MAIN
Branch point for: wakaba
File MIME type: text/html
Initial revision

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,'&amp;');
16 ot = ot.replace(/</g,'&lt;');
17 ot = ot.replace(/>/g,'&gt;');
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,'&amp;');
29 ot = ot.replace(/</g,'&lt;');
30 ot = ot.replace(/>/g,'&gt;');
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,'&amp;');
40 ot = ot.replace(/</g,'&lt;');
41 ot = ot.replace(/>/g,'&gt;');
42 ot = ot.replace(/ /g,' &nbsp;');
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 -->

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24