Changeset 523

Show
Ignore:
Timestamp:
2007-07-25 02:23:29 (3 years ago)
Author:
martinkou
Message:

Simplified logic to retrive the HTML tag in fck.js.
Fix for #328 : Fixed the issue where the first line break immediately after a <pre> tag is chopped off after switching back and forth between Source and WYSIWYG mode.

Location:
FCKeditor/trunk/editor/_source/internals
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/internals/fck.js

    r496 r523  
    223223                // Call the Data Processor to generate the output data. 
    224224                var data = FCK.DataProcessor.ConvertToDataFormat( 
    225                         isFullPage ? oDoc.getElementsByTagName( 'html' )[0] : oDoc.body, 
     225                        isFullPage ? oDoc.documentElement : oDoc.body, 
    226226                        !isFullPage, 
    227227                        FCKConfig.IgnoreEmptyParagraphValue, 
  • FCKeditor/trunk/editor/_source/internals/fckxhtml.js

    r486 r523  
    392392        }, 
    393393 
     394        pre : function ( node, htmlNode) 
     395        { 
     396                for ( var i = 0 ; i < htmlNode.childNodes.length ; i++ ) 
     397                { 
     398                        var item = htmlNode.childNodes[i] ; 
     399                        var val = item.nodeValue ; 
     400                        if ( i == 0 ) 
     401                                val = "\r\n" + val ; 
     402                        if ( item.nodeType == 3 ) 
     403                                node.appendChild( FCKXHtml.XML.createTextNode( FCKXHtml._AppendSpecialItem( val ) ) ) ; 
     404                        else 
     405                                FCKXHtml._AppendNode( node, item ) ; 
     406                } 
     407                return node ; 
     408        }, 
     409 
    394410        title : function( node, htmlNode ) 
    395411        {