| 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-2010, 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>API usage - 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 | <script type="text/javascript"> |
|---|
| 18 | //<![CDATA[ |
|---|
| 19 | |
|---|
| 20 | function GetContents() |
|---|
| 21 | { |
|---|
| 22 | // Get the editor instance that we want to interact with. |
|---|
| 23 | var oEditor = CKEDITOR.instances.editor1; |
|---|
| 24 | |
|---|
| 25 | // Get the editor contents |
|---|
| 26 | alert( oEditor.getData().replace("\n", "#") ); |
|---|
| 27 | } |
|---|
| 28 | |
|---|
| 29 | //]]> |
|---|
| 30 | </script> |
|---|
| 31 | |
|---|
| 32 | </head> |
|---|
| 33 | <body> |
|---|
| 34 | <h1> |
|---|
| 35 | CKEditor Sample |
|---|
| 36 | </h1> |
|---|
| 37 | <!-- This <div> holds alert messages to be display in the sample page. --> |
|---|
| 38 | <div id="alerts"> |
|---|
| 39 | <noscript> |
|---|
| 40 | <p> |
|---|
| 41 | <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript |
|---|
| 42 | support, like yours, you should still see the contents (HTML data) and you should |
|---|
| 43 | be able to edit it normally, without a rich editor interface. |
|---|
| 44 | </p> |
|---|
| 45 | </noscript> |
|---|
| 46 | </div> |
|---|
| 47 | <form action="sample_posteddata.php" method="post"> |
|---|
| 48 | <textarea cols="80" id="editor1" name="editor1" rows="10"></textarea> |
|---|
| 49 | |
|---|
| 50 | <script type="text/javascript"> |
|---|
| 51 | //<![CDATA[ |
|---|
| 52 | // Replace the <textarea id="editor1"> with an CKEditor instance. |
|---|
| 53 | var editor = CKEDITOR.replace( 'editor1' ); |
|---|
| 54 | //]]> |
|---|
| 55 | </script> |
|---|
| 56 | <br /> |
|---|
| 57 | <input onclick="GetContents();" type="button" value="Get Contents" /> |
|---|
| 58 | </form> |
|---|
| 59 | <div id="footer"> |
|---|
| 60 | <hr /> |
|---|
| 61 | <p> |
|---|
| 62 | CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a> |
|---|
| 63 | </p> |
|---|
| 64 | <p id="copy"> |
|---|
| 65 | Copyright © 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico |
|---|
| 66 | Knabben. All rights reserved. |
|---|
| 67 | </p> |
|---|
| 68 | </div> |
|---|
| 69 | </body> |
|---|
| 70 | </html> |
|---|