Ticket #4930: 4930.patch

File 4930.patch, 8.4 KB (added by Frederico Caldeira Knabben, 14 years ago)
  • _source/skins/kama/skin.js

     
    203203        };
    204204})() );
    205205
    206 CKEDITOR.on( 'dialogPluginReady', function()
     206(function()
    207207{
    208         CKEDITOR.dialog.on( 'resize', function( evt )
    209                 {
    210                         var data = evt.data,
    211                                 width = data.width,
    212                                 height = data.height,
    213                                 dialog = data.dialog,
    214                                 contents = dialog.parts.contents;
     208        CKEDITOR.dialog ? dialogSetup() : CKEDITOR.on( 'dialogPluginReady', dialogSetup );
    215209
    216                         if ( data.skin != 'kama' )
    217                                 return;
     210        function dialogSetup()
     211        {
     212                CKEDITOR.dialog.on( 'resize', function( evt )
     213                        {
     214                                var data = evt.data,
     215                                        width = data.width,
     216                                        height = data.height,
     217                                        dialog = data.dialog,
     218                                        contents = dialog.parts.contents;
    218219
    219                         contents.setStyles(
    220                                 {
    221                                         width : width + 'px',
    222                                         height : height + 'px'
    223                                 });
     220                                if ( data.skin != 'kama' )
     221                                        return;
    224222
    225                         // Fix the size of the elements which have flexible lengths.
    226                         setTimeout( function()
    227                                 {
    228                                         var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ),
    229                                                 body = innerDialog.getChild( 0 );
     223                                contents.setStyles(
     224                                        {
     225                                                width : width + 'px',
     226                                                height : height + 'px'
     227                                        });
    230228
    231                                         // tc
    232                                         var el = innerDialog.getChild( 2 );
    233                                         el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
     229                                // Fix the size of the elements which have flexible lengths.
     230                                setTimeout( function()
     231                                        {
     232                                                var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ),
     233                                                        body = innerDialog.getChild( 0 );
    234234
    235                                         // bc
    236                                         el = innerDialog.getChild( 7 );
    237                                         el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
     235                                                // tc
     236                                                var el = innerDialog.getChild( 2 );
     237                                                el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
    238238
    239                                         // ml
    240                                         el = innerDialog.getChild( 4 );
    241                                         el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
     239                                                // bc
     240                                                el = innerDialog.getChild( 7 );
     241                                                el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
    242242
    243                                         // mr
    244                                         el = innerDialog.getChild( 5 );
    245                                         el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
    246                                 },
    247                                 100 );
    248                 } );
    249 } );
     243                                                // ml
     244                                                el = innerDialog.getChild( 4 );
     245                                                el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
    250246
     247                                                // mr
     248                                                el = innerDialog.getChild( 5 );
     249                                                el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
     250                                        },
     251                                        100 );
     252                        });
     253        }
     254})();
     255
    251256/**
    252257 * The base user interface color to be used by the editor. Not all skins are
    253258 * compatible with this setting.
  • _source/skins/office2003/skin.js

     
    2323        };
    2424})() );
    2525
    26 CKEDITOR.on( 'dialogPluginReady', function()
     26(function()
    2727{
    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                                 contents = dialog.parts.contents;
     28        CKEDITOR.dialog ? dialogSetup() : CKEDITOR.on( 'dialogPluginReady', dialogSetup );
    3529
    36                         if ( data.skin != 'office2003' )
    37                                 return;
     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;
    3839
    39                         contents.setStyles(
    40                                 {
    41                                         width : width + 'px',
    42                                         height : height + 'px'
    43                                 });
     40                                if ( data.skin != 'office2003' )
     41                                        return;
    4442
    45                         if ( !CKEDITOR.env.ie )
    46                                 return;
     43                                contents.setStyles(
     44                                        {
     45                                                width : width + 'px',
     46                                                height : height + 'px'
     47                                        });
    4748
    48                         // Fix the size of the elements which have flexible lengths.
    49                         var fixSize = function()
    50                                 {
    51                                         var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ),
    52                                                 body = innerDialog.getChild( 0 );
     49                                if ( !CKEDITOR.env.ie )
     50                                        return;
    5351
    54                                         // tc
    55                                         var el = innerDialog.getChild( 2 );
    56                                         el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
     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 );
    5757
    58                                         // bc
    59                                         el = innerDialog.getChild( 7 );
    60                                         el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
     58                                                // tc
     59                                                var el = innerDialog.getChild( 2 );
     60                                                el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
    6161
    62                                         // ml
    63                                         el = innerDialog.getChild( 4 );
    64                                         el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
     62                                                // bc
     63                                                el = innerDialog.getChild( 7 );
     64                                                el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
    6565
    66                                         // mr
    67                                         el = innerDialog.getChild( 5 );
    68                                         el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
    69                                 };
    70                         setTimeout( fixSize, 100 );
     66                                                // ml
     67                                                el = innerDialog.getChild( 4 );
     68                                                el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
    7169
    72                         // Ensure size is correct for RTL mode. (#4003)
    73                         if ( evt.editor.lang.dir == 'rtl' )
    74                                 setTimeout( fixSize, 1000 );
    75                 } );
    76 } );
     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})();
  • _source/skins/v2/skin.js

     
    2323        };
    2424})() );
    2525
    26 CKEDITOR.on( 'dialogPluginReady', function()
     26(function()
    2727{
    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                                 contents = dialog.parts.contents;
     28        CKEDITOR.dialog ? dialogSetup() : CKEDITOR.on( 'dialogPluginReady', dialogSetup );
    3529
    36                         if ( data.skin != 'v2' )
    37                                 return;
     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;
    3839
    39                         contents.setStyles(
    40                                 {
    41                                         width : width + 'px',
    42                                         height : height + 'px'
    43                                 });
     40                                if ( data.skin != 'v2' )
     41                                        return;
    4442
    45                         if ( !CKEDITOR.env.ie )
    46                                 return;
     43                                contents.setStyles(
     44                                        {
     45                                                width : width + 'px',
     46                                                height : height + 'px'
     47                                        });
    4748
    48                         // Fix the size of the elements which have flexible lengths.
    49                         setTimeout( function()
    50                                 {
    51                                         var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ),
    52                                                 body = innerDialog.getChild( 0 );
     49                                if ( !CKEDITOR.env.ie )
     50                                        return;
    5351
    54                                         // tc
    55                                         var el = innerDialog.getChild( 2 );
    56                                         el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
     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 );
    5757
    58                                         // bc
    59                                         el = innerDialog.getChild( 7 );
    60                                         el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
     58                                                // tc
     59                                                var el = innerDialog.getChild( 2 );
     60                                                el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
    6161
    62                                         // ml
    63                                         el = innerDialog.getChild( 4 );
    64                                         el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
     62                                                // bc
     63                                                el = innerDialog.getChild( 7 );
     64                                                el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
    6565
    66                                         // mr
    67                                         el = innerDialog.getChild( 5 );
    68                                         el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
    69                                 },
    70                                 100 );
    71                 } );
    72 } );
     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})();
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy