| 1 |
lars |
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">
|
|
|
18 |
html, body {
|
|
|
19 |
font-family: Verdana,sans-serif;
|
|
|
20 |
background-color: #fea;
|
|
|
21 |
color: #000;
|
|
|
22 |
}
|
|
|
23 |
a:link, a:visited { color: #00f; }
|
|
|
24 |
a:hover { color: #048; }
|
|
|
25 |
a:active { color: #f00; }
|
|
|
26 |
|
|
|
27 |
textarea { background-color: #fff; border: 1px solid 00f; }
|
|
|
28 |
</style>
|
|
|
29 |
|
|
|
30 |
<script type="text/javascript">
|
|
|
31 |
// load the plugin files
|
|
|
32 |
HTMLArea.loadPlugin("TableOperations");
|
|
|
33 |
|
|
|
34 |
var editor = null;
|
|
|
35 |
function initEditor() {
|
|
|
36 |
// create an editor for the "ta" textbox
|
|
|
37 |
editor = new HTMLArea("ta");
|
|
|
38 |
|
|
|
39 |
// register the TableOperations plugin with our editor
|
|
|
40 |
editor.registerPlugin(TableOperations);
|
|
|
41 |
|
|
|
42 |
editor.generate();
|
|
|
43 |
return false;
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
function insertHTML() {
|
|
|
47 |
var html = prompt("Enter some HTML code here");
|
|
|
48 |
if (html) {
|
|
|
49 |
editor.insertHTML(html);
|
|
|
50 |
}
|
|
|
51 |
}
|
|
|
52 |
function highlight() {
|
|
|
53 |
editor.surroundHTML('<span style="background-color: yellow">', '</span>');
|
|
|
54 |
}
|
|
|
55 |
</script>
|
|
|
56 |
|
|
|
57 |
</head>
|
|
|
58 |
|
|
|
59 |
<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
|
|
|
60 |
customizing the editor. It's the easiest way! :) -->
|
|
|
61 |
<body onload="initEditor()">
|
|
|
62 |
|
|
|
63 |
<h1>HTMLArea 3.0</h1>
|
|
|
64 |
|
|
|
65 |
<p>A replacement for <code>TEXTAREA</code> elements. © <a
|
|
|
66 |
href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
|
|
|
67 |
|
|
|
68 |
<p>Page that demonstrates the additional features of the
|
|
|
69 |
<tt>TableOperations</tt> plugin (sponsored by <a
|
|
|
70 |
href="http://www.bloki.com">Zapatec Inc.</a>).</p>
|
|
|
71 |
|
|
|
72 |
<form action="test.cgi" method="post" id="edit" name="edit">
|
|
|
73 |
|
|
|
74 |
<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
|
|
|
75 |
|
|
|
76 |
<h1>Plugin: <tt>TableOperations</tt></h1>
|
|
|
77 |
|
|
|
78 |
<p>This page exemplifies the table operations toolbar, provided by the
|
|
|
79 |
TableOperations plugin.</p>
|
|
|
80 |
|
|
|
81 |
<p>Following there is a table.</p>
|
|
|
82 |
|
|
|
83 |
<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="">
|
|
|
84 |
<caption>This <span style="font-weight: bold;">is</span> a table</caption>
|
|
|
85 |
<tbody>
|
|
|
86 |
<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>
|
|
|
87 |
<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>
|
|
|
88 |
<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>
|
|
|
89 |
<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>
|
|
|
90 |
</tbody>
|
|
|
91 |
</table>
|
|
|
92 |
|
|
|
93 |
<p>Text after the table</p>
|
|
|
94 |
|
|
|
95 |
</textarea>
|
|
|
96 |
|
|
|
97 |
<p />
|
|
|
98 |
|
|
|
99 |
<input type="submit" name="ok" value=" submit " />
|
|
|
100 |
<input type="button" name="ins" value=" insert html " onclick="return insertHTML();" />
|
|
|
101 |
<input type="button" name="hil" value=" highlight text " onclick="return highlight();" />
|
|
|
102 |
|
|
|
103 |
<a href="javascript:mySubmit()">submit</a>
|
|
|
104 |
|
|
|
105 |
<script type="text/javascript">
|
|
|
106 |
function mySubmit() {
|
|
|
107 |
// document.edit.save.value = "yes";
|
|
|
108 |
document.edit.onsubmit(); // workaround browser bugs.
|
|
|
109 |
document.edit.submit();
|
|
|
110 |
};
|
|
|
111 |
</script>
|
|
|
112 |
|
|
|
113 |
</form>
|
|
|
114 |
|
|
|
115 |
</body>
|
|
|
116 |
</html>
|