Changeset 2106

Show
Ignore:
Timestamp:
2008-06-23 11:24:09 (5 months ago)
Author:
fredck
Message:

Fixed #2287 : On some specific cases, with Firefox 2, some extra spacing was appearing in the final HTML on posting, if inserting two successive tables. Additionally, block elements (like tables or horizontal rules) will be inserted correctly now when the cursor is at the start or the end of blocks. No extra paragraphs will be included in this operation.

Location:
FCKeditor/trunk
Files:
3 modified

Legend:

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

    r1928 r2106  
    869869                FCKDomTools.TrimNode( oFixedBlock ) ; 
    870870 
     871                // If the fixed block is empty (not counting bookmark nodes) 
     872                // Add a <br /> inside to expand it. 
     873                if ( FCKDomTools.CheckIsEmptyElement(oFixedBlock, function( element ) { return element.getAttribute('_fck_bookmark') != 'true' ; } ) 
     874                                && FCKBrowserInfo.IsGeckoLike ) 
     875                                FCKTools.AppendBogusBr( oFixedBlock ) ; 
     876 
    871877                // Insert the fixed block into the DOM. 
    872878                this.InsertNode( oFixedBlock ) ; 
  • FCKeditor/trunk/editor/_source/internals/fck.js

    r1984 r2106  
    674674                var range = new FCKDomRange( this.EditorWindow ) ; 
    675675 
     676                // Move to the selection and delete it. 
     677                range.MoveToSelection() ; 
     678                range.DeleteContents() ; 
     679 
    676680                if ( FCKListsLib.BlockElements[ elementName ] != null ) 
    677681                { 
    678                         range.SplitBlock() ; 
     682                        if ( range.StartBlock ) 
     683                        { 
     684                                if ( range.CheckStartOfBlock() ) 
     685                                        range.MoveToPosition( range.StartBlock, 3 ) ; 
     686                                else if ( range.CheckEndOfBlock() ) 
     687                                        range.MoveToPosition( range.StartBlock, 4 ) ; 
     688                                else 
     689                                        range.SplitBlock() ; 
     690                        } 
     691 
    679692                        range.InsertNode( element ) ; 
    680693 
     
    706719                else 
    707720                { 
    708                         // Delete the current selection and insert the node. 
    709                         range.MoveToSelection() ; 
    710                         range.DeleteContents() ; 
     721                        // Insert the node. 
    711722                        range.InsertNode( element ) ; 
    712723 
  • FCKeditor/trunk/_whatsnew.html

    r2097 r2106  
    6565                        with querystring parameters were not being accepted for CSS values in the configuration 
    6666                        file (like EditorAreaCSS).</li> 
     67                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2287">#2287</a>] On some 
     68                        specific cases, with Firefox 2, some extra spacing was appearing in the final HTML 
     69                        on posting, if inserting two successive tables.</li> 
     70                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2287">#2287</a>] Block 
     71                        elements (like tables or horizontal rules) will be inserted correctly now when the 
     72                        cursor is at the start or the end of blocks. No extra paragraphs will be included 
     73                        in this operation.</li> 
    6774        </ul> 
    6875        <p>