X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fthemes%2Fdefault%2Ftheme.js;h=9eb488daa01216e9ccb19f3c5e2eca45f9639b1d;hb=3fe9cac293e090ea459a3ee10d78cbe9e1dd0e03;hp=960ee0b507ccf4c0f43d8ef0ecb4e70581584e79;hpb=48b1db88210b4160dce439c6e3e32e14af8c106b;p=ckeditor.git
diff --git a/_source/themes/default/theme.js b/_source/themes/default/theme.js
index 960ee0b..9eb488d 100644
--- a/_source/themes/default/theme.js
+++ b/_source/themes/default/theme.js
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
@@ -10,6 +10,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
CKEDITOR.themes.add( 'default', (function()
{
+ var hiddenSkins = {};
+
function checkSharedSpace( editor, spaceName )
{
var container,
@@ -121,6 +123,12 @@ CKEDITOR.themes.add( 'default', (function()
sharedTop && ( sharedTop.setHtml( topHtml ) , topHtml = '' );
sharedBottoms && ( sharedBottoms.setHtml( bottomHtml ), bottomHtml = '' );
+ var hideSkin = '';
+ if ( hiddenSkins[ editor.skinClass ] )
+ hideSkin = '';
+ else
+ hiddenSkins[ editor.skinClass ] = 1;
+
var container = CKEDITOR.dom.element.createFromHtml( [
'
' , bottomHtml , ' | ' +
'' +
//Hide the container when loading skins, later restored by skin css.
- '' +
+ hideSkin +
'' +
'' +
'' ].join( '' ) );
@@ -168,6 +176,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' );
},
@@ -222,6 +242,20 @@ CKEDITOR.themes.add( 'default', (function()
title = body.getChild( 0 ),
close = body.getChild( 1 );
+ // IFrame shim for dialog that masks activeX in IE. (#7619)
+ if ( CKEDITOR.env.ie && !CKEDITOR.env.ie6Compat )
+ {
+ var isCustomDomain = CKEDITOR.env.isCustomDomain(),
+ src = 'javascript:void(function(){' + encodeURIComponent( 'document.open();' + ( isCustomDomain ? ( 'document.domain="' + document.domain + '";' ) : '' ) + 'document.close();' ) + '}())',
+ iframe = CKEDITOR.dom.element.createFromHtml( '' );
+ iframe.appendTo( body.getParent() );
+ }
+
// Make the Title and Close Button unselectable.
title.unselectable();
close.unselectable();
@@ -305,25 +339,23 @@ CKEDITOR.editor.prototype.resize = function( width, height, isContentHeight, res
{
var container = this.container,
contents = CKEDITOR.document.getById( 'cke_contents_' + this.name ),
+ contentsFrame = CKEDITOR.env.webkit && this.document && this.document.getWindow().$.frameElement,
outer = resizeInner ? container.getChild( 1 ) : container;
- // Resize the width first.
- // WEBKIT BUG: Webkit requires that we put the editor off from display when we
- // resize it. If we don't, the browser crashes!
- CKEDITOR.env.webkit && outer.setStyle( 'display', 'none' );
// Set as border box width. (#5353)
outer.setSize( 'width', width, true );
- if ( CKEDITOR.env.webkit )
- {
- outer.$.offsetWidth;
- outer.setStyle( 'display', '' );
- }
+
+ // WebKit needs to refresh the iframe size to avoid rendering issues. (1/2) (#8348)
+ contentsFrame && ( contentsFrame.style.width = '1%' );
// Get the height delta between the outer table and the content area.
// If we're setting the content area's height, then we don't need the delta.
var delta = isContentHeight ? 0 : ( outer.$.offsetHeight || 0 ) - ( contents.$.clientHeight || 0 );
contents.setStyle( 'height', Math.max( height - delta, 0 ) + 'px' );
+ // WebKit needs to refresh the iframe size to avoid rendering issues. (2/2) (#8348)
+ contentsFrame && ( contentsFrame.style.width = '100%' );
+
// Emit a resize event.
this.fire( 'resize' );
};
@@ -332,12 +364,13 @@ CKEDITOR.editor.prototype.resize = function( width, height, isContentHeight, res
* Gets the element that can be freely used to check the editor size. This method
* is mainly used by the resize plugin, which adds a UI handle that can be used
* to resize the editor.
+ * @param {Boolean} forContents Whether to return the "contents" part of the theme instead of the container.
* @returns {CKEDITOR.dom.element} The resizable element.
* @example
*/
-CKEDITOR.editor.prototype.getResizable = function()
+CKEDITOR.editor.prototype.getResizable = function( forContents )
{
- return this.container;
+ return forContents ? CKEDITOR.document.getById( 'cke_contents_' + this.name ) : this.container;
};
/**