1 | /*
|
---|
2 | Copyright (c) 2003-2010, 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 | (function()
|
---|
27 | {
|
---|
28 | CKEDITOR.dialog ? dialogSetup() : CKEDITOR.on( 'dialogPluginReady', dialogSetup );
|
---|
29 |
|
---|
30 | function dialogSetup()
|
---|
31 | {
|
---|
32 | CKEDITOR.dialog.on( 'resize', function( evt )
|
---|
33 | {
|
---|
34 | var data = evt.data,
|
---|
35 | width = data.width,
|
---|
36 | height = data.height,
|
---|
37 | dialog = data.dialog,
|
---|
38 | contents = dialog.parts.contents;
|
---|
39 |
|
---|
40 | if ( data.skin != 'office2003' )
|
---|
41 | return;
|
---|
42 |
|
---|
43 | contents.setStyles(
|
---|
44 | {
|
---|
45 | width : width + 'px',
|
---|
46 | height : height + 'px'
|
---|
47 | });
|
---|
48 |
|
---|
49 | if ( !CKEDITOR.env.ie )
|
---|
50 | return;
|
---|
51 |
|
---|
52 | // Fix the size of the elements which have flexible lengths.
|
---|
53 | var fixSize = function()
|
---|
54 | {
|
---|
55 | var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ),
|
---|
56 | body = innerDialog.getChild( 0 );
|
---|
57 |
|
---|
58 | // tc
|
---|
59 | var el = innerDialog.getChild( 2 );
|
---|
60 | el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
|
---|
61 |
|
---|
62 | // bc
|
---|
63 | el = innerDialog.getChild( 7 );
|
---|
64 | el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
|
---|
65 |
|
---|
66 | // ml
|
---|
67 | el = innerDialog.getChild( 4 );
|
---|
68 | el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
|
---|
69 |
|
---|
70 | // mr
|
---|
71 | el = innerDialog.getChild( 5 );
|
---|
72 | el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
|
---|
73 | };
|
---|
74 | setTimeout( fixSize, 100 );
|
---|
75 |
|
---|
76 | // Ensure size is correct for RTL mode. (#4003)
|
---|
77 | if ( evt.editor.lang.dir == 'rtl' )
|
---|
78 | setTimeout( fixSize, 1000 );
|
---|
79 | });
|
---|
80 | }
|
---|
81 | })();
|
---|