-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,467 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. | ||
For licensing, see LICENSE.md or http://ckeditor.com/license | ||
--> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Replace Textarea by Code — CKEditor Sample</title> | ||
<script src="../../../ckeditor.js"></script> | ||
<link href="../../../samples/sample.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<h1 class="samples"> | ||
<a href="../../../samples/index.html">CKEditor Samples</a> » Replace Textarea Elements Using JavaScript Code | ||
</h1> | ||
<form action="sample_posteddata.php" method="post"> | ||
<div class="description"> | ||
<p> | ||
This editor is using an <code><iframe></code> element-based editing area, provided by the <strong>Wysiwygarea</strong> plugin. | ||
</p> | ||
<pre class="samples"> | ||
CKEDITOR.replace( '<em>textarea_id</em>' ) | ||
</pre> | ||
</div> | ||
<textarea cols="80" id="editor1" name="editor1" rows="10"> | ||
<p>Apollo 11</p> | ||
<p>111 222 333 444 555 666 777</p> | ||
</textarea> | ||
<p> | ||
<input type="submit" value="Submit"> | ||
</p> | ||
</form> | ||
<div id="footer"> | ||
<hr> | ||
<p> | ||
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a> | ||
</p> | ||
<p id="copy"> | ||
Copyright © 2003-2014, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico | ||
Knabben. All rights reserved. | ||
</p> | ||
</div> | ||
<div id="debugConsole"> | ||
<div>Snapshots: <strong id="debugSnapshotsCount">0</strong></div> | ||
<div>Typing: <strong id="debugTypingVal">false</strong></div> | ||
</div> | ||
<div id="undoControls"> | ||
<a onclick="CKEDITOR.instances.editor1.execCommand('undo');" href="#">< Undo</a> | ||
<a onclick="CKEDITOR.instances.editor1.execCommand('redo');" href="#">Redo ></a> | ||
</div> | ||
<script type="text/javascript"> | ||
var snapCount = document.getElementById( 'debugSnapshotsCount' ), | ||
typingTracer = document.getElementById( 'debugTypingVal' ), | ||
updateTypingTracer = function() { | ||
typingTracer.innerHTML = String( CKEDITOR.instances.editor1.undoManager.typing ); | ||
}, | ||
updateSnapshotCounter = function() { | ||
if ( !CKEDITOR && CKEDITOR.instances.editor1 ) | ||
return; | ||
|
||
snapCount.innerHTML = CKEDITOR.instances.editor1.undoManager.snapshots.length; | ||
updateTypingTracer(); | ||
}; | ||
|
||
CKEDITOR.replace( 'editor1', { | ||
toolbar: [ [ 'Source', 'Bold', 'Italic' ] ,[ 'Undo' ], [ 'Redo' ] ], | ||
on: { | ||
instanceReady: function( evt ) { | ||
CKEDITOR.instances.editor1.focus(); | ||
}, | ||
change: function( evt ) { | ||
updateSnapshotCounter(); | ||
} | ||
} | ||
} ); | ||
|
||
window.setInterval( updateSnapshotCounter, 700 ); | ||
</script> | ||
<style type="text/css"> | ||
#debugConsole { clear: both; } | ||
#undoControls { clear: both; } | ||
#undoControls a { padding: 25px 50px; font-size: 19px; margin-right: 15px; outline: 2px solid gray; display: block; float: left; text-decoration: none; } | ||
</style> | ||
</body> | ||
</html> |
Oops, something went wrong.