Changeset 400

Show
Ignore:
Timestamp:
2007-06-29 14:24:58 (17 months ago)
Author:
martinkou
Message:

Fixed #915 : All recognized bugs in the undo/redo system are fixed and all features are working in both Internet Explorer and Gecko.

Location:
FCKeditor/trunk
Files:
1 added
2 removed
5 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/fckeditor.html

    r302 r400  
    8282LoadScript( '_source/internals/fckxhtml_' + sSuffix + '.js' ) ; 
    8383LoadScript( '_source/internals/fckcodeformatter.js' ) ; 
    84 LoadScript( '_source/internals/fckundo_' + sSuffix + '.js' ) ; 
     84LoadScript( '_source/internals/fckundo.js' ) ; 
    8585LoadScript( '_source/classes/fckeditingarea.js' ) ; 
    8686LoadScript( '_source/classes/fckkeystrokehandler.js' ) ; 
  • FCKeditor/trunk/editor/_source/internals/fck_gecko.js

    r398 r400  
    2525 
    2626FCK.Description = "FCKeditor for Gecko Browsers" ; 
    27  
    28 FCK._KeyDownUndo = function() 
    29 { 
    30         if ( !FCKUndo.Typing ) 
    31         { 
    32                 FCKUndo.SaveUndoStep() ; 
    33                 FCKUndo.Typing = true ; 
    34                 FCK.Events.FireEvent( "OnSelectionChange" ) ; 
    35         } 
    36  
    37         FCKUndo.TypesCount++ ; 
    38         FCKUndo.Changed = 1; 
    39  
    40         if ( FCKUndo.TypesCount > FCKUndo.MaxTypes ) 
    41         { 
    42                 FCKUndo.TypesCount = 0 ; 
    43                 FCKUndo.SaveUndoStep() ; 
    44         } 
    45 } 
    46  
    47 FCK._IsFunctionKey = function(keyCode) 
    48 { 
    49         // keys that are captured but do not change editor contents 
    50         if (keyCode >= 16 && keyCode <= 20) 
    51                 // shift, ctrl, alt, pause, capslock 
    52                 return true; 
    53         if (keyCode == 27 || (keyCode >= 33 && keyCode <= 40)) 
    54                 // esc, page up, page down, end, home, left, up, right, down 
    55                 return true; 
    56         if (keyCode == 45) 
    57                 // insert, no effect on FCKeditor, yet 
    58                 return true; 
    59         return false; 
    60 } 
    61  
    62 FCK._KeyDownListener = function( evt ) 
    63 { 
    64         if ( FCK.EditorWindow ) 
    65         { 
    66                 if ( !FCK._IsFunctionKey(evt.keyCode) // do not capture function key presses, like arrow keys or shift/alt/ctrl 
    67                         && !(evt.ctrlKey || evt.metaKey) // do not capture Ctrl hotkeys, as they have their snapshot capture logic 
    68                         && !(evt.keyCode == 46) ) // do not capture Del, it has its own capture logic in fckenterkey.js 
    69                         FCK._KeyDownUndo(); 
    70         } 
    71         return true; 
    72 } 
    7327 
    7428FCK.InitializeBehaviors = function() 
  • FCKeditor/trunk/editor/_source/internals/fck_ie.js

    r371 r400  
    7777} 
    7878 
    79 function Doc_OnKeyDown() 
    80 { 
    81         if ( FCK.EditorWindow ) 
    82         { 
    83                 var e = FCK.EditorWindow.event ; 
    84  
    85                 if ( !( e.keyCode >=16 && e.keyCode <= 18 ) ) 
    86                         Doc_OnKeyDownUndo() ; 
    87         } 
    88         return true ; 
    89 } 
    90  
    91 function Doc_OnKeyDownUndo() 
    92 { 
    93         if ( !FCKUndo.Typing ) 
    94         { 
    95                 FCKUndo.SaveUndoStep() ; 
    96                 FCKUndo.Typing = true ; 
    97                 FCK.Events.FireEvent( "OnSelectionChange" ) ; 
    98         } 
    99  
    100         FCKUndo.TypesCount++ ; 
    101  
    102         if ( FCKUndo.TypesCount > FCKUndo.MaxTypes ) 
    103         { 
    104                 FCKUndo.TypesCount = 0 ; 
    105                 FCKUndo.SaveUndoStep() ; 
    106         } 
    107 } 
    108  
    10979function Doc_OnDblClick() 
    11080{ 
     
    137107                        window.FCKTabHTML += "&nbsp;" ; 
    138108        } 
    139         this.EditorDocument.attachEvent("onkeydown", Doc_OnKeyDown ) ; 
     109        this.EditorDocument.attachEvent("onkeydown", FCK._KeyDownListener ) ; 
    140110 
    141111        this.EditorDocument.attachEvent("ondblclick", Doc_OnDblClick ) ; 
  • FCKeditor/trunk/editor/_source/internals/fck.js

    r398 r400  
    625625        _InsertBlockElement : function( blockElement ) 
    626626        { 
     627        }, 
     628 
     629        _IsFunctionKey : function(keyCode) 
     630        { 
     631                // keys that are captured but do not change editor contents 
     632                if (keyCode >= 16 && keyCode <= 20) 
     633                        // shift, ctrl, alt, pause, capslock 
     634                        return true; 
     635                if (keyCode == 27 || (keyCode >= 33 && keyCode <= 40)) 
     636                        // esc, page up, page down, end, home, left, up, right, down 
     637                        return true; 
     638                if (keyCode == 45) 
     639                        // insert, no effect on FCKeditor, yet 
     640                        return true; 
     641                return false; 
     642        }, 
     643 
     644        _KeyDownListener : function( evt ) 
     645        { 
     646                if (! evt) 
     647                        evt = FCK.EditorWindow.event; 
     648                if ( FCK.EditorWindow ) 
     649                { 
     650                        if ( !FCK._IsFunctionKey(evt.keyCode) // do not capture function key presses, like arrow keys or shift/alt/ctrl 
     651                                        && !(evt.ctrlKey || evt.metaKey) // do not capture Ctrl hotkeys, as they have their snapshot capture logic 
     652                                        && !(evt.keyCode == 46) ) // do not capture Del, it has its own capture logic in fckenterkey.js 
     653                                FCK._KeyDownUndo(); 
     654                } 
     655                return true; 
     656        }, 
     657 
     658        _KeyDownUndo : function() 
     659        { 
     660                if ( !FCKUndo.Typing ) 
     661                { 
     662                        FCKUndo.SaveUndoStep() ; 
     663                        FCKUndo.Typing = true ; 
     664                        FCK.Events.FireEvent( "OnSelectionChange" ) ; 
     665                } 
     666 
     667                FCKUndo.TypesCount++ ; 
     668                FCKUndo.Changed = 1; 
     669 
     670                if ( FCKUndo.TypesCount > FCKUndo.MaxTypes ) 
     671                { 
     672                        FCKUndo.TypesCount = 0 ; 
     673                        FCKUndo.SaveUndoStep() ; 
     674                } 
    627675        } 
    628676} ; 
  • FCKeditor/trunk/_whatsnew.html

    r388 r400  
    3535                New Features and Improvements:</p> 
    3636        <ul> 
     37                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/915">#915</a>] The undo/redo system has been 
     38                        revamped to work the same across Internet Explorer and Gecko-based browsers (e.g. Firefox). A number 
     39                        of critical bugs in the undo/redo system are also fixed.</li> 
    3740                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/194">#194</a>] The editor 
    3841                        now uses the <strong>Data Processor</strong> technology, which makes it possible