Ticket #697: Editortest.php

File Editortest.php, 4.8 KB (added by anonymous, 14 years ago)

my test

Line 
1<?
2## test
3?>
4
5<html>
6<head>
7<title>Test</title>
8<script type="text/javascript">
9  ///  _editor_url  = "/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
10    _editor_url  = "http://backend/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
11    _editor_lang = "en";      // And the language we need to use in the editor.
12</script>
13<script type="text/javascript" src="xinha/htmlarea.js"></script>
14
15<script type="text/javascript">
16
17    xinha_editors = null;
18    xinha_init    = null;
19    xinha_config  = null;
20    xinha_plugins = null;
21
22    // This contains the names of textareas we will make into Xinha editors
23    xinha_init = xinha_init ? xinha_init : function()
24    {
25      /** STEP 1 ***************************************************************
26       * First, what are the plugins you will be using in the editors on this
27       * page.  List all the plugins you will need, even if not all the editors
28       * will use all the plugins.
29       *
30       * The list of plugins below is a good starting point, but if you prefer
31       * a must simpler editor to start with then you can use the following
32       *
33       * xinha_plugins = xinha_plugins ? xinha_plugins : [ ];
34       *
35       * which will load no extra plugins at all.
36       ************************************************************************/
37
38      xinha_plugins = xinha_plugins ? xinha_plugins :
39      [
40       'CharacterMap',
41       'ContextMenu',
42       'FullScreen',
43       'ListType',
44       'SpellChecker',
45       'Stylist',
46       /*'SuperClean',*/
47       'TableOperations'
48      ];
49             // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :)
50             if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
51
52      /** STEP 2 ***************************************************************
53       * Now, what are the names of the textareas you will be turning into
54       * editors?
55       ************************************************************************/
56
57      xinha_editors = xinha_editors ? xinha_editors :
58      [
59        'myTextArea0'/*,
60        'anotherOne'*/
61      ];
62
63      /** STEP 3 ***************************************************************
64       * We create a default configuration to be used by all the editors.
65       * If you wish to configure some of the editors differently this will be
66       * done in step 5.
67       *
68       * If you want to modify the default config you might do something like this.
69       *
70       *   xinha_config = new HTMLArea.Config();
71       *   xinha_config.width  = '640px';
72       *   xinha_config.height = '420px';
73       *
74       *************************************************************************/
75
76       xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
77
78      /** STEP 4 ***************************************************************
79       * We first create editors for the textareas.
80       *
81       * You can do this in two ways, either
82       *
83       *   xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
84       *
85       * if you want all the editor objects to use the same set of plugins, OR;
86       *
87       *   xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config);
88       *   xinha_editors['myTextArea'].registerPlugins(['Stylist','FullScreen']);
89       *   xinha_editors['anotherOne'].registerPlugins(['CSS','SuperClean']);
90       *
91       * if you want to use a different set of plugins for one or more of the
92       * editors.
93       ************************************************************************/
94
95      xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
96
97      /** STEP 5 ***************************************************************
98       * If you want to change the configuration variables of any of the
99       * editors,  this is the place to do that, for example you might want to
100       * change the width and height of one of the editors, like this...
101       *
102       *   xinha_editors.myTextArea.config.width  = '640px';
103       *   xinha_editors.myTextArea.config.height = '480px';
104       *
105       ************************************************************************/
106
107
108      /** STEP 6 ***************************************************************
109       * Finally we "start" the editors, this turns the textareas into
110       * Xinha editors.
111       ************************************************************************/
112
113      HTMLArea.startEditors(xinha_editors);
114    }
115
116    window.onload = xinha_init;
117
118</script>
119</head>
120
121<body>
122
123<textarea id="myTextArea0" name="myTextArea" rows="20" cols="50" style="width:99%"></textarea>
124
125</body>
126
127</html>