Ticket #1853: 1853_2.patch

File 1853_2.patch, 2.8 kB (added by martinkou, 7 months ago)
  • _whatsnew.html

     
    9292                        opened.</li> 
    9393                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2024">#2024</a>] Fixed 
    9494                        JavaScript error in IE when the user tries to open dialogs in Source mode.</li> 
     95                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1853">#1853</a>] Setting 
     96                        ShiftEnterMode to p or div now works correctly when EnterMode is br.</li> 
    9597        </ul> 
    9698        <h3> 
    9799                Version 2.6 Beta 1</h3> 
  • editor/_source/classes/fckdomrange.js

     
    755755         * and the PreviousBlock value will be null. The same is valid for the 
    756756         * NextBlock value if the range was at the end of the block. 
    757757         */ 
    758         SplitBlock : function() 
     758        SplitBlock : function( forceBlockTag ) 
    759759        { 
     760                var blockTag = forceBlockTag || FCKConfig.EnterMode ; 
     761 
    760762                if ( !this._Range ) 
    761763                        this.MoveToSelection() ; 
    762764 
     
    768770                        var eEndBlock           = this.EndBlock ; 
    769771                        var oElementPath        = null ; 
    770772 
    771                         if ( FCKConfig.EnterMode != 'br' ) 
     773                        if ( blockTag != 'br' ) 
    772774                        { 
    773775                                if ( !eStartBlock ) 
    774776                                { 
    775                                         eStartBlock = this.FixBlock( true ) ; 
     777                                        eStartBlock = this.FixBlock( true, blockTag ) ; 
    776778                                        eEndBlock       = this.EndBlock ;       // FixBlock may have fixed the EndBlock too. 
    777779                                } 
    778780 
    779781                                if ( !eEndBlock ) 
    780                                         eEndBlock = this.FixBlock( false ) ; 
     782                                        eEndBlock = this.FixBlock( false, blockTag ) ; 
    781783                        } 
    782784 
    783785                        // Get the range position. 
     
    840842        }, 
    841843 
    842844        // Transform a block without a block tag in a valid block (orphan text in the body or td, usually). 
    843         FixBlock : function( isStart ) 
     845        FixBlock : function( isStart, blockTag ) 
    844846        { 
    845847                // Bookmark the range so we can restore it later. 
    846848                var oBookmark = this.CreateBookmark() ; 
     
    852854                this.Expand( 'block_contents' ) ; 
    853855 
    854856                // Create the fixed block. 
    855                 var oFixedBlock = this.Window.document.createElement( FCKConfig.EnterMode ) ; 
     857                var oFixedBlock = this.Window.document.createElement( blockTag ) ; 
    856858 
    857859                // Move the contents of the temporary range to the fixed block. 
    858860                this.ExtractContents().AppendTo( oFixedBlock ) ; 
  • editor/_source/classes/fckenterkey.js

     
    398398        // Get the current selection. 
    399399        var oRange = range || new FCKDomRange( this.Window ) ; 
    400400 
    401         var oSplitInfo = oRange.SplitBlock() ; 
     401        var oSplitInfo = oRange.SplitBlock( blockTag ) ; 
    402402 
    403403        if ( oSplitInfo ) 
    404404        {