Ticket #5559: 5559_5.patch

File 5559_5.patch, 2.1 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    289289                                                if ( iframe )
    290290                                                        iframe.remove();
    291291
    292                                                 frameLoaded = 0;
    293292
    294293                                                var setDataFn = !CKEDITOR.env.gecko && CKEDITOR.tools.addFunction( function( doc )
    295294                                                        {
     
    304303                                                        // call document.open().
    305304                                                        ( isCustomDomain ? ( 'document.domain="' + document.domain + '";' ) : '' ) +
    306305
    307                                                         ( ( 'parent.CKEDITOR.tools.callFunction(' + setDataFn + ',document);' ) ) +
    308 
    309306                                                        'document.close();';
    310307
    311308                                                iframe = CKEDITOR.dom.element.createFromHtml( '<iframe' +
    312309                                                        ' style="width:100%;height:100%"' +
    313310                                                        ' frameBorder="0"' +
    314311                                                        ' title="' + frameLabel + '"' +
    315                                                         // With FF, the 'src' attribute should be left empty to
     312                                                        // With IE, the custom domain has to be taken care at first,
     313                                                        // for other browers, the 'src' attribute should be left empty to
    316314                                                        // trigger iframe's 'load' event.
    317                                                         ' src="' + ( CKEDITOR.env.gecko ? '' : 'javascript:void(function(){' + encodeURIComponent( srcScript ) + '}())' ) + '"' +
     315                                                        ' src="' + ( CKEDITOR.env.ie ? 'javascript:void(function(){' + encodeURIComponent( srcScript ) + '}())' : '' ) + '"' +
    318316                                                        ' tabIndex="' + editor.tabIndex + '"' +
    319317                                                        ' allowTransparency="true"' +
    320318                                                        '></iframe>' );
    321319
    322320                                                // With FF, it's better to load the data on iframe.load. (#3894,#4058)
    323                                                 CKEDITOR.env.gecko && iframe.on( 'load', function( ev )
     321                                                iframe.on( 'load', function( ev )
    324322                                                        {
     323                                                                frameLoaded = 1;
    325324                                                                ev.removeListener();
    326325
    327326                                                                var doc = iframe.getFrameDocument().$;
     
    345344                                        // Editing area bootstrap code.
    346345                                        var contentDomReady = function( domWindow )
    347346                                        {
    348                                                 if ( frameLoaded )
     347                                                if ( !frameLoaded )
    349348                                                        return;
    350                                                 frameLoaded = 1;
     349                                                frameLoaded = 0;
    351350
    352351                                                editor.fire( 'ariaWidget', iframe );
    353352
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy