Changeset 211
- Timestamp:
- 2007-03-14 17:44:50 (22 months ago)
- Location:
- FCKeditor/trunk
- Files:
-
- 3 modified
-
editor/_source/classes/fckenterkey.js (modified) (4 diffs)
-
editor/_source/internals/fcklisthandler.js (modified) (2 diffs)
-
_whatsnew.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/_source/classes/fckenterkey.js
r208 r211 180 180 if ( !previous && currentBlock.nodeName.IEquals( 'LI' ) && currentBlock.parentNode.parentNode.nodeName.IEquals( 'LI' ) ) 181 181 { 182 previous = currentBlock.parentNode.parentNode;183 currentBlock = FCKListHandler.OutdentListItem( currentBlock );182 this._OutdentWithSelection( currentBlock, range ) ; 183 return true ; 184 184 } 185 185 … … 197 197 if ( previous && currentBlock ) 198 198 { 199 // If we are in a LI, and the previous block is not an LI, we must 199 // If we are in a LI, and the previous block is not an LI, we must outdent it. 200 200 if ( currentBlock.nodeName.IEquals( 'LI' ) && !previous.nodeName.IEquals( 'LI' ) ) 201 currentBlock = FCKListHandler.OutdentListItem( currentBlock ) ; 202 201 { 202 this._OutdentWithSelection( currentBlock, range ) ; 203 return true ; 204 } 205 203 206 // Take a reference to the parent for post processing cleanup. 204 207 var oCurrentParent = currentBlock.parentNode ; … … 346 349 if ( bIsStartOfBlock && sStartBlockTag == 'LI' ) 347 350 { 348 var eOutdented = FCKListHandler.OutdentListItem( eStartBlock ) ; 349 oRange.MoveToElementEditStart( eOutdented ) ; 351 this._OutdentWithSelection( eStartBlock, oRange ) ; 352 oRange.Release() ; 353 return true ; 350 354 } 351 355 else … … 545 549 target = target.insertBefore( source.cloneNode( false ), target.firstChild ) ; 546 550 } 551 552 // Outdents a LI, maintaining the seletion defined on a range. 553 FCKEnterKey.prototype._OutdentWithSelection = function( li, range ) 554 { 555 var oBookmark = range.CreateBookmark() ; 556 557 FCKListHandler.OutdentListItem( li ) ; 558 559 range.MoveToBookmark( oBookmark ) ; 560 range.Select() ; 561 } -
FCKeditor/trunk/editor/_source/internals/fcklisthandler.js
r132 r211 99 99 } 100 100 101 var eBlock = oDocument.createElement( 'p' ) ; // TODO: Get from configuration.101 var eBlock = oDocument.createElement( FCKConfig.EnterMode == 'p' ? 'p' : 'div' ) ; 102 102 FCKDomTools.MoveChildren( eParent.removeChild( listItem ), eBlock ) ; 103 103 FCKDomTools.InsertAfterNode( eParent, eBlock ) ; 104 104 105 listItem = eBlock ; 105 if ( FCKConfig.EnterMode == 'br' ) 106 { 107 // We need the bogus to make it work properly. In Gecko, we 108 // need it before the new block, on IE, after it. 109 if ( FCKBrowserInfo.IsGecko ) 110 eBlock.parentNode.insertBefore( FCKTools.CreateBogusBR( oDocument ), eBlock ) ; 111 else 112 FCKDomTools.InsertAfterNode( eBlock, FCKTools.CreateBogusBR( oDocument ) ) ; 113 114 FCKDomTools.RemoveNode( eBlock, true ) ; 115 } 106 116 } 107 117 … … 109 119 FCKDomTools.RemoveNode( eParent, true ) ; 110 120 } 111 112 return listItem ;113 121 }, 114 122 -
FCKeditor/trunk/_whatsnew.html
r210 r211 113 113 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/209">#209</a>] Links and 114 114 images URLs will now be correctly preserved with Netscape 7.1.</li> 115 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/165">#165</a>] The enter 116 key now honors the EnterMode settings when outdenting a list item.</li> 115 117 </ul> 116 118 <h3>