X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fcore%2Feditor.js;h=5a80fe84cc85dc282b4cb72fd593982d1a77bf1b;hp=c0653010ff1dbbb0e1e9e72ee5b75d9371481e24;hb=c6e377a02b54abc07129d72b632763c727476a15;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6 diff --git a/_source/core/editor.js b/_source/core/editor.js index c065301..5a80fe8 100644 --- a/_source/core/editor.js +++ b/_source/core/editor.js @@ -575,19 +575,21 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, }, /** - * Sets the editor data. The data must be provided in raw format (HTML). - * Note: This's an asynchronous method, the {@param callback} - * function should be relied on if you want to interact with the editor - * after data is fully loaded. - * - * @param {String} data HTML code to replace the curent content in the editor. - * @param {Function} callback Function to be called after the setData is completed. + * Sets the editor data. The data must be provided in raw format (HTML).
+ *
+ * Note that this menthod is asynchronous. The "callback" parameter must + * be used if interaction with the editor is needed after setting the data. + * @param {String} data HTML code to replace the curent content in the + * editor. + * @param {Function} callback Function to be called after the setData + * is completed. * @example - * CKEDITOR.instances.editor1.setData( '<p>This is the editor data.</p>' ); - * CKEDITOR.instances.editor1.setData( '<p>Some other editor data.</p>', function() - * { - * CKEDITOR.instances.editor1.checkDirty(); // true - * } ); + * CKEDITOR.instances.editor1.setData( '<p>This is the editor data.</p>' ); + * @example + * CKEDITOR.instances.editor1.setData( '<p>Some other editor data.</p>', function() + * { + * this.checkDirty(); // true + * }); */ setData : function( data , callback ) { @@ -599,6 +601,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, callback.call( evt.editor ); } ); } + // Fire "setData" so data manipulation may happen. var eventData = { dataValue : data }; this.fire( 'setData', eventData ); @@ -658,7 +661,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, { var data = this.getData(); - if( this.config.htmlEncodeOutput ) + if ( this.config.htmlEncodeOutput ) data = CKEDITOR.tools.htmlEncode( data ); if ( element.is( 'textarea' ) ) @@ -685,8 +688,31 @@ CKEDITOR.on( 'loaded', function() /** * Whether escape HTML when editor update original input element. * @name CKEDITOR.config.htmlEncodeOutput - * @type {Boolean} + * @since 3.1 + * @type Boolean * @default false * @example * config.htmlEncodeOutput = true; */ + +/** + * Fired when a CKEDITOR instance is created, but still before initializing it. + * To interact with a fully initialized instance, use the + * {@link CKEDITOR#instanceReady} event instead. + * @name CKEDITOR#instanceCreated + * @event + * @param {CKEDITOR.editor} editor The editor instance that has been created. + */ + +/** + * Fired when a CKEDITOR instance is destroyed. + * @name CKEDITOR#instanceDestroyed + * @event + * @param {CKEDITOR.editor} editor The editor instance that has been destroyed. + */ + +/** + * Fired when all plugins are loaded and initialized into the editor instance. + * @name CKEDITOR#pluginsLoaded + * @event + */