Index: _samples/ajax.html
===================================================================
--- _samples/ajax.html (revision 5171)
+++ _samples/ajax.html (working copy)
@@ -26,22 +26,8 @@
var html = document.getElementById( 'editorcontents' ).innerHTML;
- // Create a new editor inside the
- editor = CKEDITOR.appendTo( 'editor' );
- editor.setData( html );
-
- // This sample may break here if the ckeditor_basic.js is used. In such case, the following code should be used instead:
- /*
- if ( editor.setData )
- editor.setData( html );
- else
- {
- CKEDITOR.on( 'loaded', function()
- {
- editor.setData( html );
- });
- }
- */
+ // Create a new editor inside the
, setting its value to html
+ editor = CKEDITOR.appendTo( 'editor', null, html );
}
function removeEditor()
Index: _source/core/ckeditor_basic.js
===================================================================
--- _source/core/ckeditor_basic.js (revision 5171)
+++ _source/core/ckeditor_basic.js (working copy)
@@ -80,7 +80,7 @@
*/
CKEDITOR.replaceByClassEnabled = true;
- var createInstance = function( elementOrIdOrName, config, creationFunction )
+ var createInstance = function( elementOrIdOrName, config, creationFunction, data )
{
if ( CKEDITOR.env.isCompatible )
{
@@ -88,7 +88,7 @@
if ( CKEDITOR.loadFullCore )
CKEDITOR.loadFullCore();
- var editor = creationFunction( elementOrIdOrName, config );
+ var editor = creationFunction( elementOrIdOrName, config, data );
CKEDITOR.add( editor );
return editor;
}
@@ -126,15 +126,16 @@
* @param {Object} [config] The specific configurations to apply to this
* editor instance. Configurations set here will override global CKEditor
* settings.
+ * @param {String} [data] Since 3.3. Initial value for the instance.
* @returns {CKEDITOR.editor} The editor instance created.
* @example
* <div id="editorSpace"><:/div>
* ...
* CKEDITOR.appendTo( 'editorSpace' );
*/
- CKEDITOR.appendTo = function( elementOrId, config )
+ CKEDITOR.appendTo = function( elementOrId, config, data )
{
- return createInstance( elementOrId, config, CKEDITOR.editor.appendTo );
+ return createInstance( elementOrId, config, CKEDITOR.editor.appendTo, data );
};
/**
Index: _source/core/editor_basic.js
===================================================================
--- _source/core/editor_basic.js (revision 5171)
+++ _source/core/editor_basic.js (working copy)
@@ -36,16 +36,18 @@
* instance.
* @param {Number} [mode] The mode in which the element is linked to this
* instance.
+ * @param {String} [data] Since 3.3. Initial value for the instance.
* @augments CKEDITOR.event
* @example
*/
- CKEDITOR.editor = function( instanceConfig, element, mode )
+ CKEDITOR.editor = function( instanceConfig, element, mode, data )
{
this._ =
{
// Save the config to be processed later by the full core code.
instanceConfig : instanceConfig,
- element : element
+ element : element,
+ data : data
};
/**
@@ -126,10 +128,11 @@
* @param {Object} [config] The specific configurations to apply to this
* editor instance. Configurations set here will override global CKEditor
* settings.
+ * @param {String} [data] Since 3.3. Initial value for the instance.
* @returns {CKEDITOR.editor} The editor instance created.
* @example
*/
- CKEDITOR.editor.appendTo = function( elementOrId, config )
+ CKEDITOR.editor.appendTo = function( elementOrId, config, data )
{
var element = elementOrId;
if ( typeof element != 'object' )
@@ -141,7 +144,7 @@
}
// Create the editor instance.
- return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_APPENDTO );
+ return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_APPENDTO, data );
};
CKEDITOR.editor.prototype =