Changeset 2103

Show
Ignore:
Timestamp:
2008-06-23 09:46:09 (7 months ago)
Author:
martinkou
Message:

Added context menu item for editing div containers.

Location:
FCKeditor/branches/features/div_container
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/branches/features/div_container/editor/dialog/fck_div.html

    r2102 r2103  
    102102function Ok() 
    103103{ 
    104         dialog.Selection.EnsureSelection() ; 
     104        oEditor.FCKUndo.SaveUndoStep() ; 
    105105 
    106106        if ( !ActiveEl ) 
     
    130130        setValue( 'dir', 'selLangDir' ) ; 
    131131 
     132        var styleName = GetE( 'selStyle' ).value ; 
     133        var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ; 
     134        range.SetStart( ActiveEl, 3 ) ; 
     135        range.SetEnd( ActiveEl, 4 ) ; 
     136        if ( styleName ) 
     137                FCKStyles.GetStyle( styleName ).ApplyToRange( range, false, true ) ; 
     138 
    132139        return true ; 
    133140} 
     
    147154                                        <span fcklang="DlgDivStyle">Style</span><br /> 
    148155                                        <select id="selStyle" style="width: 100%;"> 
     156                                                <option value="">&nbsp; 
    149157                                        </select> 
    150158                                </td> 
  • FCKeditor/branches/features/div_container/editor/lang/en.js

    r2102 r2103  
    7373IncreaseIndent          : "Increase Indent", 
    7474Blockquote                      : "Blockquote", 
    75 Div                             : "Div", 
     75CreateDiv                       : "Create DIV Container", 
     76EditDiv                         : "Edit DIV Container", 
    7677Undo                            : "Undo", 
    7778Redo                            : "Redo", 
  • FCKeditor/branches/features/div_container/editor/_source/internals/fckcommands.js

    r2102 r2103  
    9595                case 'Outdent'  : oCommand = new FCKIndentCommand( 'outdent', FCKConfig.IndentLength * -1 ) ; break ; 
    9696                case 'Blockquote'       : oCommand = new FCKBlockContainerCommand( 'blockquote' ) ; break ; 
    97                 case 'CreateDiv'        : oCommand = new FCKDialogCommand( 'CreateDiv', FCKLang.Div, 'dialog/fck_div.html', 380, 210, null, null, true ) ; break ; 
    98                 case 'EditDiv'          : oCommand = new FCKDialogCommand( 'EditDiv', FCKLang.Div, 'dialog/fck_div.html', 380, 210, null, null, false ) ; break ; 
     97                case 'CreateDiv'        : oCommand = new FCKDialogCommand( 'CreateDiv', FCKLang.CreateDiv, 'dialog/fck_div.html', 380, 210, null, null, true ) ; break ; 
     98                case 'EditDiv'          : oCommand = new FCKDialogCommand( 'EditDiv', FCKLang.EditDiv, 'dialog/fck_div.html', 380, 210, null, null, false ) ; break ; 
    9999 
    100100                case 'TableInsertRowAfter'              : oCommand = new FCKTableCommand('TableInsertRowAfter') ; break ; 
  • FCKeditor/branches/features/div_container/editor/_source/internals/fck_contextmenu.js

    r1602 r2103  
    293293                                } 
    294294                        }} ; 
     295 
     296                case 'DivContainer': 
     297                        return { 
     298                        AddItems : function( menu, tag, tagName ) 
     299                        { 
     300                                var path = new FCKElementPath( FCKSelection.GetParentElement() ) ; 
     301                                if ( path.BlockLimit && path.BlockLimit.nodeName.IEquals( 'div' ) ) 
     302                                { 
     303                                        menu.AddSeparator() ; 
     304                                        menu.AddItem( 'EditDiv', FCKLang.EditDiv, 73 ) ; 
     305                                } 
     306                        }} ; 
     307                         
    295308                // @Packager.Remove.Start 
    296309                default : 
  • FCKeditor/branches/features/div_container/fckconfig.js

    r2102 r2103  
    143143] ; 
    144144 
    145 FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','Table','Form'] ; 
     145FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','Table','Form','DivContainer'] ; 
    146146FCKConfig.BrowserContextMenuOnCtrl = false ; 
    147147