Ticket #1633: 1633_pre.patch

File 1633_pre.patch, 4.8 KB (added by Martin Kou, 16 years ago)
  • editor/_source/classes/fckeditingarea.js

     
    9797                var sOverrideError = '<script type="text/javascript" _fcktemp="true">window.onerror=function(){return true;};</script>' ;
    9898
    9999                oIFrame.frameBorder = 0 ;
    100                 oIFrame.width = oIFrame.height = '100%' ;
     100                oIFrame.style.width = oIFrame.style.height = '100%' ;
    101101
    102102                if ( FCK_IS_CUSTOM_DOMAIN && FCKBrowserInfo.IsIE )
    103103                {
  • editor/_source/classes/fckpanel.js

     
    6666        else
    6767        {
    6868                var oIFrame = this._IFrame = this._Window.document.createElement('iframe') ;
     69                FCKTools.ResetStyles( oIFrame );
    6970                oIFrame.src                                     = 'javascript:void(0)' ;
    7071                oIFrame.allowTransparency       = true ;
    7172                oIFrame.frameBorder                     = '0' ;
    7273                oIFrame.scrolling                       = 'no' ;
    73                 oIFrame.width = oIFrame.height = 0 ;
     74                oIFrame.style.width = oIFrame.style.height = '0px' ;
    7475                FCKDomTools.SetElementStyles( oIFrame,
    7576                        {
    7677                                position        : 'absolute',
     
    279280                        {
    280281                                var iWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ;
    281282                                var iHeight = eMainNode.offsetHeight ;
    282                                 me._IFrame.width = iWidth ;
    283                                 me._IFrame.height = iHeight ;
     283                                me._IFrame.style.width = iWidth + 'px' ;
     284                                me._IFrame.style.height = iHeight + 'px' ;
    284285
    285286                        }, 0 ) ;
    286287
     
    305306
    306307                // It is better to set the sizes to 0, otherwise Firefox would have
    307308                // rendering problems.
    308                 this._IFrame.width = this._IFrame.height = 0 ;
     309                this._IFrame.style.width = this._IFrame.style.height = '0px' ;
    309310
    310311                this._IsOpened = false ;
    311312
  • editor/_source/internals/fckdialog.js

     
    7575                        } ) ;
    7676        }
    7777
    78         var resetStyles = function( element )
    79         {
    80                 element.style.cssText = 'margin:0;' +
    81                         'padding:0;' +
    82                         'border:0;' +
    83                         'background-color:transparent;' +
    84                         'background-image:none;' ;
    85         }
    86 
    8778        return {
    8879                /**
    8980                 * Opens a dialog window using the standard dialog template.
     
    113104
    114105                        // Setup the IFRAME that will hold the dialog.
    115106                        var dialog = topDocument.createElement( 'iframe' ) ;
    116                         resetStyles( dialog ) ;
     107                        FCKTools.ResetStyles( dialog ) ;
    117108                        dialog.src = FCKConfig.BasePath + 'fckdialog.html' ;
    118109
    119110                        // Dummy URL for testing whether the code in fckdialog.js alone leaks memory.
     
    179170                {
    180171                        // Setup the DIV that will be used to cover.
    181172                        cover = topDocument.createElement( 'div' ) ;
    182                         resetStyles( cover ) ;
     173                        FCKTools.ResetStyles( cover ) ;
    183174                        FCKDomTools.SetElementStyles( cover,
    184175                                {
    185176                                        'position' : 'absolute',
     
    195186                        if ( FCKBrowserInfo.IsIE && !FCKBrowserInfo.IsIE7 )
    196187                        {
    197188                                var iframe = topDocument.createElement( 'iframe' ) ;
    198                                 resetStyles( iframe ) ;
     189                                FCKTools.ResetStyles( iframe ) ;
    199190                                iframe.hideFocus = true ;
    200191                                iframe.frameBorder = 0 ;
    201192                                iframe.src = FCKTools.GetVoidUrl() ;
  • editor/_source/internals/fcktools.js

     
    738738
    739739        return "javascript: void(0);" ;         // All other browsers.
    740740}
     741
     742FCKTools.ResetStyles = function( element )
     743{
     744        element.style.cssText = 'margin:0;' +
     745                'padding:0;' +
     746                'border:0;' +
     747                'background-color:transparent;' +
     748                'background-image:none;' ;
     749}
  • fckeditor.js

     
    160160        var sLink = this.BasePath + 'editor/' + sFile + '?InstanceName=' + encodeURIComponent( this.InstanceName ) ;
    161161        if (this.ToolbarSet) sLink += '&amp;Toolbar=' + this.ToolbarSet ;
    162162
    163         return '<iframe id="' + this.InstanceName + '___Frame" src="' + sLink + '" width="' + this.Width + '" height="' + this.Height + '" frameborder="0" scrolling="no"></iframe>' ;
     163        /^[0-9]+$/.test( this.Width ) && ( this.Width += 'px' ) ;
     164        /^[0-9]+$/.test( this.Height ) && ( this.Height += 'px' ) ;
     165        return '<iframe id="' + this.InstanceName + '___Frame" src="' + sLink + '" style="width:' + this.Width + '; height:' + this.Height + '\
     166                ;border: 0; padding: 0; margin: 0;" frameborder="0" scrolling="no"></iframe>' ;
    164167}
    165168
    166169FCKeditor.prototype._IsCompatibleBrowser = function()
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy