X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_samples%2Fapi.html;h=92a9e9d60845125f0ef0c79c360d052c7970e341;hp=05f5b4687c9c97515ab29a48051d012c2d1d5e0d;hb=9afde8772159bd3436f1f5b7862960307710ae5a;hpb=614511639979907ceb0da3614122a4d8eb963ad4 diff --git a/_samples/api.html b/_samples/api.html index 05f5b46..92a9e9d 100644 --- a/_samples/api.html +++ b/_samples/api.html @@ -28,7 +28,7 @@ function InsertHTML() { // Get the editor instance that we want to interact with. var oEditor = CKEDITOR.instances.editor1; - var value = document.getElementById( 'plainArea' ).value; + var value = document.getElementById( 'htmlArea' ).value; // Check the active editing mode. if ( oEditor.mode == 'wysiwyg' ) @@ -40,11 +40,27 @@ function InsertHTML() alert( 'You must be on WYSIWYG mode!' ); } +function InsertText() +{ + // Get the editor instance that we want to interact with. + var oEditor = CKEDITOR.instances.editor1; + var value = document.getElementById( 'txtArea' ).value; + + // Check the active editing mode. + if ( oEditor.mode == 'wysiwyg' ) + { + // Insert as plain text. + oEditor.insertText( value ); + } + else + alert( 'You must be on WYSIWYG mode!' ); +} + function SetContents() { // Get the editor instance that we want to interact with. var oEditor = CKEDITOR.instances.editor1; - var value = document.getElementById( 'plainArea' ).value; + var value = document.getElementById( 'htmlArea' ).value; // Set the editor contents (replace the actual one). oEditor.setData( value ); @@ -127,9 +143,15 @@ function ResetDirty()
- +

+ +
+ +