Ticket #3401: 3401_2.patch

File 3401_2.patch, 2.9 KB (added by garry.yao, 2 years ago)
  • _source/plugins/image/dialogs/image.js

     
    145145 
    146146        var imageDialog = function( editor, dialogType ) 
    147147        { 
     148                var previewPreloader; 
     149 
    148150                var onImgLoadEvent = function() 
    149151                { 
    150152                        // Image is ready. 
     
    358360                                var doc = this._.element.getDocument(); 
    359361                                this.addFocusable( doc.getById( 'btnResetSize' ), 5 ); 
    360362                                this.addFocusable( doc.getById( 'btnLockSizes' ), 5 ); 
     363                                previewPreloader = new CKEDITOR.dom.element( 'img', editor.document ) 
    361364                        }, 
    362365                        onHide : function() 
    363366                        { 
     
    422425                                                                                                        original.on( 'error', onImgLoadErrorEvent, dialog ); 
    423426                                                                                                        original.on( 'abort', onImgLoadErrorEvent, dialog ); 
    424427                                                                                                        original.setAttribute( 'src', newUrl ); 
    425                                                                                                         dialog.preview.setAttribute( 'src', newUrl ); 
    426  
     428                                                                                                        // Query the preloader to figure out the url impacted by based href. 
     429                                                                                                        previewPreloader.setAttribute( 'src', newUrl ); 
     430                                                                                                        dialog.preview.setAttribute( 'src', previewPreloader.$.src ); 
    427431                                                                                                        updatePreview( dialog ); 
    428432                                                                                                } 
    429433                                                                                                // Dont show preview if no URL given. 
  • _source/plugins/flash/dialogs/flash.js

     
    173173                var makeObjectTag = !editor.config.flashEmbedTagOnly, 
    174174                        makeEmbedTag = editor.config.flashAddEmbedTag || editor.config.flashEmbedTagOnly; 
    175175 
    176                 var previewAreaHtml = '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.image.preview ) +'<br>' + 
     176                var previewPreloader, 
     177                        previewAreaHtml = '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.image.preview ) +'<br>' + 
    177178                        '<div id="FlashPreviewLoader" style="display:none"><div class="loading">&nbsp;</div></div>' + 
    178179                        '<div id="FlashPreviewBox"></div></div>'; 
    179180 
     
    279280                                        editor.insertElement( newFakeImage ); 
    280281                        }, 
    281282 
     283                        onLoad : function () 
     284                        { 
     285                                previewPreloader = new CKEDITOR.dom.element( 'img', editor.document ) 
     286                        }, 
     287 
    282288                        onHide : function() 
    283289                        { 
    284290                                if ( this.preview ) 
     
    318324                                                                                        { 
    319325                                                                                                var dialog = this.getDialog(), 
    320326                                                                                                updatePreview = function( src ){ 
    321  
     327                                                                                                        // Query the preloader to figure out the url impacted by based href. 
     328                                                                                                        previewPreloader.setAttribute( 'src', src ); 
    322329                                                                                                        dialog.preview.setHtml( '<embed height="100%" width="100%" src="' 
    323                                                                                                                 + CKEDITOR.tools.htmlEncode( src ) 
     330                                                                                                                + CKEDITOR.tools.htmlEncode( previewPreloader.$.src ) 
    324331                                                                                                                + '" type="application/x-shockwave-flash"></embed>' ); 
    325332                                                                                                }; 
    326333                                                                                                // Preview element 
© 2003 – 2011 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy