X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fskins%2Fkama%2Fskin.js;h=922bf19f8ee56e9942acf1b0599b03fede3d8c8f;hb=4e70ea24db840898be8cc21c950363a52a2a6aba;hp=8fd05ee52cc7785267144c512b5b99d0f48d9e68;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d;p=ckeditor.git diff --git a/_source/skins/kama/skin.js b/_source/skins/kama/skin.js index 8fd05ee..922bf19 100644 --- a/_source/skins/kama/skin.js +++ b/_source/skins/kama/skin.js @@ -1,24 +1,16 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.skins.add( 'kama', (function() { - var preload = [], - uiColorStylesheetId = 'cke_ui_color'; - - if ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 ) - { - // For IE6, we need to preload some images, otherwhise they will be - // downloaded several times (CSS background bug). - preload.push( 'icons.png', 'images/sprites_ie6.png', 'images/dialog_sides.gif' ); - } + var uiColorStylesheetId = 'cke_ui_color'; return { - preload : preload, editor : { css : [ 'editor.css' ] }, dialog : { css : [ 'dialog.css' ] }, + richcombo : { canGroup: false }, templates : { css : [ 'templates.css' ] }, margins : [ 0, 0, 0, 0 ], init : function( editor ) @@ -93,7 +85,7 @@ CKEDITOR.skins.add( 'kama', (function() function getStylesheet( document ) { var node = document.getById( uiColorStylesheetId ); - if( !node ) + if ( !node ) { node = document.getHead().append( 'style' ); node.setAttribute( "id", uiColorStylesheetId ); @@ -147,7 +139,7 @@ CKEDITOR.skins.add( 'kama', (function() { var cssContent, uiStyle = getStylesheet( CKEDITOR.document ), - cssId = '#cke_' + CKEDITOR.tools.escapeCssSelector( editor.name ); + cssId = '.' + editor.id; var cssSelectors = [ @@ -203,50 +195,31 @@ CKEDITOR.skins.add( 'kama', (function() }; })() ); -if ( CKEDITOR.dialog ) +(function() { - CKEDITOR.dialog.on( 'resize', function( evt ) - { - var data = evt.data, - width = data.width, - height = data.height, - dialog = data.dialog, - contents = dialog.parts.contents; - - if ( data.skin != 'kama' ) - return; - - contents.setStyles( - { - width : width + 'px', - height : height + 'px' - }); - - // Fix the size of the elements which have flexible lengths. - setTimeout( function() - { - var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ), - body = innerDialog.getChild( 0 ); - - // tc - var el = innerDialog.getChild( 2 ); - el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' ); + CKEDITOR.dialog ? dialogSetup() : CKEDITOR.on( 'dialogPluginReady', dialogSetup ); - // bc - el = innerDialog.getChild( 7 ); - el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' ); + function dialogSetup() + { + CKEDITOR.dialog.on( 'resize', function( evt ) + { + var data = evt.data, + width = data.width, + height = data.height, + dialog = data.dialog, + contents = dialog.parts.contents; - // ml - el = innerDialog.getChild( 4 ); - el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' ); + if ( data.skin != 'kama' ) + return; - // mr - el = innerDialog.getChild( 5 ); - el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' ); - }, - 100 ); - }); -} + contents.setStyles( + { + width : width + 'px', + height : height + 'px' + }); + }); + } +})(); /** * The base user interface color to be used by the editor. Not all skins are