X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fcore%2Feditor.js;h=3f1f54da9c9d037a91da5494a7a5ee5d215ee357;hp=b1247037feaa6c381d4b651d025fa6e2ca3575f5;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hpb=9afde8772159bd3436f1f5b7862960307710ae5a diff --git a/_source/core/editor.js b/_source/core/editor.js index b124703..3f1f54d 100644 --- a/_source/core/editor.js +++ b/_source/core/editor.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -367,7 +367,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Setup the submit function because it doesn't fire the // "submit" event. - if ( !form.$.submit.nodeName ) + if ( !form.$.submit.nodeName && !form.$.submit.length ) { form.$.submit = CKEDITOR.tools.override( form.$.submit, function( originalSubmit ) { @@ -547,42 +547,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, if ( !noUpdate ) this.updateElement(); - if ( this.mode ) - { - // -> currentMode.unload( holderElement ); - this._.modes[ this.mode ].unload( this.getThemeSpace( 'contents' ) ); - } - - this.theme.destroy( this ); - - var toolbars, - index = 0, - j, - items, - instance; - - if ( this.toolbox ) - { - toolbars = this.toolbox.toolbars; - for ( ; index < toolbars.length ; index++ ) - { - items = toolbars[ index ].items; - for ( j = 0 ; j < items.length ; j++ ) - { - instance = items[ j ]; - if ( instance.clickFn ) CKEDITOR.tools.removeFunction( instance.clickFn ); - if ( instance.keyDownFn ) CKEDITOR.tools.removeFunction( instance.keyDownFn ); - - if ( instance.index ) CKEDITOR.ui.button._.instances[ instance.index ] = null; - } - } - } - - if ( this.contextMenu ) - CKEDITOR.tools.removeFunction( this.contextMenu._.functionId ); - - if ( this._.filebrowserFn ) - CKEDITOR.tools.removeFunction( this._.filebrowserFn ); + this.theme && this.theme.destroy( this ); this.fire( 'destroy' ); CKEDITOR.remove( this ); @@ -892,9 +857,9 @@ CKEDITOR.on( 'loaded', function() /** * Fired when all plugins are loaded and initialized into the editor instance. - * @name CKEDITOR#pluginsLoaded + * @name CKEDITOR.editor#pluginsLoaded * @event - * @param {CKEDITOR.editor} editor The editor instance that has been destroyed. + * @param {CKEDITOR.editor} editor This editor instance. */ /** @@ -941,3 +906,79 @@ CKEDITOR.on( 'loaded', function() * if( editor.config.fullPage ) * alert( 'This is a full page editor' ); */ + +/** + * Fired when this editor instance is destroyed. The editor at this + * point isn't usable and this event should be used to perform clean up + * in any plugin. + * @name CKEDITOR.editor#destroy + * @event + */ + +/** + * Internal event to get the current data. + * @name CKEDITOR.editor#beforeGetData + * @event + */ + +/** + * Internal event to perform the #getSnapshot call. + * @name CKEDITOR.editor#getSnapshot + * @event + */ + +/** + * Internal event to perform the #loadSnapshot call. + * @name CKEDITOR.editor#loadSnapshot + * @event + */ + + +/** + * Event fired before the #getData call returns allowing additional manipulation. + * @name CKEDITOR.editor#getData + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {String} data.dataValue The data that will be returned. + */ + +/** + * Event fired before the #setData call is executed allowing additional manipulation. + * @name CKEDITOR.editor#setData + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {String} data.dataValue The data that will be used. + */ + +/** + * Event fired at the end of the #setData call is executed. Usually it's better to use the + * {@link CKEDITOR.editor.prototype.dataReady} event. + * @name CKEDITOR.editor#afterSetData + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {String} data.dataValue The data that has been set. + */ + +/** + * Internal event to perform the #insertHtml call + * @name CKEDITOR.editor#insertHtml + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {String} data The HTML to insert. + */ + +/** + * Internal event to perform the #insertText call + * @name CKEDITOR.editor#insertText + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {String} text The text to insert. + */ + +/** + * Internal event to perform the #insertElement call + * @name CKEDITOR.editor#insertElement + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {Object} element The element to insert. + */