Changeset 1950

Show
Ignore:
Timestamp:
2008-05-05 04:55:34 (3 months ago)
Author:
martinkou
Message:

Fixed #1633 : External styles should no longer interfere with the appearance of the editor and floating panels now.

Location:
FCKeditor/trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/classes/fckeditingarea.js

    r1922 r1950  
    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 ) 
  • FCKeditor/trunk/editor/_source/classes/fckpanel.js

    r1805 r1950  
    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                        { 
     
    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 ) ; 
     
    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 ; 
  • FCKeditor/trunk/editor/_source/internals/fckdialog.js

    r1944 r1950  
    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                /** 
     
    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 
     
    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                                { 
     
    196187                        { 
    197188                                var iframe = topDocument.createElement( 'iframe' ) ; 
    198                                 resetStyles( iframe ) ; 
     189                                FCKTools.ResetStyles( iframe ) ; 
    199190                                iframe.hideFocus = true ; 
    200191                                iframe.frameBorder = 0 ; 
  • FCKeditor/trunk/editor/_source/internals/fck.js

    r1803 r1950  
    11761176        } 
    11771177} 
     1178 
     1179/* 
     1180 * #1633 : Protect the editor iframe from external styles. 
     1181 * Notice that we can't use FCKTools.ResetStyles here since FCKTools isn't 
     1182 * loaded yet. 
     1183 */ 
     1184(function() 
     1185{ 
     1186        var el = window.frameElement ; 
     1187        var width = el.width ; 
     1188        var height = el.height ; 
     1189        if ( /^\d+$/.test( width ) ) width += 'px' ; 
     1190        if ( /^\d+$/.test( height ) ) height += 'px' ; 
     1191        var style = el.style ; 
     1192        style.border = style.padding = style.margin = 0 ; 
     1193        style.backgroundColor = 'transparent'; 
     1194        style.backgroundImage = 'none'; 
     1195        style.width = width ; 
     1196        style.height = height ; 
     1197})() ; 
  • FCKeditor/trunk/editor/_source/internals/fcktools.js

    r1717 r1950  
    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/trunk/_whatsnew.html

    r1947 r1950  
    6363                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2136">#2136</a>] Fixed JavaScript error in IE  
    6464                        when opening the bullet list properties dialog.</li> 
     65                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1633">#1633</a>] External styles should no 
     66                        longer interfere with the appearance of the editor and floating panels now.</li> 
    6567        </ul> 
    6668        <h3>