var skin = editor.config.skin.split( ',' ),\r
skinName = skin[ 0 ],\r
skinPath = CKEDITOR.getUrl( skin[ 1 ] || (\r
+ '_source/' + // @Packager.RemoveLine\r
'skins/' + skinName + '/' ) );\r
\r
editor.skinName = skinName;\r
return this._.commands[ commandName ] = new CKEDITOR.command( this, commandDefinition );\r
},\r
\r
+ /**\r
+ * Add a trunk of css text to the editor which will be applied to the wysiwyg editing document.\r
+ * Note: This function should be called before editor is loaded to take effect.\r
+ * @param css {String} CSS text.\r
+ * @example\r
+ * editorInstance.addCss( 'body { background-color: grey; }' );\r
+ */\r
addCss : function( css )\r
{\r
this._.styles.push( css );\r
this.theme.destroy( this );\r
this.fire( 'destroy' );\r
CKEDITOR.remove( this );\r
+ CKEDITOR.fire( 'instanceDestroyed', null, this );\r
},\r
\r
/**\r
/**\r
* Sets the editor data. The data must be provided in raw format.\r
* @param {String} data HTML code to replace the curent content in the editor.\r
+ * @param {Function} callback Function to be called after the setData is completed.\r
* @example\r
* CKEDITOR.instances.editor1.<b>setData( '<p>This is the editor data.</p>' )</b>;\r
+ * CKEDITOR.instances.editor1.setData( '<p>Some other editor data.</p>', function()\r
+ * {\r
+ * CKEDITOR.instances.editor1.checkDirty(); // true\r
+ * } );\r
*/\r
- setData : function( data )\r
+ setData : function( data , callback )\r
{\r
+ if( callback )\r
+ {\r
+ this.on( 'dataReady', function( evt )\r
+ {\r
+ evt.removeListener();\r
+ callback.call( evt.editor );\r
+ } );\r
+ }\r
// Fire "setData" so data manipulation may happen.\r
var eventData = { dataValue : data };\r
this.fire( 'setData', eventData );\r