Changeset 6144
- Timestamp:
- 12/01/10 11:02:37 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/branches/versions/3.5.x/_samples/api.html
r6050 r6144 33 33 // Get the editor instance that we want to interact with. 34 34 var oEditor = CKEDITOR.instances.editor1; 35 var value = document.getElementById( ' plainArea' ).value;35 var value = document.getElementById( 'htmlArea' ).value; 36 36 37 37 // Check the active editing mode. … … 45 45 } 46 46 47 function InsertText() 48 { 49 // Get the editor instance that we want to interact with. 50 var oEditor = CKEDITOR.instances.editor1; 51 var value = document.getElementById( 'txtArea' ).value; 52 53 // Check the active editing mode. 54 if ( oEditor.mode == 'wysiwyg' ) 55 { 56 // Insert as plain text. 57 oEditor.insertText( value ); 58 } 59 else 60 alert( 'You must be on WYSIWYG mode!' ); 61 } 62 47 63 function SetContents() 48 64 { 49 65 // Get the editor instance that we want to interact with. 50 66 var oEditor = CKEDITOR.instances.editor1; 51 var value = document.getElementById( ' plainArea' ).value;67 var value = document.getElementById( 'htmlArea' ).value; 52 68 53 69 // Set the editor contents (replace the actual one). … … 132 148 <input onclick="GetContents();" type="button" value="Get Editor Contents (XHTML)" /> 133 149 <br /> 134 <textarea cols="80" id=" plainArea" rows="3"><h2>Test</h2><p>This is some <a href="/Test1.html">sample</a> HTML</p></textarea>150 <textarea cols="80" id="htmlArea" rows="3"><h2>Test</h2><p>This is some <a href="/Test1.html">sample</a> HTML</p></textarea> 135 151 <br /> 152 <br /> 153 <input onclick="InsertText();" type="button" value="Insert Text" /> 154 <br /> 155 <textarea cols="80" id="txtArea" rows="3"> First line with some leading whitespaces. 156 157 Second line of text preceding by two line-breaks.</textarea> 136 158 <br /> 137 159 <input onclick="ExecuteCommand('bold');" type="button" value="Execute "bold" Command" />
Note: See TracChangeset
for help on using the changeset viewer.
