Ticket #3174: 3174_3.patch

File 3174_3.patch, 2.1 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/panel/plugin.js

     
    114114
    115115                                var className = iframe.getParent().getParent().getAttribute( 'class' );
    116116
     117                                var win = doc.getWindow();
     118
     119                                win.on( 'load', function( ev )
     120                                        {
     121                                                if( CKEDITOR.env.ff2 )
     122                                                {
     123                                                        var i, l = this.css.length;
     124                                                        for ( i = 0;  i < l;  i++ ) {
     125                                                                doc.appendStyleSheet( this.css[ i ] );
     126                                                        }
     127                                                }
     128                                                //  TODO: Examine stylesheet ready state instead of hard-coded timeout.
     129                                                CKEDITOR.tools.setTimeout( function(){
     130                                                        this.isLoaded = true;
     131                                                        if ( this.onLoad )
     132                                                                this.onLoad();
     133                                                }, CKEDITOR.env.ff2? 100 : 0, this );
     134                                        },
     135                                        this);
     136
    117137                                // Initialize the IFRAME document body.
    118138                                doc.$.open();
    119139                                doc.$.write(
     
    120140                                        '<!DOCTYPE html>' +
    121141                                        '<html>' +
    122142                                                '<head>' +
    123                                                         '<link type="text/css" rel=stylesheet href="' + this.css.join( '"><link type="text/css" rel="stylesheet" href="' ) + '">' +
     143                                                        // Styles loading come later for Firefox 2
     144                                                        ( !CKEDITOR.env.ff2? '<link type="text/css" rel=stylesheet href="'
     145                                                        + this.css.join( '"><link type="text/css" rel="stylesheet" href="' ) + '">' : '' )+
    124146                                                        '<style>.' + className + '_container{visibility:hidden}</style>' +
    125147                                                '</head>' +
    126148                                                '<body class="' + className + '_container cke_panel_frame" style="margin:0;padding:0">' +
     
    127149                                                '</body>' +
    128150                                        '<\/html>' );
    129151                                doc.$.close();
    130 
    131                                 var win = doc.getWindow();
    132 
     152                               
    133153                                // Register the CKEDITOR global.
    134154                                win.$.CKEDITOR = CKEDITOR;
    135155
    136                                 win.on( 'load', function( ev )
    137                                         {
    138                                                 this.isLoaded = true;
    139                                                 if ( this.onLoad )
    140                                                         this.onLoad();
    141                                         },
    142                                         this);
    143 
    144156                                doc.on( 'keydown', function( evt )
    145157                                        {
    146158                                                var keystroke = evt.data.getKeystroke();
     
    298310                }
    299311        }
    300312});
     313
     314// Firefox2.x version detect.
     315CKEDITOR.env.ff2 = CKEDITOR.env.gecko && CKEDITOR.env.version < 109000;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy