X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Feditor.js;h=0b373f7b2df1bca05e628345828b07f8ddf8823f;hb=f8fc585c18d287eb325c575596d183122486b641;hp=5a80fe84cc85dc282b4cb72fd593982d1a77bf1b;hpb=c6e377a02b54abc07129d72b632763c727476a15;p=ckeditor.git diff --git a/_source/core/editor.js b/_source/core/editor.js index 5a80fe8..0b373f7 100644 --- a/_source/core/editor.js +++ b/_source/core/editor.js @@ -122,6 +122,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license editor.skinPath = skinPath; editor.skinClass = 'cke_skin_' + skinName; + editor.tabIndex = editor.config.tabIndex || editor.element.getAttribute( 'tabindex' ) || 0; + // Fire the "configLoaded" event. editor.fireOnce( 'configLoaded' ); @@ -144,6 +146,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 && editor.lang.dir == 'rtl' ) editor.lang.dir = 'ltr'; + var config = editor.config; + config.contentsLangDirection == 'ui' && ( config.contentsLangDirection = editor.lang.dir ); + loadPlugins( editor ); }); }; @@ -329,7 +334,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license for ( var name in commands ) { command = commands[ name ]; - command[ command.modes[ mode ] ? 'enable' : 'disable' ](); + command[ command.startDisabled ? 'disable' : command.modes[ mode ] ? 'enable' : 'disable' ](); } } @@ -466,7 +471,43 @@ 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.fire( 'destroy' ); CKEDITOR.remove( this ); CKEDITOR.fire( 'instanceDestroyed', null, this );