Changeset 1081

Show
Ignore:
Timestamp:
2007-11-15 06:19:37 (2 years ago)
Author:
martinkou
Message:

Fix for #102 : Fixed excessive empty paragraphs generated in IE the paste as plain text feature in P mode.

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

Legend:

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

    r874 r1081  
    284284                sText = FCKTools.ProcessLineBreaks( window, FCKConfig, sText ) ; 
    285285 
     286                var closeTagIndex = sText.search( '</p>' ) ; 
     287                var startTagIndex = sText.search( '<p>' ) ; 
     288 
     289                if ( ( closeTagIndex != -1 && startTagIndex != -1 && closeTagIndex < startTagIndex )  
     290                                || ( closeTagIndex != -1 && startTagIndex == -1 ) ) 
     291                { 
     292                        var prefix = sText.substr( 0, closeTagIndex ) ; 
     293                        sText = sText.substr( closeTagIndex + 4 ) ; 
     294                        this.InsertHtml( prefix ) ; 
     295                } 
     296 
    286297                // Insert the resulting data in the editor. 
     298                FCKUndo.SaveLocked = true ; 
    287299                this.InsertHtml( sText ) ; 
     300                FCKUndo.SaveLocked = false ; 
    288301        } 
    289302} 
  • FCKeditor/trunk/editor/_source/internals/fckundo.js

    r969 r1081  
    2828FCKUndo.MaxTypes = 25 ; 
    2929FCKUndo.Typing = false ; 
     30FCKUndo.SaveLocked = false ; 
    3031 
    3132FCKUndo._GetBookmark = function() 
     
    115116FCKUndo.SaveUndoStep = function() 
    116117{ 
    117         if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG ) 
     118        if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG || this.SaveLocked ) 
    118119                return ; 
    119120