#2763: Undo/Redo system porting from v2
-------------------------+--------------------------------------------------
Reporter: garry.yao | Owner: garry.yao
Type: New Feature | Status: new
Priority: Normal | Milestone: CKEditor 3.0
Component: General | Version:
Keywords: Confirmed |
-------------------------+--------------------------------------------------
Undo/Redo system need to be ported from v2, the features could be summed
up as below:
* Undo system restore/retrieve document status from both selection and
content
* All commands that modify the document could support undo/redo
feature,but each command has chance to optionaly declare whether would
hooked with undo systemwhen they're registed.
'''Note''': Since from v3 all keystroke will pre-bind to
command, so keystrokes also hooked with undo system through command
interface.
* Undo feature itself performed as a command, A button plugin is required
for interfacing this command to end user and keystroke pair of 'Ctrl-Z'
and 'Ctrl-Y' too.
* Support empty/reset all the undo snapshots for clean up, and A button
plugin is required for interfacing this ''reset''
* snapshot for undo system could be recorded in two forms:
1. One snapshot for each record action, this apply for almost every
functional commands, but a few special keystroke commands that also being
recorded in this way including:
a. 'Enter'
a. 'ShiftEnter'
a. 'CtrlBackspace'
a. 'Delete'
a. 'Tab'
a. 'Ctrl-X'
a. 'Ctrl-V'
2. One snapshot for a serials of record actions, this apply for most
keystroke commands.
Test cases ported from #915 :
*
{{{
1. Select text, change style, undo
Expected results:
- text style restored,
- selection restored.
2a. Type one ANSI charater in the editor after it's loaded
Expected results:
- undo button is enabled,
- undo can be performed by clicking the toolbar button
- undo can be performed by Ctrl-Z
2b. Undo once
Expected results:
- redo button is enabled,
- redo can be performed by clicking the toolbar button
- redo can be performed by Ctrl-Y
- previous contents restored
- previous caret position restored
2c. Redo once
Expected results:
- undo button is enabled,
- undo can be performed by clicking the toolbar button
- undo can be performed by Ctrl-Z
- changed contents restored
- changed caret position restored
3. Type more than 25 ANSI characters in the editor
Expected results:
- One undo level should be generated for every 25 characters typed
4. Pressing Ctrl-Z repeatedly after the undo button greyed out
Expected results:
- Nothing visible happens
- Undo/redo system should still work normally afterwards
5. Pressing Ctrl-Y repeatedly after the redo button greyed out
Expected results:
- Nothing visible happens
- Undo/redo system should still work normally afterwards
6a. Select some text, Ctrl-X, repeat N times
Expected results:
- The selected text blocks are cut
6b. Undo once
Expected results:
- The last cut operation was restored
- The selection or caret position was restored
6c. Undo N-1 times
Expected results:
- The cut operations were restored in a step-by-step manner
- The selections or caret positions in each step were restored
7. Repeat 6a-6c with Del and Ctrl-V
8a. Toolbar commands that change the document
Procedure:
- Select a toolbar command that changes the document (e.g. insert
smiley)
- Carry out the neccessary steps to make the change effective (e.g.
choose smiley, ok)
Expected results:
- One undo step is generated after the change
- Ctrl-Z or clicking "Undo" undoes the change
- Ctrl-Y or clicking "Redo" after the previous point redoes the change
8b. Repeat the "procedure" part of 8a to repeat the same change to the
document N times
Expected results:
- N undo steps are generated after the changes
- Ctrl-Z/Undo button and Ctrl-Y/Redo button would undo/redo the changes
in a stepwise manner
9a. Pressing Ctrl-Z breaks the undo/redo system
}}}
--
Ticket URL: <http://dev.fckeditor.net/ticket/2763>
FCKeditor <http://www.fckeditor.net/>
The text editor for Internet
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac