server/php/basic/public_html/static/lib/ckeditor/samples/ajax.html
author rougeronj
Thu, 18 Jun 2015 16:54:57 +0200
changeset 504 3329b413db18
permissions -rw-r--r--
add the new client libraries server side
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
504
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
     1
<!DOCTYPE html>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
     2
<!--
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
     3
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
     4
For licensing, see LICENSE.md or http://ckeditor.com/license
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
     5
-->
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
     6
<html>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
     7
<head>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
     8
	<meta charset="utf-8">
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
     9
	<title>Ajax &mdash; CKEditor Sample</title>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    10
	<script src="../ckeditor.js"></script>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    11
	<link rel="stylesheet" href="sample.css">
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    12
	<script>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    13
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    14
		var editor, html = '';
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    15
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    16
		function createEditor() {
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    17
			if ( editor )
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    18
				return;
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    19
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    20
			// Create a new editor inside the <div id="editor">, setting its value to html
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    21
			var config = {};
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    22
			editor = CKEDITOR.appendTo( 'editor', config, html );
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    23
		}
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    24
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    25
		function removeEditor() {
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    26
			if ( !editor )
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    27
				return;
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    28
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    29
			// Retrieve the editor contents. In an Ajax application, this data would be
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    30
			// sent to the server or used in any other way.
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    31
			document.getElementById( 'editorcontents' ).innerHTML = html = editor.getData();
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    32
			document.getElementById( 'contents' ).style.display = '';
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    33
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    34
			// Destroy the editor.
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    35
			editor.destroy();
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    36
			editor = null;
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    37
		}
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    38
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    39
	</script>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    40
</head>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    41
<body>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    42
	<h1 class="samples">
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    43
		<a href="index.html">CKEditor Samples</a> &raquo; Create and Destroy Editor Instances for Ajax Applications
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    44
	</h1>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    45
	<div class="description">
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    46
		<p>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    47
			This sample shows how to create and destroy CKEditor instances on the fly. After the removal of CKEditor the content created inside the editing
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    48
			area will be displayed in a <code>&lt;div&gt;</code> element.
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    49
		</p>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    50
		<p>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    51
			For details of how to create this setup check the source code of this sample page
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    52
			for JavaScript code responsible for the creation and destruction of a CKEditor instance.
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    53
		</p>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    54
	</div>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    55
	<p>Click the buttons to create and remove a CKEditor instance.</p>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    56
	<p>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    57
		<input onclick="createEditor();" type="button" value="Create Editor">
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    58
		<input onclick="removeEditor();" type="button" value="Remove Editor">
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    59
	</p>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    60
	<!-- This div will hold the editor. -->
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    61
	<div id="editor">
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    62
	</div>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    63
	<div id="contents" style="display: none">
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    64
		<p>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    65
			Edited Contents:
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    66
		</p>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    67
		<!-- This div will be used to display the editor contents. -->
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    68
		<div id="editorcontents">
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    69
		</div>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    70
	</div>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    71
	<div id="footer">
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    72
		<hr>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    73
		<p>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    74
			CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    75
		</p>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    76
		<p id="copy">
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    77
			Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    78
			Knabben. All rights reserved.
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    79
		</p>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    80
	</div>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    81
</body>
3329b413db18 add the new client libraries server side
rougeronj
parents:
diff changeset
    82
</html>