Ticket #6187: 6187_3.patch

File 6187_3.patch, 5.5 KB (added by Tobiasz Cudnik, 14 years ago)
  • _source/core/_bootstrap.js

     
    6666                }
    6767        });
    6868
    69 /*
    70 TODO: Enable the following and check if effective.
    71 
     69// Needed for IE6 to not request image (HTTP 200 or 304) for every CSS background. (#6187)
    7270if ( CKEDITOR.env.ie )
    7371{
    7472        // Remove IE mouse flickering on IE6 because of background images.
     
    8280                // line. For safety, let's just ignore errors.
    8381        }
    8482}
    85 */
    8683
    8784/**
    8885 * Fired when a CKEDITOR core object is fully loaded and ready for interaction.
  • _source/core/skins.js

     
    5555                }
    5656
    5757                // Check if we need to preload images from it.
    58                 if ( !preloaded[ skinName ] )
    59                 {
    60                         var preload = skinDefinition.preload;
    61                         if ( preload && preload.length > 0 )
    62                         {
     58                var preload = skinDefinition.preload;
     59                if ( preload && preload.length > 0 )
     60                {
     61                        if ( !preloaded[ skinName ] )
     62                        {
     63                                // Prepare image URLs
    6364                                appendSkinPath( preload );
    64                                 CKEDITOR.imageCacher.load( preload, function()
    65                                         {
    66                                                 preloaded[ skinName ] = 1;
     65
     66                                // Get preloader event dispatcher object.
     67                                preloaded[ skinName ] = CKEDITOR.imageCacher.load( preload );
     68                        }
     69
     70                        if ( !preloaded[ skinName ].finished )
     71                        {
     72                                // Bind listener for this editor instance.
     73                                preloaded[ skinName ].on( 'preloaded', function()
     74                                        {
    6775                                                loadPart( editor, skinName, part, callback );
    68                                         } );
    69                                 return;
    70                         }
     76                                        }
     77                                );
    7178
    72                         // Mark it as preloaded.
    73                         preloaded[ skinName ] = 1;
    74                 }
     79                                // Execution will be continued from event listener.
     80                                return;
     81                        }
     82                }
    7583
    7684                // Get the part definition.
    7785                part = skinDefinition[ part ];
  • _source/skins/v2/skin.js

     
    77{
    88        var preload = [];
    99
    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 
    1710        return {
    1811                preload         : preload,
    1912                editor          : { css : [ 'editor.css' ] },
  • _source/skins/office2003/skin.js

     
    77{
    88        var preload = [];
    99
    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 
    1710        return {
    1811                preload         : preload,
    1912                editor          : { css : [ 'editor.css' ] },
  • _source/core/loader.js

     
    5959                        'core/htmlparser/cdata'         : [ 'core/htmlparser' ],
    6060                        'core/htmlparser/filter'        : [ 'core/htmlparser' ],
    6161                        'core/htmlparser/basicwriter': [ 'core/htmlparser' ],
    62                         'core/imagecacher'              : [ 'core/dom/element' ],
     62                        'core/imagecacher'              : [ 'core/dom/element', 'core/event' ],
    6363                        'core/lang'                             : [],
    6464                        'core/plugins'                  : [ 'core/resourcemanager' ],
    6565                        'core/resourcemanager'  : [ 'core/scriptloader', 'core/tools' ],
  • _source/skins/kama/skin.js

     
    88        var preload = [],
    99                uiColorStylesheetId = 'cke_ui_color';
    1010
    11         if ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 )
    12         {
    13                 // For IE6, we need to preload some images, otherwhise they will be
    14                 // downloaded several times (CSS background bug).
    15                 preload.push( 'icons.png', 'images/sprites_ie6.png', 'images/dialog_sides.gif' );
    16         }
    17 
    1811        return {
    1912                preload         : preload,
    2013                editor          : { css : [ 'editor.css' ] },
  • _source/core/imagecacher.js

     
    3232                /**
    3333                 * Loads one or more images.
    3434                 * @param {Array} images The URLs for the images to be loaded.
    35                  * @param {Function} callback The function to be called once all images
    36                  *              are loaded.
     35                 * @param {Function} callback The optional function to be called once all images
     36                 *              are loaded. You can bind any function to the returned event object.
     37                 * @return {CKEDITOR.event} Event object which fires 'preloaded' event when all images finished.
     38                 *    Additionally it set "finished" property flag after 'preloaded' event.
    3739                 */
    3840                load : function( images, callback )
    3941                {
    4042                        var pendingCount = images.length;
    4143
     44                        var event = new CKEDITOR.event;
     45                        event.on( 'preloaded', function()
     46                        {
     47                                event.finished = true;
     48                        });
     49                       
     50                        if ( callback )
     51                                event.on( 'preloaded', callback );
     52
    4253                        var checkPending = function()
    4354                        {
    4455                                if ( --pendingCount === 0 )
    45                                         callback();
     56                                        event.fire( 'preloaded' );
    4657                        };
    4758
    4859                        for ( var i = 0 ; i < images.length ; i++ )
     
    5465                                else
    5566                                        loadImage( image, checkPending );
    5667                        }
     68
     69                        return event;
    5770                }
    5871        };
    5972})();
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy