X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fthemes%2Fdefault%2Ftheme.js;h=078eb19b99869037b83a0e4e6d2b741fa02abd0e;hb=f8fc585c18d287eb325c575596d183122486b641;hp=97dd0ef2ab934eb5c35a246df3be798bff6ece68;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d;p=ckeditor.git
diff --git a/_source/themes/default/theme.js b/_source/themes/default/theme.js
index 97dd0ef..078eb19 100644
--- a/_source/themes/default/theme.js
+++ b/_source/themes/default/theme.js
@@ -1,10 +1,70 @@
/*
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.themes.add( 'default', (function()
{
+ function checkSharedSpace( editor, spaceName )
+ {
+ var container,
+ element;
+
+ // Try to retrieve the target element from the sharedSpaces settings.
+ element = editor.config.sharedSpaces;
+ element = element && element[ spaceName ];
+ element = element && CKEDITOR.document.getById( element );
+
+ // If the element is available, we'll then create the container for
+ // the space.
+ if ( element )
+ {
+ // Creates an HTML structure that reproduces the editor class hierarchy.
+ var html =
+ '' +
+ '' +
+ '' +
+ '' +
+ '' +
+ '
' +
- ' ' +
- '' +
- ' ' +
- '' +
- '
' +
+ ' | ' +
+ '' +
+ 'X' +
+ '' +
+ ' ' +
'' +
'' +
@@ -161,6 +230,8 @@ CKEDITOR.themes.add( 'default', (function()
destroy : function( editor )
{
var container = editor.container;
+ container.clearCustomData();
+ editor.element.clearCustomData();
/*
* IE BUG: Removing the editor DOM elements while the selection is inside
@@ -188,10 +259,9 @@ CKEDITOR.themes.add( 'default', (function()
container.remove();
if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
- {
editor.element.show();
- delete editor.element;
- }
+
+ delete editor.element;
}
};
})() );
@@ -210,9 +280,9 @@ CKEDITOR.editor.prototype.resize = function( width, height, isContentHeight, res
if ( numberRegex.test( width ) )
width += 'px';
- var contents = CKEDITOR.document.getById( 'cke_contents_' + this.name );
- var outer = resizeInner ? contents.getAscendant( 'table' ).getParent()
- : contents.getAscendant( 'table' ).getParent().getParent().getParent();
+ var container = this.container,
+ contents = CKEDITOR.document.getById( 'cke_contents_' + this.name ),
+ outer = resizeInner ? container.getChild( 1 ) : container;
// Resize the width first.
// WEBKIT BUG: Webkit requires that we put the editor off from display when we
@@ -236,5 +306,31 @@ CKEDITOR.editor.prototype.resize = function( width, height, isContentHeight, res
CKEDITOR.editor.prototype.getResizable = function()
{
- return this.container.getChild( [ 0, 0 ] );
+ return this.container.getChild( 1 );
};
+
+/**
+ * Makes it possible to place some of the editor UI blocks, like the toolbar
+ * and the elements path, into any element in the page.
+ * The elements used to hold the UI blocks can be shared among several editor
+ * instances. In that case, only the blocks of the active editor instance will
+ * display.
+ * @name CKEDITOR.config.sharedSpaces
+ * @type Object
+ * @default undefined
+ * @example
+ * // Place the toolbar inside the element with ID "someElementId" and the
+ * // elements path into the element with ID "anotherId".
+ * config.sharedSpaces =
+ * {
+ * top : 'someElementId',
+ * bottom : 'anotherId'
+ * };
+ * @example
+ * // Place the toolbar inside the element with ID "someElementId". The
+ * // elements path will remain attached to the editor UI.
+ * config.sharedSpaces =
+ * {
+ * top : 'someElementId'
+ * };
+ */
|