1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
2 | <!-- |
---|
3 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. |
---|
4 | For licensing, see LICENSE.html or http://ckeditor.com/license |
---|
5 | --> |
---|
6 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
7 | <head> |
---|
8 | <title>Replace Textareas by Class Name — CKEditor Sample</title> |
---|
9 | <meta content="text/html; charset=utf-8" http-equiv="content-type" /> |
---|
10 | <!-- CKReleaser %REMOVE_LINE% |
---|
11 | <script type="text/javascript" src="../ckeditor.js"></script> |
---|
12 | CKReleaser %REMOVE_START% --> |
---|
13 | <script type="text/javascript" src="../ckeditor_source.js"></script> |
---|
14 | <!-- CKReleaser %REMOVE_END% --> |
---|
15 | <script src="sample.js" type="text/javascript"></script> |
---|
16 | <link href="sample.css" rel="stylesheet" type="text/css" /> |
---|
17 | </head> |
---|
18 | <body> |
---|
19 | |
---|
20 | <form action="sample_posteddata.php" method="post"> |
---|
21 | <p> |
---|
22 | <label for="editor1"> |
---|
23 | Editor 1:</label> |
---|
24 | <textarea class="ckeditor" cols="80" id="editor1" name="editor1" rows="10"></textarea> |
---|
25 | </p> |
---|
26 | <p> |
---|
27 | <input type="submit" value="Submit" /> |
---|
28 | <input onclick="insertElements()" type="button" value="Insert Elements" /> |
---|
29 | </p> |
---|
30 | </form> |
---|
31 | |
---|
32 | <script type="text/javascript"> |
---|
33 | |
---|
34 | function insertElements(){ |
---|
35 | var temp = new CKEDITOR.dom.element( 'div', CKEDITOR.instances.editor1.document); |
---|
36 | temp.setHtml('<img src=""/><p>Text goes here</p>'); |
---|
37 | CKEDITOR.instances.editor1.insertElement(temp.getFirst()); |
---|
38 | CKEDITOR.instances.editor1.insertElement(temp.getFirst()); |
---|
39 | } |
---|
40 | </script> |
---|
41 | |
---|
42 | <div id="footer"> |
---|
43 | <hr /> |
---|
44 | <p> |
---|
45 | CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a> |
---|
46 | </p> |
---|
47 | <p id="copy"> |
---|
48 | Copyright © 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico |
---|
49 | Knabben. All rights reserved. |
---|
50 | </p> |
---|
51 | </div> |
---|
52 | |
---|
53 | |
---|
54 | |
---|
55 | </body> |
---|
56 | </html> |
---|