Nation Notes module contributed by Z&H Healthcare.
[openemr.git] / library / custom_template / ckeditor / _samples / ajax.html
blob70ed9caa322b78e2fd08dbc2aa43d87283b6df42
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>Ajax &mdash; CKEditor Sample</title>
9 <meta content="text/html; charset=utf-8" http-equiv="content-type" />
10 <script type="text/javascript" src="../ckeditor.js"></script>
11 <script src="sample.js" type="text/javascript"></script>
12 <link href="sample.css" rel="stylesheet" type="text/css" />
13 <script type="text/javascript">
14 //<![CDATA[
16 var editor;
18 function createEditor()
20 if ( editor )
21 return;
23 var html = document.getElementById( 'editorcontents' ).innerHTML;
25 // Create a new editor inside the <div id="editor">, setting its value to html
26 var config = {};
27 editor = CKEDITOR.appendTo( 'editor', config, html );
30 function removeEditor()
32 if ( !editor )
33 return;
35 // Retrieve the editor contents. In an Ajax application, this data would be
36 // sent to the server or used in any other way.
37 document.getElementById( 'editorcontents' ).innerHTML = editor.getData();
38 document.getElementById( 'contents' ).style.display = '';
40 // Destroy the editor.
41 editor.destroy();
42 editor = null;
45 //]]>
46 </script>
47 </head>
48 <body>
49 <h1 class="samples">
50 CKEditor Sample &mdash; Create and Destroy Editor Instances for Ajax Applications
51 </h1>
52 <div class="description">
53 <p>
54 This sample shows how to create and destroy CKEditor instances on the fly. After the removal of CKEditor the content created inside the editing
55 area will be displayed in a <code>&lt;div&gt;</code> element.
56 </p>
57 <p>
58 For details of how to create this setup check the source code of this sample page
59 for JavaScript code responsible for the creation and destruction of a CKEditor instance.
60 </p>
61 </div>
63 <!-- This <div> holds alert messages to be display in the sample page. -->
64 <div id="alerts">
65 <noscript>
66 <p>
67 <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
68 support, like yours, you should still see the contents (HTML data) and you should
69 be able to edit it normally, without a rich editor interface.
70 </p>
71 </noscript>
72 </div>
73 <p>Click the buttons to create and remove a CKEditor instance.</p>
74 <p>
75 <input onclick="createEditor();" type="button" value="Create Editor" />
76 <input onclick="removeEditor();" type="button" value="Remove Editor" />
77 </p>
78 <!-- This div will hold the editor. -->
79 <div id="editor">
80 </div>
81 <div id="contents" style="display: none">
82 <p>
83 Edited Contents:</p>
84 <!-- This div will be used to display the editor contents. -->
85 <div id="editorcontents">
86 </div>
87 </div>
88 <div id="footer">
89 <hr />
90 <p>
91 CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
92 </p>
93 <p id="copy">
94 Copyright &copy; 2003-2011, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
95 Knabben. All rights reserved.
96 </p>
97 </div>
98 </body>
99 </html>