Ticket #527: table-operations.html

File table-operations.html, 4.1 KB (added by Subha, 9 years ago)
Line 
1<html>
2<head>
3<title>Example of HTMLArea 3.0</title>
4
5<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
7<!-- Configure the path to the editor.  We make it relative now, so that the
8    example ZIP file will work anywhere, but please NOTE THAT it's better to
9    have it an absolute path, such as '/htmlarea/'. -->
10<script type="text/javascript">
11  _editor_lang = "en";
12  _editor_url = "../";
13</script>
14<!-- load the main HTMLArea files -->
15<script type="text/javascript" src="../htmlarea.js"></script>
16
17<style type="text/css">
18html, body {
19  font-family: Verdana,sans-serif;
20  background-color: #fea;
21  color: #000;
22}
23a:link, a:visited { color: #00f; }
24a:hover { color: #048; }
25a:active { color: #f00; }
26
27textarea { background-color: #fff; border: 1px solid 00f; }
28</style>
29
30<script type="text/javascript">
31// load the plugin files
32HTMLArea.loadPlugin("TableOperations");
33HTMLArea.loadPlugin("FullScreen");
34HTMLArea.loadPlugin("FindReplace");
35
36var editor = null;
37function initEditor() {
38  // create an editor for the "ta" textbox
39  editor = new HTMLArea("ta");
40
41  // register the TableOperations plugin with our editor
42  editor.registerPlugin(TableOperations);
43
44  // register the FullScreen plugin with our editor
45  editor.registerPlugin(FullScreen);
46
47  // register the FindReplace plugin with our editor
48  editor.registerPlugin(FindReplace);
49
50  editor.generate();
51  return false;
52}
53
54function insertHTML() {
55  var html = prompt("Enter some HTML code here");
56  if (html) {
57    editor.insertHTML(html);
58  }
59}
60function highlight() {
61  editor.surroundHTML('<span style="background-color: yellow">', '</span>');
62}
63</script>
64
65</head>
66
67<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
68     customizing the editor.  It's the easiest way! :) -->
69<body onload="initEditor()">
70
71<h1>HTMLArea 3.0</h1>
72
73<p>A replacement for <code>TEXTAREA</code> elements.  &copy; <a
74href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
75
76<p>Page that demonstrates the additional features of the
77<tt>TableOperations</tt> plugin (sponsored by <a
78href="http://www.bloki.com">Zapatec Inc.</a>).</p>
79
80<form action="test.cgi" method="post" id="edit" name="edit">
81
82<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
83
84<h1>Plugin: <tt>TableOperations</tt></h1>
85
86<p>This page exemplifies the table operations toolbar, provided by the
87TableOperations plugin.</p>
88
89<p>Following there is a table.</p>
90
91<table border="1" style="border: 2px solid rgb(255, 0, 0); width: 80%; background-image: none; border-collapse: collapse; color: rgb(153, 102, 0); background-color: rgb(255, 255, 51);" align="center" cellspacing="2" cellpadding="1" summary="">
92  <caption>This <span style="font-weight: bold;">is</span> a table</caption>
93  <tbody>
94  <tr style="border-style: none; background-image: none; background-color: rgb(255, 255, 153);" char="." align="left" valign="middle"> <td>1.1</td> <td>1.2</td> <td>1.3</td> <td>1.4</td> </tr>
95  <tr> <td>2.1</td> <td style="border: 1px solid rgb(51, 51, 255); background-image: none; background-color: rgb(102, 255, 255); color: rgb(0, 0, 51);" char="." align="left" valign="middle">2.2</td> <td>2.3</td> <td>2.4</td> </tr>
96  <tr> <td>3.1</td> <td>3.2</td> <td style="border: 2px dashed rgb(51, 204, 102); background-image: none; background-color: rgb(102, 255, 153); color: rgb(0, 51, 0);" char="." align="left" valign="middle">3.3</td> <td>3.4</td> </tr>
97  <tr> <td style="background-color: rgb(255, 204, 51);">4.1</td> <td style="background-color: rgb(255, 204, 51);">4.2</td> <td style="background-color: rgb(255, 204, 51);">4.3</td> <td style="background-color: rgb(255, 204, 51);">4.4</td> </tr>
98  </tbody>
99</table>
100
101<p>Text after the table</p>
102
103</textarea>
104
105<p />
106
107<input type="submit" name="ok" value="  submit  " />
108<input type="button" name="ins" value="  insert html  " onclick="return insertHTML();" />
109<input type="button" name="hil" value="  highlight text  " onclick="return highlight();" />
110
111<a href="javascript:mySubmit()">submit</a>
112
113<script type="text/javascript">
114function mySubmit() {
115// document.edit.save.value = "yes";
116document.edit.onsubmit(); // workaround browser bugs.
117document.edit.submit();
118};
119</script>
120
121</form>
122
123</body>
124</html>