X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Feditingblock%2Fplugin.js;h=05d78b6a35f0ca50d213e6f79d9f59db7b6cb605;hb=4e90e78dc97789709ee7404359a5517540c27553;hp=f58116a7c38d39d2632d56a14f1e9657e4ced4d6;hpb=039a051ccf3901311661022a30afd60fc38130c9;p=ckeditor.git diff --git a/_source/plugins/editingblock/plugin.js b/_source/plugins/editingblock/plugin.js index f58116a..05d78b6 100644 --- a/_source/plugins/editingblock/plugin.js +++ b/_source/plugins/editingblock/plugin.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 */ @@ -71,7 +71,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( !isHandlingData && editor.mode ) { isHandlingData = true; - editor.setData( getMode( editor ).getData() ); + editor.setData( getMode( editor ).getData(), null, 1 ); isHandlingData = false; } }); @@ -112,6 +112,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license CKEDITOR.fire( 'instanceReady', null, editor ); }, 0 ); }); + + editor.on( 'destroy', function () + { + // -> currentMode.unload( holderElement ); + if ( this.mode ) + this._.modes[ this.mode ].unload( this.getThemeSpace( 'contents' ) ); + }); } }); @@ -146,6 +153,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.editor.prototype.setMode = function( mode ) { + this.fire( 'beforeSetMode', { newMode : mode } ); + var data, holderElement = this.getThemeSpace( 'contents' ), isDirty = this.checkDirty(); @@ -188,6 +197,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.editor.prototype.focus = function() { + this.forceNextSelectionCheck(); var mode = getMode( this ); if ( mode ) mode.focus(); @@ -206,6 +216,7 @@ CKEDITOR.config.startupMode = 'wysiwyg'; /** * Sets whether the editor should have the focus when the page loads. + * @name CKEDITOR.config.startupFocus * @type Boolean * @default false * @example @@ -227,3 +238,23 @@ CKEDITOR.config.editingBlock = true; * @event * @param {CKEDITOR.editor} editor The editor instance that has been created. */ + +/** + * Fired when the CKEDITOR instance is created, fully initialized and ready for interaction. + * @name CKEDITOR.editor#instanceReady + * @event + */ + +/** + * Fired before changing the editing mode. + * @name CKEDITOR.editor#beforeModeUnload + * @event + */ + + /** + * Fired before the editor mode is set. + * @name CKEDITOR.editor#beforeSetMode + * @event + * @since 3.5.3 + * @param {String} newMode The name of the mode which is about to be set. + */