Ticket #3174: 3174.patch

File 3174.patch, 1.9 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                                // Register the CKEDITOR global.
     120                                win.$.CKEDITOR = CKEDITOR;
     121
     122                                win.on( 'load', function( ev )
     123                                        {
     124                                                var i, l = this.css.length;
     125                                                for ( i = 0;  i < l;  i++ ) {
     126                                                        doc.appendStyleSheet( this.css[ i ] );
     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                                                }, 100, 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//                                                      '<link type="text/css" rel=stylesheet href="' + this.css.join( '"><link type="text/css" rel="stylesheet" href="' ) + '">' +
    124144                                                        '<style>.' + className + '_container{visibility:hidden}</style>' +
    125145                                                '</head>' +
    126146                                                '<body class="' + className + '_container cke_panel_frame" style="margin:0;padding:0">' +
     
    128148                                        '<\/html>' );
    129149                                doc.$.close();
    130150
    131                                 var win = doc.getWindow();
    132 
    133                                 // Register the CKEDITOR global.
    134                                 win.$.CKEDITOR = CKEDITOR;
    135 
    136                                 win.on( 'load', function( ev )
    137                                         {
    138                                                 this.isLoaded = true;
    139                                                 if ( this.onLoad )
    140                                                         this.onLoad();
    141                                         },
    142                                         this);
    143 
    144151                                doc.on( 'keydown', function( evt )
    145152                                        {
    146153                                                var keystroke = evt.data.getKeystroke();
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy