]> git.rkrishnan.org Git - .emacs.d.git/blob - emacs/nxhtml/tests/in/chunks.html
62a3bf8178d7eb2751f6fcec0c508adc3dcb4644
[.emacs.d.git] / emacs / nxhtml / tests / in / chunks.html
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3           "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml">
5   <head>
6     <title></title>
7     <script type="text/javascript">
8       // <![CDATA[
9       alert ("here");
10         /*
11          --------------------------------------------------------------------------
12          Do not edit past this point unless you know what you are doing.
13          --------------------------------------------------------------------------
14          ===== BUG: THIS LINE IS BLACK ==========
15          ===== BUG: THIS LINE IS BLACK ==========
16          */
17
18         addEvent(window, 'load', spamSpan);
19
20           function spamSpan() {
21             var allSpamSpans = getElementsByClass(spamSpanMainClass, document, 'span');
22             for (var i = 0; i < allSpamSpans.length; i++) {
23               // get data
24               var user = getSpanValue(spamSpanUserClass, allSpamSpans[i]);
25               var domain = getSpanValue(spamSpanDomainClass, allSpamSpans[i]);
26               var anchorText = getSpanValue(spamSpanAnchorTextClass, allSpamSpans[i]);
27               // prepare parameter data
28             var paramValues = new Array();
29               for (var j = 0; j < spamSpanParams.length; j++) {
30                 var paramSpanValue = getSpanValue(spamSpanParams[j], allSpamSpans[i]);
31                 if (paramSpanValue) {
32                   paramValues.push(spamSpanParams[j] + '=' +
33                                    encodeURIComponent(paramSpanValue));
34                                      }
35                                        }
36               // create new anchor tag
37               var at = String.fromCharCode(32*2);
38               var email = cleanSpan(user) + at + cleanSpan(domain);
39               var anchorTagText = document.createTextNode(anchorText ? anchorText : email);
40               var mto = String.fromCharCode(109,97,105,108,116,111,58);
41                           var hrefAttr = mto + email;
42                                            hrefAttr += paramValues.length ? '?' + paramValues.join('&') : '';
43                                              var anchorTag = document.createElement('a');
44                                                                anchorTag.className = spamSpanMainClass;
45                                                                                        anchorTag.setAttribute('href', hrefAttr);
46               anchorTag.appendChild(anchorTagText);
47               // replace the span with anchor
48               allSpamSpans[i].parentNode.replaceChild(anchorTag, allSpamSpans[i]);
49             }
50           }
51       // ]]>
52     </script>
53     <style type="text/css" media="all">
54       /* <![CDATA[ */
55       body {
56                 margin-left: 1px;
57       /* ]]> */
58     </style>
59
60   </head>
61   <body>
62   </body>
63 </html>