Ticket #5216: 5216.patch
File 5216.patch, 4.0 KB (added by , 15 years ago) |
---|
-
_samples/ajax.html
26 26 27 27 var html = document.getElementById( 'editorcontents' ).innerHTML; 28 28 29 // Create a new editor inside the <div id="editor"> 30 editor = CKEDITOR.appendTo( 'editor' ); 31 editor.setData( html ); 32 33 // This sample may break here if the ckeditor_basic.js is used. In such case, the following code should be used instead: 34 /* 35 if ( editor.setData ) 36 editor.setData( html ); 37 else 38 { 39 CKEDITOR.on( 'loaded', function() 40 { 41 editor.setData( html ); 42 }); 43 } 44 */ 29 // Create a new editor inside the <div id="editor">, setting its value to html 30 editor = CKEDITOR.appendTo( 'editor', null, html ); 45 31 } 46 32 47 33 function removeEditor() -
_source/core/ckeditor_basic.js
80 80 */ 81 81 CKEDITOR.replaceByClassEnabled = true; 82 82 83 var createInstance = function( elementOrIdOrName, config, creationFunction )83 var createInstance = function( elementOrIdOrName, config, creationFunction, data ) 84 84 { 85 85 if ( CKEDITOR.env.isCompatible ) 86 86 { … … 88 88 if ( CKEDITOR.loadFullCore ) 89 89 CKEDITOR.loadFullCore(); 90 90 91 var editor = creationFunction( elementOrIdOrName, config );91 var editor = creationFunction( elementOrIdOrName, config, data ); 92 92 CKEDITOR.add( editor ); 93 93 return editor; 94 94 } … … 126 126 * @param {Object} [config] The specific configurations to apply to this 127 127 * editor instance. Configurations set here will override global CKEditor 128 128 * settings. 129 * @param {String} [data] Since 3.3. Initial value for the instance. 129 130 * @returns {CKEDITOR.editor} The editor instance created. 130 131 * @example 131 132 * <div id="editorSpace"><:/div> 132 133 * ... 133 134 * <b>CKEDITOR.appendTo( 'editorSpace' )</b>; 134 135 */ 135 CKEDITOR.appendTo = function( elementOrId, config )136 CKEDITOR.appendTo = function( elementOrId, config, data ) 136 137 { 137 return createInstance( elementOrId, config, CKEDITOR.editor.appendTo );138 return createInstance( elementOrId, config, CKEDITOR.editor.appendTo, data ); 138 139 }; 139 140 140 141 /** -
_source/core/editor_basic.js
36 36 * instance. 37 37 * @param {Number} [mode] The mode in which the element is linked to this 38 38 * instance. 39 * @param {String} [data] Since 3.3. Initial value for the instance. 39 40 * @augments CKEDITOR.event 40 41 * @example 41 42 */ 42 CKEDITOR.editor = function( instanceConfig, element, mode )43 CKEDITOR.editor = function( instanceConfig, element, mode, data ) 43 44 { 44 45 this._ = 45 46 { 46 47 // Save the config to be processed later by the full core code. 47 48 instanceConfig : instanceConfig, 48 element : element 49 element : element, 50 data : data 49 51 }; 50 52 51 53 /** … … 126 128 * @param {Object} [config] The specific configurations to apply to this 127 129 * editor instance. Configurations set here will override global CKEditor 128 130 * settings. 131 * @param {String} [data] Since 3.3. Initial value for the instance. 129 132 * @returns {CKEDITOR.editor} The editor instance created. 130 133 * @example 131 134 */ 132 CKEDITOR.editor.appendTo = function( elementOrId, config )135 CKEDITOR.editor.appendTo = function( elementOrId, config, data ) 133 136 { 134 137 var element = elementOrId; 135 138 if ( typeof element != 'object' ) … … 141 144 } 142 145 143 146 // Create the editor instance. 144 return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_APPENDTO );147 return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_APPENDTO, data ); 145 148 }; 146 149 147 150 CKEDITOR.editor.prototype =