1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
\r
3 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
\r
4 For licensing, see LICENSE.html or http://ckeditor.com/license
\r
6 <html xmlns="http://www.w3.org/1999/xhtml">
\r
8 <title>Sample - CKEditor</title>
\r
9 <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
\r
10 <script type="text/javascript" src="../ckeditor.js"></script>
\r
11 <script src="sample.js" type="text/javascript"></script>
\r
12 <link href="sample.css" rel="stylesheet" type="text/css"/>
\r
13 <script id="headscript" type="text/javascript">
\r
18 function createEditor()
\r
23 var html = document.getElementById( 'editorcontents' ).innerHTML;
\r
25 // Create a new editor inside the <div id="editor">
\r
26 editor = CKEDITOR.appendTo( 'editor' );
\r
27 editor.setData( html );
\r
29 // This sample may break here if the ckeditor_basic.js is used. In such case, the following code should be used instead:
\r
31 if ( editor.setData )
\r
32 editor.setData( html );
\r
34 CKEDITOR.on( 'loaded', function()
\r
36 editor.setData( html );
\r
41 function removeEditor()
\r
46 // Retrieve the editor contents. In an Ajax application, this data would be
\r
47 // sent to the server or used in any other way.
\r
48 document.getElementById( 'editorcontents' ).innerHTML = editor.getData();
\r
49 document.getElementById( 'contents' ).style.display = '';
\r
51 // Destroy the editor.
\r
63 <!-- This <div> holds alert messages to be display in the sample page. -->
\r
67 <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
\r
68 support, like yours, you should still see the contents (HTML data) and you should
\r
69 be able to edit it normally, without a rich editor interface.
\r
73 <!-- This <fieldset> holds the HTML that you will usually find in your
\r
76 <input onclick="createEditor();" type="button" value="Create Editor"/>
\r
77 <input onclick="removeEditor();" type="button" value="Remove Editor"/>
\r
81 <div id="contents" style="display: none">
\r
82 <p>Edited Contents:</p>
\r
83 <div id="editorcontents"/>
\r
88 CKEditor - The text editor for Internet - <a href="http://ckeditor.com/" shape="rect">http://ckeditor.com</a>
\r
91 Copyright © 2003-2009, <a href="http://cksource.com/" shape="rect">CKSource</a> - Frederico Knabben. All rights reserved.
\r