.
- container = mainContainer.getChild( [0,0,0,0] );
+ // Get the deeper inner
.
+ container = mainContainer.getChild( [0,0,0,0] );
- // When the editor gets focus, we show the space container, hiding others.
- editor.on( 'focus', function()
- {
- for ( var i = 0, sibling, children = element.getChildren() ; ( sibling = children.getItem( i ) ) ; i++ )
- {
- if ( sibling.type == CKEDITOR.NODE_ELEMENT
- && !sibling.equals( mainContainer )
- && sibling.hasClass( 'cke_shared' ) )
- {
- sibling.hide();
- }
- }
+ // When the editor gets focus, we show the space container, hiding others.
+ editor.on( 'focus', function()
+ {
+ for ( var i = 0, sibling, children = element.getChildren() ; ( sibling = children.getItem( i ) ) ; i++ )
+ {
+ if ( sibling.type == CKEDITOR.NODE_ELEMENT
+ && !sibling.equals( mainContainer )
+ && sibling.hasClass( 'cke_shared' ) )
+ {
+ sibling.hide();
+ }
+ }
- mainContainer.show();
- });
+ mainContainer.show();
+ });
- editor.on( 'destroy', function()
- {
- mainContainer.remove();
- });
- }
+ editor.on( 'destroy', function()
+ {
+ mainContainer.remove();
+ });
+ }
+ }
return container;
}
@@ -161,6 +224,24 @@
buildDialog : function( editor )
{
+ var skinName = editor.skinName;
+
+ editor.on( 'dialogReady', function( evt )
+ {
+ var dialog = evt.data,
+ dialogDoc = dialog._.document,
+ targetWin = dialogDoc.getWindow();
+
+ if( !( targetWin.equals( CKEDITOR.document.getWindow() )
+ || targetWin.getCustomData( 'cke_skin' + skinName + '_dialog') ) )
+ {
+ // Loads dialog skin part into dialog living window.
+ var part = CKEDITOR.skins[ skinName ].dialog;
+ for ( var c = 0 ; c < part.css.length ; c++ )
+ dialogDoc.appendStyleSheet( part.css[ c ] );
+ }
+ } );
+
var baseIdNumber = CKEDITOR.tools.getNextNumber();
var element = CKEDITOR.dom.element.createFromHtml( [
Index: _source/plugins/panelbutton/plugin.js
===================================================================
--- _source/plugins/panelbutton/plugin.js (revision 3712)
+++ _source/plugins/panelbutton/plugin.js Thu Dec 10 17:55:00 CST 2009
@@ -88,7 +88,7 @@
return;
var panelDefinition = this._.panelDefinition || {},
- panelParentElement = panelDefinition.parent || CKEDITOR.document.getBody(),
+ panelParentElement = panelDefinition.parent || this.getElement().getDocument().getBody(),
panel = this._.panel = new CKEDITOR.ui.floatPanel( editor, panelParentElement, panelDefinition ),
me = this;
@@ -133,6 +133,11 @@
_.on = 0;
me.setState( CKEDITOR.TRISTATE_OFF );
};
+ },
+
+ getElement : function()
+ {
+ return this.document.getById( this._.id );
}
}
});
Index: _source/plugins/dialog/plugin.js
===================================================================
--- _source/plugins/dialog/plugin.js (revision 4625)
+++ _source/plugins/dialog/plugin.js Thu Dec 10 19:08:36 CST 2009
@@ -101,14 +101,13 @@
}
, editor ).definition;
- var doc = CKEDITOR.document;
-
var themeBuilt = editor.theme.buildDialog( editor );
// Initialize some basic parameters.
this._ =
{
editor : editor,
+ document : new CKEDITOR.dom.document( top.document ),
element : themeBuilt.element,
name : dialogName,
contentSize : { width : 0, height : 0 },
@@ -327,11 +326,11 @@
// Add the dialog keyboard handlers.
this.on( 'show', function()
{
- CKEDITOR.document.on( 'keydown', focusKeydownHandler, this, null, 0 );
+ this._.document.on( 'keydown', focusKeydownHandler, this, null, 0 );
// Some browsers instead, don't cancel key events in the keydown, but in the
// keypress. So we must do a longer trip in those cases. (#4531)
if ( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.mac ) )
- CKEDITOR.document.on( 'keypress', focusKeyPressHandler, this );
+ this._.document.on( 'keypress', focusKeyPressHandler, this );
if ( CKEDITOR.env.ie6Compat )
{
@@ -341,7 +340,7 @@
} );
this.on( 'hide', function()
{
- CKEDITOR.document.removeListener( 'keydown', focusKeydownHandler );
+ this._.document.removeListener( 'keydown', focusKeydownHandler );
} );
this.on( 'iframeAdded', function( evt )
{
@@ -398,7 +397,7 @@
initResizeHandles( this );
// Insert the title.
- ( new CKEDITOR.dom.text( definition.title, CKEDITOR.document ) ).appendTo( this.parts.title );
+ ( new CKEDITOR.dom.text( definition.title, this._.document ) ).appendTo( this.parts.title );
// Insert the tabs and contents.
for ( var i = 0 ; i < definition.contents.length ; i++ )
@@ -443,6 +442,7 @@
this._.buttons[ buttons[i].id ] = buttons[i];
CKEDITOR.skins.load( editor, 'dialog' );
+ editor.fire( 'dialogReady', this );
};
// Focusable interface. Use it via dialog.addFocusable.
@@ -551,7 +551,7 @@
// If not fixed positioned, add scroll position to the coordinates.
if ( !isFixed )
{
- var scrollPosition = CKEDITOR.document.getWindow().getScrollPosition();
+ var scrollPosition = this._.document.getWindow().getScrollPosition();
x += scrollPosition.x;
y += scrollPosition.y;
}
@@ -587,10 +587,14 @@
}
// Insert the dialog's element to the root document.
- var element = this._.element;
+ var element = this._.element,
+ doc = this._.document,
+ dialogParentElement = doc.getBody();
+
var definition = this.definition;
- if ( !( element.getParent() && element.getParent().equals( CKEDITOR.document.getBody() ) ) )
- element.appendTo( CKEDITOR.document.getBody() );
+
+ if ( !dialogParentElement.equals( element.getParent() ) )
+ element.appendTo( dialogParentElement );
else
return;
@@ -655,7 +659,7 @@
// Rearrange the dialog to the middle of the window.
CKEDITOR.tools.setTimeout( function()
{
- var viewSize = CKEDITOR.document.getWindow().getViewPaneSize();
+ var viewSize = this._.document.getWindow().getViewPaneSize();
var dialogSize = this.getSize();
// We're using definition size for initial position because of
@@ -1451,7 +1455,7 @@
function mouseMoveHandler( evt )
{
var dialogSize = dialog.getSize(),
- viewPaneSize = CKEDITOR.document.getWindow().getViewPaneSize(),
+ viewPaneSize = dialog._.document.getWindow().getViewPaneSize(),
x = evt.data.$.screenX,
y = evt.data.$.screenY,
dx = x - lastCoords.x,
@@ -1483,8 +1487,8 @@
function mouseUpHandler( evt )
{
- CKEDITOR.document.removeListener( 'mousemove', mouseMoveHandler );
- CKEDITOR.document.removeListener( 'mouseup', mouseUpHandler );
+ this.removeListener( 'mousemove', mouseMoveHandler );
+ this.removeListener( 'mouseup', mouseUpHandler );
if ( CKEDITOR.env.ie6Compat )
{
@@ -1500,8 +1504,8 @@
lastCoords = { x : evt.data.$.screenX, y : evt.data.$.screenY };
- CKEDITOR.document.on( 'mousemove', mouseMoveHandler );
- CKEDITOR.document.on( 'mouseup', mouseUpHandler );
+ this._.document.on( 'mousemove', mouseMoveHandler );
+ this._.document.on( 'mouseup', mouseUpHandler );
abstractDialogCoords = dialog.getPosition();
if ( CKEDITOR.env.ie6Compat )
@@ -1559,8 +1563,8 @@
} );
lastCoords = { x : evt.data.$.screenX, y : evt.data.$.screenY };
- CKEDITOR.document.on( 'mousemove', mouseMoveHandler, dialog, { part : partName } );
- CKEDITOR.document.on( 'mouseup', mouseUpHandler, dialog, { part : partName } );
+ this._.document.on( 'mousemove', mouseMoveHandler, dialog, { part : partName } );
+ this._.document.on( 'mouseup', mouseUpHandler, dialog, { part : partName } );
if ( CKEDITOR.env.ie6Compat )
{
@@ -1578,7 +1582,7 @@
y = evt.data.$.screenY,
dx = x - lastCoords.x,
dy = y - lastCoords.y,
- viewPaneSize = CKEDITOR.document.getWindow().getViewPaneSize(),
+ viewPaneSize = this._.document.getWindow().getViewPaneSize(),
partName = evt.listenerData.part;
if ( partName.search( 't' ) != -1 )
@@ -1630,8 +1634,8 @@
function mouseUpHandler( evt )
{
- CKEDITOR.document.removeListener( 'mouseup', mouseUpHandler );
- CKEDITOR.document.removeListener( 'mousemove', mouseMoveHandler );
+ this._.document.removeListener( 'mouseup', mouseUpHandler );
+ this._.document.removeListener( 'mousemove', mouseMoveHandler );
if ( CKEDITOR.env.ie6Compat )
{
@@ -1660,11 +1664,10 @@
var resizeCover;
var coverElement;
+ var win = new CKEDITOR.dom.window( top );
var addCover = function( editor )
{
- var win = CKEDITOR.document.getWindow();
-
if ( !coverElement )
{
var backgroundColorStyle = editor.config.dialog_backgroundCoverColor || 'white';
@@ -1767,7 +1770,7 @@
var opacity = editor.config.dialog_backgroundCoverOpacity;
element.setOpacity( typeof opacity != 'undefined' ? opacity : 0.5 );
- element.appendTo( CKEDITOR.document.getBody() );
+ element.appendTo( new CKEDITOR.dom.element( win.$.document.body ) );
};
var removeCover = function()
@@ -1775,7 +1778,6 @@
if ( !coverElement )
return;
- var win = CKEDITOR.document.getWindow();
coverElement.remove();
win.removeListener( 'resize', resizeCover );
@@ -2192,7 +2194,7 @@
*/
getElement : function()
{
- return CKEDITOR.document.getById( this.domId );
+ return this._.dialog._.document.getById( this.domId );
},
/**
@@ -2715,7 +2717,7 @@
throw new Error( '[CKEDITOR.dialog.openDialog] Dialog "' + dialogName + '" failed when loading definition.' );
// Not loaded? Load the .js file first.
- var body = CKEDITOR.document.getBody(),
+ var body = new CKEDITOR.dom.element( top.document.body ),
cursor = body.$.style.cursor,
me = this;
Index: _source/plugins/richcombo/plugin.js
===================================================================
--- _source/plugins/richcombo/plugin.js (revision 4555)
+++ _source/plugins/richcombo/plugin.js Thu Dec 10 17:52:56 CST 2009
@@ -207,7 +207,7 @@
return;
var panelDefinition = this._.panelDefinition,
- panelParentElement = panelDefinition.parent || CKEDITOR.document.getBody(),
+ panelParentElement = panelDefinition.parent || this.getElement().getDocument().getBody();
panel = new CKEDITOR.ui.floatPanel( editor, panelParentElement, panelDefinition ),
list = panel.addListBlock( this.id, this.multiSelect ),
me = this;
@@ -277,6 +277,11 @@
this.init();
},
+ getElement : function()
+ {
+ return this.document.getById( 'cke_' + this.id );
+ },
+
setValue : function( value, text )
{
this._.value = value;
Index: _source/core/skins.js
===================================================================
--- _source/core/skins.js (revision 4644)
+++ _source/core/skins.js Thu Dec 10 15:09:38 CST 2009
@@ -23,7 +23,7 @@
var loadPart = function( editor, skinName, part, callback )
{
// Get the skin definition.
- var skinDefinition = loaded[ skinName ];
+ var skinDefinition = CKEDITOR.skins[ skinName ] = loaded[ skinName ];
if ( !editor.skin )
{
Index: _samples/sharedspaces_iframe/inner_iframe.html
===================================================================
--- _samples/sharedspaces_iframe/inner_iframe.html Thu Dec 10 15:09:38 CST 2009
+++ _samples/sharedspaces_iframe/inner_iframe.html Thu Dec 10 15:09:38 CST 2009
@@ -0,0 +1,103 @@
+
+
+
+
+
Shared Spaces - Inner Page - CKEditor Sample
+
+
+
+
+
+
+
+
Index: _samples/sharedspaces_iframe.html
===================================================================
--- _samples/sharedspaces_iframe.html Thu Dec 10 15:09:38 CST 2009
+++ _samples/sharedspaces_iframe.html Thu Dec 10 15:09:38 CST 2009
@@ -0,0 +1,35 @@
+
+
+
+
+
Shared Spaces - CKEditor Sample
+
+
+
+
+
+
+
+