-
Notifications
You must be signed in to change notification settings - Fork 0
/
editor.php
64 lines (56 loc) · 2.58 KB
/
editor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Ejemplo TinyMCE</title>
<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>
</head>
<body>
<div id="sample">
<script type="text/javascript" src="http://js.nicedit.com/nicEdit-latest.js"></script>
<div id="sample">
<h4>
Div Example
</h4>
<div id="myArea1" style="width: 300px; height: 100px; border: 1px solid #000;">
This is some TEST CONTENT<br />
In a DIV Tag<br />
Click the Buttons to activate
</div><button onclick="toggleArea1();">Toggle DIV Editor</button><br />
<br />
<h4>
Textarea Example
</h4>
<div>
<textarea style="width: 300px; height: 100px;" id="myArea2">
</textarea><br />
<button onclick="addArea2();">Add Editor to TEXTAREA</button> <button onclick="removeArea2();">Remove Editor from TEXTAREA</button>
</div>
<div style="clear: both;"></div><script type="text/javascript" src="http://js.nicedit.com/nicEdit-latest.js"></script>
<script type="text/javascript">
//<![CDATA[
var area1, area2;
function toggleArea1() {
if (!area1) {
area1 = new nicEditor({fullPanel: true}).panelInstance('myArea1', {hasPanel: true});
} else {
area1.removeInstance('myArea1');
area1 = null;
}
}
function addArea2() {
area2 = new nicEditor({fullPanel: true}).panelInstance('myArea2');
}
function removeArea2() {
area2.removeInstance('myArea2');
console.log();
}
bkLib.onDomLoaded(function () {
toggleArea1();
});
//]]>
</script>
</div>
</div>
</body>
</html>