1 | /*
|
---|
2 | Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
|
---|
3 | For licensing, see LICENSE.html or http://ckeditor.com/license
|
---|
4 | */
|
---|
5 |
|
---|
6 | CKEDITOR.skins.add( 'office2003', (function()
|
---|
7 | {
|
---|
8 | var preload = [];
|
---|
9 |
|
---|
10 | if ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 )
|
---|
11 | {
|
---|
12 | // For IE6, we need to preload some images, otherwhise they will be
|
---|
13 | // downloaded several times (CSS background bug).
|
---|
14 | preload.push( 'icons.png', 'images/sprites_ie6.png', 'images/dialog_sides.gif' );
|
---|
15 | }
|
---|
16 |
|
---|
17 | return {
|
---|
18 | preload : preload,
|
---|
19 | editor : { css : [ 'editor.css' ] },
|
---|
20 | dialog : { css : [ 'dialog.css' ] },
|
---|
21 | templates : { css : [ 'templates.css' ] },
|
---|
22 | margins : [ 0, 14, 18, 14 ]
|
---|
23 | };
|
---|
24 | })() );
|
---|
25 |
|
---|
26 | if ( CKEDITOR.dialog )
|
---|
27 | {
|
---|
28 | CKEDITOR.dialog.on( 'resize', function( evt )
|
---|
29 | {
|
---|
30 | var data = evt.data,
|
---|
31 | width = data.width,
|
---|
32 | height = data.height,
|
---|
33 | dialog = data.dialog,
|
---|
34 | standardsMode = !CKEDITOR.env.quirk;
|
---|
35 |
|
---|
36 | if ( data.skin != 'office2003' )
|
---|
37 | return;
|
---|
38 |
|
---|
39 | dialog.parts.contents.setStyles(
|
---|
40 | {
|
---|
41 | width : width + 'px',
|
---|
42 | height : height + 'px'
|
---|
43 | });
|
---|
44 |
|
---|
45 | if ( !CKEDITOR.env.ie )
|
---|
46 | return;
|
---|
47 |
|
---|
48 | // Fix the size of the elements which have flexible lengths.
|
---|
49 | var fixSize = function()
|
---|
50 | {
|
---|
51 | var content = dialog.parts.contents,
|
---|
52 | body = content.getParent(),
|
---|
53 | innerDialog = body.getParent();
|
---|
54 |
|
---|
55 | // tc
|
---|
56 | var el = innerDialog.getChild( 2 );
|
---|
57 | el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
|
---|
58 |
|
---|
59 | // bc
|
---|
60 | el = innerDialog.getChild( 7 );
|
---|
61 | el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
|
---|
62 |
|
---|
63 | // ml
|
---|
64 | el = innerDialog.getChild( 4 );
|
---|
65 | el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
|
---|
66 |
|
---|
67 | // mr
|
---|
68 | el = innerDialog.getChild( 5 );
|
---|
69 | el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
|
---|
70 | };
|
---|
71 | setTimeout( fixSize, 100 );
|
---|
72 |
|
---|
73 | // Ensure size is correct for RTL mode. (#4003)
|
---|
74 | if ( evt.editor.lang.dir == 'rtl' )
|
---|
75 | setTimeout( fixSize, 1000 );
|
---|
76 | });
|
---|
77 | }
|
---|