/*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
CKEDITOR.skins.add( 'kama', (function()\r
{\r
- var preload = [];\r
-\r
- if ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 )\r
- {\r
- // For IE6, we need to preload some images, otherwhise they will be\r
- // downloaded several times (CSS background bug).\r
- preload.push( 'icons.png', 'images/sprites_ie6.png', 'images/dialog_sides.gif' );\r
- }\r
+ var uiColorStylesheetId = 'cke_ui_color';\r
\r
return {\r
- preload : preload,\r
editor : { css : [ 'editor.css' ] },\r
dialog : { css : [ 'dialog.css' ] },\r
+ richcombo : { canGroup: false },\r
templates : { css : [ 'templates.css' ] },\r
margins : [ 0, 0, 0, 0 ],\r
init : function( editor )\r
uiColorMenuCss[ i ] = uiColorMenuCss[ i ].split( '{' );\r
}\r
\r
- function addStylesheet( document )\r
+ function getStylesheet( document )\r
{\r
- var node = document.getHead().append( 'style' );\r
- node.setAttribute( "id", "cke_ui_color" );\r
- node.setAttribute( "type", "text/css" );\r
-\r
+ var node = document.getById( uiColorStylesheetId );\r
+ if ( !node )\r
+ {\r
+ node = document.getHead().append( 'style' );\r
+ node.setAttribute( "id", uiColorStylesheetId );\r
+ node.setAttribute( "type", "text/css" );\r
+ }\r
return node;\r
}\r
\r
{\r
if ( CKEDITOR.env.webkit )\r
{\r
- // Truncate manually.\r
- for ( i = 0 ; i < styleNodes[ id ].$.sheet.rules.length ; i++ )\r
- styleNodes[ id ].$.sheet.removeRule( i );\r
-\r
for ( i = 0 ; i < styleContent.length ; i++ )\r
{\r
content = styleContent[ i ][ 1 ];\r
content = content.replace( replace[ r ][ 0 ], replace[ r ][ 1 ] );\r
\r
if ( CKEDITOR.env.ie )\r
- styleNodes[ id ].$.styleSheet.cssText = content;\r
+ styleNodes[ id ].$.styleSheet.cssText += content;\r
else\r
- styleNodes[ id ].setHtml( content );\r
+ styleNodes[ id ].$.innerHTML += content;\r
}\r
}\r
}\r
setUiColor : function( color )\r
{\r
var cssContent,\r
- uiStyle = addStylesheet( CKEDITOR.document ),\r
- cssId = '#cke_' + editor.name.replace('.', '\\.');\r
+ uiStyle = getStylesheet( CKEDITOR.document ),\r
+ cssId = '.' + editor.id;\r
\r
var cssSelectors =\r
[\r
// Add stylesheet if missing.\r
if ( !iframe.getById( 'cke_ui_color' ) )\r
{\r
- var node = addStylesheet( iframe );\r
+ var node = getStylesheet( iframe );\r
uiColorMenus.push( node );\r
\r
var color = editor.getUiColor();\r
};\r
})() );\r
\r
-if ( CKEDITOR.dialog )\r
+(function()\r
{\r
- CKEDITOR.dialog.on( 'resize', function( evt )\r
- {\r
- var data = evt.data,\r
- width = data.width,\r
- height = data.height,\r
- dialog = data.dialog,\r
- contents = dialog.parts.contents,\r
- standardsMode = !CKEDITOR.env.quirks;\r
+ CKEDITOR.dialog ? dialogSetup() : CKEDITOR.on( 'dialogPluginReady', dialogSetup );\r
+\r
+ function dialogSetup()\r
+ {\r
+ CKEDITOR.dialog.on( 'resize', function( evt )\r
+ {\r
+ var data = evt.data,\r
+ width = data.width,\r
+ height = data.height,\r
+ dialog = data.dialog,\r
+ contents = dialog.parts.contents;\r
\r
- if ( data.skin != 'kama' )\r
- return;\r
+ if ( data.skin != 'kama' )\r
+ return;\r
\r
- contents.setStyles(\r
- ( CKEDITOR.env.ie || ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 ) ) ? // IE && FF2\r
+ contents.setStyles(\r
{\r
width : width + 'px',\r
height : height + 'px'\r
- }\r
- :\r
- {\r
- // To avoid having scrollbars in the dialogs, we're\r
- // (for now) using the "min-xxx" properties, for\r
- // browsers which well support it (#3878).\r
- 'min-width' : width + 'px',\r
- 'min-height' : height + 'px'\r
});\r
-\r
- if ( !CKEDITOR.env.ie )\r
- return;\r
-\r
- // Fix the size of the elements which have flexible lengths.\r
- setTimeout( function()\r
- {\r
- var body = contents.getParent(),\r
- innerDialog = body.getParent();\r
-\r
- // tc\r
- var el = innerDialog.getChild( 2 );\r
- el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );\r
-\r
- // bc\r
- el = innerDialog.getChild( 7 );\r
- el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );\r
-\r
- // ml\r
- el = innerDialog.getChild( 4 );\r
- el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );\r
-\r
- // mr\r
- el = innerDialog.getChild( 5 );\r
- el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );\r
- },\r
- 100 );\r
- });\r
-}\r
+ });\r
+ }\r
+})();\r
\r
/**\r
* The base user interface color to be used by the editor. Not all skins are\r