Index: /CKEditor/branches/features/sharedspaces/_samples/index.html
===================================================================
--- /CKEditor/branches/features/sharedspaces/_samples/index.html (revision 4643)
+++ /CKEditor/branches/features/sharedspaces/_samples/index.html (revision 4644)
@@ -38,4 +38,5 @@
Using the JavaScript API to customize dialogs
Using the "Enter" key in CKEditor
+ Shared toolbars
jQuery adapter example
Index: /CKEditor/branches/features/sharedspaces/_samples/sharedspaces.html
===================================================================
--- /CKEditor/branches/features/sharedspaces/_samples/sharedspaces.html (revision 4644)
+++ /CKEditor/branches/features/sharedspaces/_samples/sharedspaces.html (revision 4644)
@@ -0,0 +1,115 @@
+
+
+
+
+ Replace Textarea by Code - CKEditor Sample
+
+
+
+
+
+
+
+
Index: /CKEditor/branches/features/sharedspaces/_source/core/skins.js
===================================================================
--- /CKEditor/branches/features/sharedspaces/_source/core/skins.js (revision 4643)
+++ /CKEditor/branches/features/sharedspaces/_source/core/skins.js (revision 4644)
@@ -21,8 +21,17 @@
var paths = {};
- var loadPart = function( skinName, part, callback )
+ var loadPart = function( editor, skinName, part, callback )
{
// Get the skin definition.
var skinDefinition = loaded[ skinName ];
+
+ if ( !editor.skin )
+ {
+ editor.skin = skinDefinition;
+
+ // Trigger init function if any.
+ if ( skinDefinition.init )
+ skinDefinition.init( editor );
+ }
var appendSkinPath = function( fileNames )
@@ -56,5 +65,5 @@
{
preloaded[ skinName ] = 1;
- loadPart( skinName, part, callback );
+ loadPart( editor, skinName, part, callback );
} );
return;
@@ -182,5 +191,5 @@
if ( loaded[ skinName ] )
- loadPart( skinName, skinPart, callback );
+ loadPart( editor, skinName, skinPart, callback );
else
{
@@ -188,12 +197,5 @@
CKEDITOR.scriptLoader.load( skinPath + 'skin.js', function()
{
- // Get the skin definition.
- var skinDefinition = editor.skin = loaded[ skinName ];
-
- // Trigger init function if any.
- if ( skinDefinition.init )
- skinDefinition.init( editor );
-
- loadPart( skinName, skinPart, callback );
+ loadPart( editor, skinName, skinPart, callback );
});
}
Index: /CKEditor/branches/features/sharedspaces/_source/skins/kama/elementspath.css
===================================================================
--- /CKEditor/branches/features/sharedspaces/_source/skins/kama/elementspath.css (revision 4643)
+++ /CKEditor/branches/features/sharedspaces/_source/skins/kama/elementspath.css (revision 4644)
@@ -14,7 +14,7 @@
.cke_skin_kama .cke_path
{
- padding: 0 5px;
display: inline-block;
float: left;
+ margin-top: 5px;
}
@@ -24,4 +24,9 @@
}
+.cke_shared .cke_skin_kama .cke_path
+{
+ margin: 0 0 5px;
+}
+
.cke_skin_kama .cke_path a,
.cke_skin_kama .cke_path .cke_empty
@@ -29,9 +34,5 @@
display: inline-block;
float: left;
- padding-top: 1px;
- padding-bottom: 1px;
- padding-left: 4px;
- padding-right: 4px;
- margin-bottom : 3px;
+ padding: 1px 4px 0;
color: #60676a;
}
@@ -53,8 +54,5 @@
{
background-color: #dff1ff;
- padding-top: 1px;
- padding-bottom: 1px;
- padding-left: 4px;
- padding-right: 4px;
+ padding: 1px 4px 0;
outline: none;
color : #000;
Index: /CKEditor/branches/features/sharedspaces/_source/skins/kama/mainui.css
===================================================================
--- /CKEditor/branches/features/sharedspaces/_source/skins/kama/mainui.css (revision 4643)
+++ /CKEditor/branches/features/sharedspaces/_source/skins/kama/mainui.css (revision 4644)
@@ -30,6 +30,12 @@
background-position: 0 -1950px;
display: block;
+ padding: 5px;
/*background-color: Red;*/
+}
+
+.cke_shared .cke_skin_kama .cke_wrapper
+{
+ padding-bottom: 0;
}
@@ -67,5 +73,4 @@
{
margin: 5px;
- padding: 0 5px 5px;
}
@@ -138,2 +143,13 @@
top: 0;
}
+
+.cke_skin_kama .cke_browser_ie7 .cke_editor
+{
+ display: inline-block;
+}
+
+.cke_shared .cke_skin_kama .cke_browser_ie7 .cke_wrapper
+{
+ padding-bottom: 5px;
+}
+
Index: /CKEditor/branches/features/sharedspaces/_source/skins/kama/skin.js
===================================================================
--- /CKEditor/branches/features/sharedspaces/_source/skins/kama/skin.js (revision 4643)
+++ /CKEditor/branches/features/sharedspaces/_source/skins/kama/skin.js (revision 4644)
@@ -148,5 +148,5 @@
var cssContent,
uiStyle = getStylesheet( CKEDITOR.document ),
- cssId = '#cke_' + CKEDITOR.tools.escapeCssSelector( editor.name );
+ cssId = '.cke_editor_' + CKEDITOR.tools.escapeCssSelector( editor.name );
var cssSelectors =
Index: /CKEditor/branches/features/sharedspaces/_source/skins/kama/toolbar.css
===================================================================
--- /CKEditor/branches/features/sharedspaces/_source/skins/kama/toolbar.css (revision 4643)
+++ /CKEditor/branches/features/sharedspaces/_source/skins/kama/toolbar.css (revision 4644)
@@ -23,10 +23,4 @@
{
clear: both;
- padding: 5px 3px 5px 6px;
-}
-
-.cke_skin_kama .cke_rtl .cke_toolbox
-{
- padding: 5px 6px 5px 3px;
}
@@ -43,5 +37,5 @@
float: right;
border: 1px outset #D3D3D3;
- margin: 11px 4px 2px;
+ margin: 11px 0 2px;
cursor: pointer;
}
@@ -396,2 +390,12 @@
cursor: default;
}
+
+.cke_skin_kama .cke_browser_ie7 .cke_toolbox
+{
+ margin-bottom: 2px;
+}
+
+.cke_shared .cke_skin_kama .cke_browser_ie7 .cke_toolbox
+{
+ margin-bottom: 0;
+}
Index: /CKEditor/branches/features/sharedspaces/_source/themes/default/theme.js
===================================================================
--- /CKEditor/branches/features/sharedspaces/_source/themes/default/theme.js (revision 4643)
+++ /CKEditor/branches/features/sharedspaces/_source/themes/default/theme.js (revision 4644)
@@ -6,4 +6,64 @@
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 =
+ '' +
+ '' +
+ '' +
+ '' +
+ '' +
+ '' +
+ '
';
+
+ var mainContainer = element.append( CKEDITOR.dom.element.createFromHtml( html, element.getDocument() ) );
+
+ // Only the first container starts visible. Others get hidden.
+ if ( element.getCustomData( 'cke_hasshared' ) )
+ mainContainer.hide();
+ else
+ element.setCustomData( 'cke_hasshared', 1 );
+
+ // 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();
+ }
+ }
+
+ mainContainer.show();
+ });
+
+ editor.on( 'destroy', function()
+ {
+ mainContainer.remove();
+ });
+ }
+
+ return container;
+ }
+
return {
build : function( editor, themePath )
@@ -45,9 +105,15 @@
}
+ var sharedTop = topHtml && checkSharedSpace( editor, 'top' ),
+ sharedBottoms = checkSharedSpace( editor, 'bottom' );
+
+ sharedTop && ( sharedTop.setHtml( topHtml ) , topHtml = '' );
+ sharedBottoms && ( sharedBottoms.setHtml( bottomHtml ), bottomHtml = '' );
+
var container = CKEDITOR.dom.element.createFromHtml( [
'