3 Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
4 For licensing, see LICENSE.md or http://ckeditor.com/license
9 <title>Replace Textarea by Code
— CKEditor Sample
</title>
10 <script src=
"../../../ckeditor.js"></script>
11 <link href=
"../../../samples/old/sample.css" rel=
"stylesheet">
15 <a href=
"../../../samples/old/index.html">CKEditor Samples
</a> » Replace Textarea Elements Using JavaScript Code
17 <form action=
"sample_posteddata.php" method=
"post">
18 <div class=
"description">
20 This editor is using an
<code><iframe
></code> element-based editing area, provided by the
<strong>Wysiwygarea
</strong> plugin.
23 CKEDITOR.replace( '
<em>textarea_id
</em>' )
26 <textarea cols=
"80" id=
"editor1" name=
"editor1" rows=
"10">
27 <p
>Apollo
11</p
>
28 <p
>111 222 333 444 555 666 777</p
>
31 <input type=
"submit" value=
"Submit">
37 CKEditor - The text editor for the Internet -
<a class=
"samples" href=
"http://ckeditor.com/">http://ckeditor.com
</a>
40 Copyright
© 2003-
2015,
<a class=
"samples" href=
"http://cksource.com/">CKSource
</a> - Frederico
41 Knabben. All rights reserved.
44 <div id=
"debugConsole">
45 <div>Snapshots:
<strong id=
"debugSnapshotsCount">0</strong></div>
46 <div>Typing:
<strong id=
"debugTypingVal">false
</strong></div>
48 <div id=
"undoControls">
49 <a onclick=
"CKEDITOR.instances.editor1.execCommand('undo');" href=
"#">< Undo
</a>
50 <a onclick=
"CKEDITOR.instances.editor1.execCommand('redo');" href=
"#">Redo
></a>
52 <script type=
"text/javascript">
53 var snapCount = document.getElementById( 'debugSnapshotsCount' ),
54 typingTracer = document.getElementById( 'debugTypingVal' ),
55 updateTypingTracer = function() {
56 typingTracer.innerHTML = String( CKEDITOR.instances.editor1.undoManager.typing );
58 updateSnapshotCounter = function() {
59 if ( !CKEDITOR && CKEDITOR.instances.editor1 )
62 snapCount.innerHTML = CKEDITOR.instances.editor1.undoManager.snapshots.length;
66 CKEDITOR.replace( 'editor1', {
67 toolbar: [ [ 'Source', 'Bold', 'Italic' ] ,[ 'Undo' ], [ 'Redo' ] ],
69 instanceReady: function( evt ) {
70 CKEDITOR.instances.editor1.focus();
72 change: function( evt ) {
73 updateSnapshotCounter();
78 window.setInterval( updateSnapshotCounter,
700 );
80 <style type=
"text/css">
81 #debugConsole { clear: both; }
82 #undoControls { clear: both; }
83 #undoControls a { padding:
25px
50px; font-size:
19px; margin-right:
15px; outline:
2px solid gray; display: block; float: left; text-decoration: none; }