X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fthemes%2Fdefault%2Ftheme.js;h=b1e94ba8b1bbc55da452839319c4c174ed213320;hb=4e90e78dc97789709ee7404359a5517540c27553;hp=669aeb36a402da2d513a0e131b0b3653b34e597b;hpb=614511639979907ceb0da3614122a4d8eb963ad4;p=ckeditor.git diff --git a/_source/themes/default/theme.js b/_source/themes/default/theme.js index 669aeb3..b1e94ba 100644 --- a/_source/themes/default/theme.js +++ b/_source/themes/default/theme.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 */ @@ -26,7 +26,9 @@ CKEDITOR.themes.add( 'default', (function() { // Creates an HTML structure that reproduces the editor class hierarchy. var html = - '' + + '' + '' + '' + '' + @@ -45,6 +47,10 @@ CKEDITOR.themes.add( 'default', (function() // Get the deeper inner
. container = mainContainer.getChild( [0,0,0,0] ); + // Save a reference to the shared space container. + !editor.sharedSpaces && ( editor.sharedSpaces = {} ); + editor.sharedSpaces[ spaceName ] = container; + // When the editor gets focus, we show the space container, hiding others. editor.on( 'focus', function() { @@ -122,7 +128,7 @@ CKEDITOR.themes.add( 'default', (function() ' dir="', editor.lang.dir, '"' + ' title="', ( CKEDITOR.env.gecko ? ' ' : '' ), '"' + ' lang="', editor.langCode, '"' + - ( CKEDITOR.env.webkit? ' tabindex="' + tabIndex + '"' : '' ) + + ( CKEDITOR.env.webkit? ' tabindex="' + tabIndex + '"' : '' ) + ' role="application"' + ' aria-labelledby="cke_', name, '_arialbl"' + ( style ? ' style="' + style + '"' : '' ) + @@ -162,6 +168,18 @@ CKEDITOR.themes.add( 'default', (function() // Disable browser context menu for editor's chrome. container.disableContextMenu(); + // Use a class to indicate that the current selection is in different direction than the UI. + editor.on( 'contentDirChanged', function( evt ) + { + var func = ( editor.lang.dir != evt.data ? 'add' : 'remove' ) + 'Class'; + + container.getChild( 1 )[ func ]( 'cke_mixed_dir_content' ); + + // Put the mixed direction class on the respective element also for shared spaces. + var toolbarSpace = this.sharedSpaces && this.sharedSpaces[ this.config.toolbarLocation ]; + toolbarSpace && toolbarSpace.getParent().getParent()[ func ]( 'cke_mixed_dir_content' ); + }); + editor.fireOnce( 'themeLoaded' ); editor.fireOnce( 'uiReady' ); }, @@ -237,17 +255,21 @@ CKEDITOR.themes.add( 'default', (function() destroy : function( editor ) { - var container = editor.container; - container.clearCustomData(); - editor.element.clearCustomData(); + var container = editor.container, + element = editor.element; if ( container ) + { + container.clearCustomData(); container.remove(); + } - if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ) - editor.element.show(); - - delete editor.element; + if ( element ) + { + element.clearCustomData(); + editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && element.show(); + delete editor.element; + } } }; })() ); @@ -327,7 +349,7 @@ CKEDITOR.editor.prototype.resize = function( width, height, isContentHeight, res */ CKEDITOR.editor.prototype.getResizable = function() { - return this.container.getChild( 1 ); + return this.container; }; /** @@ -359,6 +381,6 @@ CKEDITOR.editor.prototype.getResizable = function() /** * Fired after the editor instance is resized through * the {@link CKEDITOR.editor.prototype.resize} method. - * @name CKEDITOR#resize + * @name CKEDITOR.editor#resize * @event */