Ticket #685: simple_example.html

File simple_example.html, 2.5 KB (added by mharrisonline, 11 years ago)

place in the examples folder in xinha instance with the patched htmlare.js patch, this will demonstrate preloaded js with document.write statements being prevented from executing in the editor.

Line 
1<!DOCTYPE BHTML PUBLIC "-//BC//DTD BHTML 3.2 Final//EN">
2<html>
3<head>
4
5  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6  <title>Example of Xinha</title>
7
8  <script type="text/javascript">
9    _editor_url  = document.location.href.replace(/examples\/simple_example\.html.*/, '')
10    _editor_lang = "en";      // And the language we need to use in the editor.
11  </script>
12  <script type="text/javascript" src="../htmlarea.js"></script>
13
14  <script type="text/javascript">
15    xinha_editors = null;
16    xinha_init    = null;
17    xinha_config  = null;
18    xinha_plugins = null;
19
20    xinha_init = xinha_init ? xinha_init : function()
21    {
22       xinha_plugins = xinha_plugins ? xinha_plugins :
23      [
24           'GetHtml',
25      ];
26             if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
27      xinha_editors = xinha_editors ? xinha_editors :
28      [
29        'myTextArea'
30      ];
31      xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
32      xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
33      HTMLArea.startEditors(xinha_editors);
34    }
35
36    window.onload = xinha_init;
37  </script>
38</head>
39
40<body>
41
42  <form id="editors_here">
43    <textarea id="myTextArea" name="myTextArea" rows="30" cols="80" style="width:100%">       
44          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
45          Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis
46          velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique
47          ante elementum turpis. Aliquam nisl. Nulla posuere neque non
48          tellus. Morbi vel nibh. Cum sociis natoque penatibus et magnis dis
49          parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi.
50          Curabitur pharetra bibendum lectus.</p>
51                  <script>document.write("Here is a document write with an empty script tag");</script>
52                  <script type="text/javascript">document.write("Here is a document write in a regular javascript node");</script>
53
54          <ul>
55            <li> Phasellus et massa sed diam viverra semper.  </li>
56            <li> Mauris tincidunt felis in odio.              </li>
57            <li> Nulla placerat nunc ut pede.                 </li>
58            <li> Vivamus ultrices mi sit amet urna.           </li>
59            <li> Quisque sed augue quis nunc laoreet volutpat.</li>
60            <li> Nunc sit amet metus in tortor semper mattis. </li>
61          </ul>
62       
63</textarea>
64  </form>
65
66
67
68
69</body>
70</html>
71