cmc-sales/webroot/js/ckeditor/_source/skins/v2/skin.js

78 lines
1.9 KiB
JavaScript
Raw Normal View History

2009-10-10 00:15:12 -07:00
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
2009-10-10 00:15:12 -07:00
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.skins.add( 'v2', (function()
{
var preload = [];
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' );
}
return {
preload : preload,
editor : { css : [ 'editor.css' ] },
dialog : { css : [ 'dialog.css' ] },
templates : { css : [ 'templates.css' ] },
margins : [ 0, 14, 18, 14 ]
};
})() );
(function()
2009-10-10 00:15:12 -07:00
{
CKEDITOR.dialog ? dialogSetup() : CKEDITOR.on( 'dialogPluginReady', dialogSetup );
2009-10-10 00:15:12 -07:00
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;
if ( data.skin != 'v2' )
return;
2009-10-10 00:15:12 -07:00
contents.setStyles(
{
width : width + 'px',
height : height + 'px'
});
2009-10-10 00:15:12 -07:00
if ( !CKEDITOR.env.ie )
return;
2009-10-10 00:15:12 -07:00
// 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 );
2009-10-10 00:15:12 -07:00
// tc
var el = innerDialog.getChild( 2 );
el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
2009-10-10 00:15:12 -07:00
// bc
el = innerDialog.getChild( 7 );
el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
2009-10-10 00:15:12 -07:00
// ml
el = innerDialog.getChild( 4 );
el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
2009-10-10 00:15:12 -07:00
// mr
el = innerDialog.getChild( 5 );
el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
},
100 );
});
}
})();