Ticket #510: tst.html

File tst.html, 8.4 KB (added by anonymous, 15 years ago)
Line 
1<!DOCTYPE BHTML PUBLIC "-//BC//DTD BHTML 3.2 Final//EN">
2<html>
3<head>
4
5  <!--------------------------------------:noTabs=true:tabSize=2:indentSize=2:--
6    --  Xinha example usage.  This file shows how a developer might make use of
7    --  Xinha, it forms the primary example file for the entire Xinha project.
8    --  This file can be copied and used as a template for development by the
9    --  end developer who should simply removed the area indicated at the bottom
10    --  of the file to remove the auto-example-generating code and allow for the
11    --  use of the file as a boilerplate.
12    --
13    --  $HeadURL: http://svn.xinha.python-hosting.com/trunk/examples/full_example-body.html $
14    --  $LastChangedDate: 2005-07-28 02:43:19 +1200 (Thu, 28 Jul 2005) $
15    --  $LastChangedRevision: 287 $
16    --  $LastChangedBy: gocher $
17    --------------------------------------------------------------------------->
18
19  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
20  <title>Example of Xinha</title>
21  <link rel="stylesheet" href="full_example.css" />
22
23  <script type="text/javascript">
24    // You must set _editor_url to the URL (including trailing slash) where
25    // where xinha is installed, it's highly recommended to use an absolute URL
26    //  eg: _editor_url = "/path/to/xinha/";
27    // You may try a relative URL if you wish]
28    //  eg: _editor_url = "../";
29    // in this example we do a little regular expression to find the absolute path.
30    //_editor_url  = document.location.href.replace(/examples\/full_example-body\.html.*/, '')
31    _editor_url = "../";
32    _editor_lang = "en";      // And the language we need to use in the editor.
33  </script>
34
35  <!-- Load up the actual editor core -->
36  <script type="text/javascript" src="../htmlarea.js"></script>
37
38  <script type="text/javascript">
39    xinha_editors = null;
40    xinha_init    = null;
41    xinha_config  = null;
42    xinha_plugins = null;
43
44    // This contains the names of textareas we will make into Xinha editors
45    xinha_init = xinha_init ? xinha_init : function()
46    {
47      /** STEP 1 ***************************************************************
48       * First, what are the plugins you will be using in the editors on this
49       * page.  List all the plugins you will need, even if not all the editors
50       * will use all the plugins.
51       ************************************************************************/
52
53      xinha_plugins = xinha_plugins ? xinha_plugins :
54      [
55//       'CharacterMap',
56//       'ContextMenu',
57//       'FullScreen',
58//       'ListType',
59//       'SpellChecker',
60//       'Stylist',
61//       'SuperClean',
62//       'TableOperations',
63 //      'CSS'
64      ];
65
66             // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :)
67             if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
68
69      /** STEP 2 ***************************************************************
70       * Now, what are the names of the textareas you will be turning into
71       * editors?
72       ************************************************************************/
73
74      xinha_editors = xinha_editors ? xinha_editors :
75      [
76        'myTextArea'
77      ];
78
79      /** STEP 3 ***************************************************************
80       * We create a default configuration to be used by all the editors.
81       * If you wish to configure some of the editors differently this will be
82       * done in step 5.
83       *
84       * If you want to modify the default config you might do something like this.
85       *
86       *   xinha_config = new HTMLArea.Config();
87       *   xinha_config.width  = '640px';
88       *   xinha_config.height = '420px';
89       *
90       *************************************************************************/
91
92       xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
93       xinha_config.width  = '600px';
94       xinha_config.height = '400px';
95       xinha_config.pageStyle = "@import url(examples/custom.css);";
96           //xinha_config.pageStyle = "@import url(dynamic.css);";       
97     
98     
99      /** STEP 4 ***************************************************************
100       * We first create editors for the textareas.
101       *
102       * You can do this in two ways, either
103       *
104       *   xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
105       *
106       * if you want all the editor objects to use the same set of plugins, OR;
107       *
108       *   xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config);
109       *   xinha_editors['myTextArea'].registerPlugins(['Stylist','FullScreen']);
110       *   xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']);
111       *
112       * if you want to use a different set of plugins for one or more of the
113       * editors.
114       ************************************************************************/
115
116      xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
117
118      /** STEP 5 ***************************************************************
119       * If you want to change the configuration variables of any of the
120       * editors,  this is the place to do that, for example you might want to
121       * change the width and height of one of the editors, like this...
122       *
123       *   xinha_editors.myTextArea.config.width  = '640px';
124       *   xinha_editors.myTextArea.config.height = '480px';
125       *
126       ************************************************************************/
127
128
129      /** STEP 6 ***************************************************************
130       * Finally we "start" the editors, this turns the textareas into
131       * Xinha editors.
132       ************************************************************************/
133
134      HTMLArea.startEditors(xinha_editors);
135    }
136
137    window.onload = xinha_init;
138  </script>
139  <!--link type="text/css" rel="alternate stylesheet" title="blue-look" href="../skins/blue-look/skin.css" />
140  <link type="text/css" rel="alternate stylesheet" title="green-look" href="../skins/green-look/skin.css" />
141  <link type="text/css" rel="alternate stylesheet" title="xp-blue" href="../skins/xp-blue/skin.css" />
142  <link type="text/css" rel="alternate stylesheet" title="xp-green" href="../skins/xp-green/skin.css" />
143  <link type="text/css" rel="alternate stylesheet" title="inditreuse" href="../skins/inditreuse/skin.css" />
144  <link type="text/css" rel="alternate stylesheet" title="blue-metallic" href="../skins/blue-metallic/skin.css" /-->
145</head>
146
147<body dir="rtl">
148
149  <form  id="editors_here">
150    <textarea  id="myTextArea" name="myTextArea" rows="10" cols="80" style="width:100%"></textarea>
151<!--<textarea id="anotherOne" name="anotherOne" rows="10" cols="80" style="width:100%"></textarea>-->
152  </form>
153
154
155  <!-- *************************************************************************
156    -                            !! IMPORTANT !!
157    -  The html and javascript below is the code used to create the example page.
158    -  It renders a lot of the above unused because it pre-fills xinha_editors,
159    -  xinha_config and xinha_plugins for you, and creates new textareas in place
160    -  of the ones above. The items above are not used while the example is being
161    -  used!
162    -
163    -  If you are going to take the code in this file to form the basis of your
164    -  own, then leave out this marked area.
165    -  ********************************************************************* -->
166
167<!--        <div id="lipsum" style="display:none">
168          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
169          Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis
170          velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique
171          ante elementum turpis. Aliquam nisl. Nulla posuere neque non
172          tellus. Morbi vel nibh. Cum sociis natoque penatibus et magnis dis
173          parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi.
174          Curabitur pharetra bibendum lectus.</p>
175
176          <ul>
177            <li> Phasellus et massa sed diam viverra semper.  </li>
178            <li> Mauris tincidunt felis in odio.              </li>
179            <li> Nulla placerat nunc ut pede.                 </li>
180            <li> Vivamus ultrices mi sit amet urna.           </li>
181            <li> Quisque sed augue quis nunc laoreet volutpat.</li>
182            <li> Nunc sit amet metus in tortor semper mattis. </li>
183          </ul>
184        </div>
185        <script src="full_example.js"></script>
186
187-->  <!-- ********************************************************************* -->
188
189
190</body>
191</html>