Changeset 2118 for FCKeditor/branches
- Timestamp:
- 2008-06-24 09:53:23 (5 months ago)
- Location:
- FCKeditor/branches/features/div_container/editor
- Files:
-
- 4 modified
-
lang/en.js (modified) (1 diff)
-
_source/commandclasses/fck_othercommands.js (modified) (1 diff)
-
_source/internals/fckcommands.js (modified) (1 diff)
-
_source/internals/fck_contextmenu.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/branches/features/div_container/editor/lang/en.js
r2103 r2118 75 75 CreateDiv : "Create DIV Container", 76 76 EditDiv : "Edit DIV Container", 77 DeleteDiv : "Remove DIV Container", 77 78 Undo : "Undo", 78 79 Redo : "Redo", -
FCKeditor/branches/features/div_container/editor/_source/commandclasses/fck_othercommands.js
r1731 r2118 517 517 } 518 518 }; 519 520 var FCKDeleteDivCommand = function() 521 { 522 } 523 FCKDeleteDivCommand.prototype = 524 { 525 GetState : function() 526 { 527 if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG ) 528 return FCK_TRISTATE_DISABLED ; 529 530 var node = FCKSelection.GetParentElement() ; 531 var path = new FCKElementPath( node ) ; 532 return path.BlockLimit && path.BlockLimit.nodeName.IEquals( 'div' ) ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ; 533 }, 534 535 Execute : function() 536 { 537 // Create an undo snapshot before doing anything. 538 FCKUndo.SaveUndoStep() ; 539 540 // Find out the node to delete. 541 var node = FCKSelection.GetParentElement() ; 542 var path = new FCKElementPath( node ) ; 543 node = path.BlockLimit ; 544 545 // Remember the current selection position. 546 var range = new FCKDomRange( FCK.EditorWindow ) ; 547 range.MoveToSelection() ; 548 var bookmark = range.CreateBookmark() ; 549 550 // Delete the container DIV node. 551 FCKDomTools.RemoveNode( node, true ) ; 552 553 // Restore selection. 554 range.MoveToBookmark( bookmark ) ; 555 range.Select() ; 556 } 557 } ; -
FCKeditor/branches/features/div_container/editor/_source/internals/fckcommands.js
r2103 r2118 97 97 case 'CreateDiv' : oCommand = new FCKDialogCommand( 'CreateDiv', FCKLang.CreateDiv, 'dialog/fck_div.html', 380, 210, null, null, true ) ; break ; 98 98 case 'EditDiv' : oCommand = new FCKDialogCommand( 'EditDiv', FCKLang.EditDiv, 'dialog/fck_div.html', 380, 210, null, null, false ) ; break ; 99 case 'DeleteDiv' : oCommand = new FCKDeleteDivCommand() ; break ; 99 100 100 101 case 'TableInsertRowAfter' : oCommand = new FCKTableCommand('TableInsertRowAfter') ; break ; -
FCKeditor/branches/features/div_container/editor/_source/internals/fck_contextmenu.js
r2103 r2118 303 303 menu.AddSeparator() ; 304 304 menu.AddItem( 'EditDiv', FCKLang.EditDiv, 73 ) ; 305 menu.AddItem( 'DeleteDiv', FCKLang.DeleteDiv, 73 ) ; 305 306 } 306 307 }} ;