source: trunk/phpgwapi/js/ckeditor/_source/skins/v2/skin.js @ 2862

Revision 2862, 1.9 KB checked in by rodsouza, 14 years ago (diff)

Ticket #663 - Atualizando e centralizando o CKEditor (v. 3.2.1)

Line 
1/*
2Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
3For licensing, see LICENSE.html or http://ckeditor.com/license
4*/
5
6CKEDITOR.skins.add( 'v2', (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 != 'v2' )
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                                setTimeout( 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                                        100 );
75                        });
76        }
77})();
Note: See TracBrowser for help on using the repository browser.