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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by wakaba, Sat Mar 30 13:47:56 2002 UTC revision 1.2 by wakaba, Sun Mar 31 04:40:35 2002 UTC
# Line 24  var head = doc.getElementsByTagName('hea Line 24  var head = doc.getElementsByTagName('hea
24  for (var i = 0; i < head.all.length; i++) {  for (var i = 0; i < head.all.length; i++) {
25    var el = head.all(i);    var el = head.all(i);
26    if (el.tagName == "!") {    if (el.tagName == "!") {
27      var ot = el.text;      var ot = replace_specials (el.text);
     ot = ot.replace(/&/g,'&amp;');  
     ot = ot.replace(/</g,'&lt;');  
     ot = ot.replace(/>/g,'&gt;');  
28      itext += '<pre class="x-f-comment">' + ot + '</pre>';      itext += '<pre class="x-f-comment">' + ot + '</pre>';
29      } else if (el.tagName == "SCRIPT") {
30        var ot = replace_specials (el.outerHTML);
31        itext += '<pre class="x-f-script">' + ot + '</pre>';
32      } else if (el.tagName == "STYLE") {
33        var ot = replace_specials (el.outerHTML);
34        itext += '<pre class="x-f-style">' + ot + '</pre>';
35    }    }
36  }  }
37  // comments after start tag of BODY element  // comments after start tag of BODY element
38  for (var i = 0; i < doc.body.all.length; i++) {  for (var i = 0; i < doc.body.all.length; i++) {
39    var el = doc.body.all(i);    var el = doc.body.all(i);
40    if (el.tagName == "!") {    if (el.tagName == "!") {
41      var ot = el.text;      var ot = replace_specials (el.text);
     ot = ot.replace(/&/g,'&amp;');  
     ot = ot.replace(/</g,'&lt;');  
     ot = ot.replace(/>/g,'&gt;');  
42      ot = ot.replace(/  /g,' &nbsp;');      ot = ot.replace(/  /g,' &nbsp;');
43      el.outerHTML = '<ins class="x-f-comment">' + ot + '</ins>';      el.outerHTML = '<ins class="x-f-comment">' + ot + '</ins>';
44      i += 2;      i += 1;
45      } else if (el.tagName == "SCRIPT") {
46        var ot = replace_specials (el.outerHTML);
47        ot = ot.replace(/  /g,' &nbsp;');
48        el.outerHTML = '<ins class="x-f-script">' + ot + '</ins>';
49        i += 1;
50      } else if (el.tagName == "NOSCRIPT"
51             || el.tagName == "NOFRAMES"    /* instead of IFRAME */
52             || el.tagName == "NOEMBED"     /* non-standard */
53        ) {
54        var ot = replace_specials (el.outerHTML);
55        el.outerHTML = '<ins class="x-f-no-elements">' + ot + '</ins>';
56        i += 1;
57      } else if (el.tagName == "COMMENT") { /* IE extension */
58        var ot = replace_specials (el.outerHTML);
59        ot = ot.replace(/  /g,' &nbsp;');
60        el.outerHTML = '<ins class="x-f-comment">' + ot + '</ins>';
61        i += 1;
62    }    }
63  }  }
64  // insert comments before BODY element  // insert comments before BODY element
# Line 49  if (itext) { Line 66  if (itext) {
66    itext = '<ins class="x-f-header-comments">' + itext + '</ins>';    itext = '<ins class="x-f-header-comments">' + itext + '</ins>';
67    doc.body.all(0).outerHTML = itext + doc.body.all(0).outerHTML;    doc.body.all(0).outerHTML = itext + doc.body.all(0).outerHTML;
68  }  }
69    function replace_specials (rt) {
70      rt = rt.replace(/&/g,'&amp;');
71      rt = rt.replace(/</g,'&lt;');
72      rt = rt.replace(/>/g,'&gt;');
73      return rt;
74    }
75  </script>  </script>
76  <!--  <!--
77  Copyright 2002 wakaba E<lt>w@suika.fam.cxE<gt>.  Copyright 2002 wakaba E<lt>w@suika.fam.cxE<gt>.

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24