public/ckeditor/_source/plugins/undo/plugin.js
function( event )
		{
			var keystroke = event && event.data.getKey(),
				isModifierKey = keystroke in modifierKeyCodes,
				isEditingKey = keystroke in editingKeyCodes,
				wasEditingKey = this.lastKeystroke in editingKeyCodes,
				sameAsLastEditingKey = isEditingKey && keystroke == this.lastKeystroke,
				// Keystrokes which navigation through contents.
				isReset = keystroke in navigationKeyCodes,
				wasReset = this.lastKeystroke in navigationKeyCodes,

				// Keystrokes which just introduce new contents.
				isContent = ( !isEditingKey && !isReset ),

				// Create undo snap for every different modifier key.
				modifierSnapshot = ( isEditingKey && !sameAsLastEditingKey ),
				// Create undo snap on the following cases:
				// 1. Just start to type .
				// 2. Typing some content after a modifier.
				// 3. Typing some content after make a visible selection.
				startedTyping = !( isModifierKey || this.typing )
					|| ( isContent && ( wasEditingKey || wasReset ) );

			if ( startedTyping || modifierSnapshot )
			{
				var beforeTypeImage = new Image( this.editor );

				// Use setTimeout, so we give the necessary time to the
				// browser to insert the character into the DOM.
				CKEDITOR.tools.setTimeout( function()
					{
						var currentSnapshot = this.editor.getSnapshot();

						// In IE, we need to remove the expando attributes.
						if ( CKEDITOR.env.ie )
							currentSnapshot = currentSnapshot.replace( /\s+data-cke-expando=".*?"/g, '' );

						if ( beforeTypeImage.contents != currentSnapshot )
						{
							// It's safe to now indicate typing state.
							this.typing = true;

							// This's a special save, with specified snapshot
							// and without auto 'fireChange'.
							if ( !this.save( false, beforeTypeImage, false ) )
								// Drop future snapshots.
								this.snapshots.splice( this.index + 1, this.snapshots.length - this.index - 1 );

							this.hasUndo = true;
							this.hasRedo = false;

							this.typesCount = 1;
							this.modifiersCount = 1;

							this.onChange();
						}
					},
					0, this
				);
			}

			this.lastKeystroke = keystroke;

			// Create undo snap after typed too much (over 25 times).
			if ( isEditingKey )
			{
				this.typesCount = 0;
				this.modifiersCount++;

				if ( this.modifiersCount > 25 )
				{
					this.save( false, null, false );
					this.modifiersCount = 1;
				}
			}
			else if ( !isReset )
			{
				this.modifiersCount = 0;
				this.typesCount++;

				if ( this.typesCount > 25 )
				{
					this.save( false, null, false );
					this.typesCount = 1;
				}
			}

		}
function( event )
		{
			var keystroke = event && event.data.getKey(),
				isModifierKey = keystroke in modifierKeyCodes,
				isEditingKey = keystroke in editingKeyCodes,
				wasEditingKey = this.lastKeystroke in editingKeyCodes,
				sameAsLastEditingKey = isEditingKey && keystroke == this.lastKeystroke,
				// Keystrokes which navigation through contents.
				isReset = keystroke in navigationKeyCodes,
				wasReset = this.lastKeystroke in navigationKeyCodes,

				// Keystrokes which just introduce new contents.
				isContent = ( !isEditingKey && !isReset ),

				// Create undo snap for every different modifier key.
				modifierSnapshot = ( isEditingKey && !sameAsLastEditingKey ),
				// Create undo snap on the following cases:
				// 1. Just start to type .
				// 2. Typing some content after a modifier.
				// 3. Typing some content after make a visible selection.
				startedTyping = !( isModifierKey || this.typing )
					|| ( isContent && ( wasEditingKey || wasReset ) );

			if ( startedTyping || modifierSnapshot )
			{
				var beforeTypeImage = new Image( this.editor );

				// Use setTimeout, so we give the necessary time to the
				// browser to insert the character into the DOM.
				CKEDITOR.tools.setTimeout( function()
					{
						var currentSnapshot = this.editor.getSnapshot();

						// In IE, we need to remove the expando attributes.
						if ( CKEDITOR.env.ie )
							currentSnapshot = currentSnapshot.replace( /\s+data-cke-expando=".*?"/g, '' );

						if ( beforeTypeImage.contents != currentSnapshot )
						{
							// It's safe to now indicate typing state.
							this.typing = true;

							// This's a special save, with specified snapshot
							// and without auto 'fireChange'.
							if ( !this.save( false, beforeTypeImage, false ) )
								// Drop future snapshots.
								this.snapshots.splice( this.index + 1, this.snapshots.length - this.index - 1 );

							this.hasUndo = true;
							this.hasRedo = false;

							this.typesCount = 1;
							this.modifiersCount = 1;

							this.onChange();
						}
					},
					0, this
				);
			}

			this.lastKeystroke = keystroke;

			// Create undo snap after typed too much (over 25 times).
			if ( isEditingKey )
			{
				this.typesCount = 0;
				this.modifiersCount++;

				if ( this.modifiersCount > 25 )
				{
					this.save( false, null, false );
					this.modifiersCount = 1;
				}
			}
			else if ( !isReset )
			{
				this.modifiersCount = 0;
				this.typesCount++;

				if ( this.typesCount > 25 )
				{
					this.save( false, null, false );
					this.typesCount = 1;
				}
			}

		}
function ( event ) { var keystroke = event && event . data . getKey ( ) , isModifierKey = keystroke in modifierKeyCodes , isEditingKey = keystroke in editingKeyCodes , wasEditingKey = this . lastKeystroke in editingKeyCodes , sameAsLastEditingKey = isEditingKey && keystroke == this . lastKeystroke , // Keystrokes which navigation through contents.
 isReset = keystroke in navigationKeyCodes , wasReset = this . lastKeystroke in navigationKeyCodes , // Keystrokes which just introduce new contents.
 isContent = ( ! isEditingKey && ! isReset ) , // Create undo snap for every different modifier key.
 modifierSnapshot = ( isEditingKey && ! sameAsLastEditingKey ) , // Create undo snap on the following cases:
 // 1. Just start to type .
 // 2. Typing some content after a modifier.
 // 3. Typing some content after make a visible selection.
 startedTyping = ! ( isModifierKey || this . typing ) || ( isContent && ( wasEditingKey || wasReset ) ) ; if ( startedTyping || modifierSnapshot ) { var beforeTypeImage = new Image ( this . editor ) ; // Use setTimeout, so we give the necessary time to the
 // browser to insert the character into the DOM.
 CKEDITOR . tools . setTimeout ( function ( ) { var currentSnapshot = this . editor . getSnapshot ( ) ; // In IE, we need to remove the expando attributes.
 if ( CKEDITOR . env . ie ) currentSnapshot = currentSnapshot . replace ( / \s+data-cke-expando=".*?" / g , '' ) ; if ( beforeTypeImage . contents != currentSnapshot ) { // It's safe to now indicate typing state.
 this . typing = true ; // This's a special save, with specified snapshot
 // and without auto 'fireChange'.
 if ( ! this . save ( false , beforeTypeImage , false ) ) // Drop future snapshots.
 this . snapshots . splice ( this . index + 1 , this . snapshots . length - this . index - 1 ) ; this . hasUndo = true ; this . hasRedo = false ; this . typesCount = 1 ; this . modifiersCount = 1 ; this . onChange ( ) ; } } , 0 , this ) ; } this . lastKeystroke = keystroke ; // Create undo snap after typed too much (over 25 times).
 if ( isEditingKey ) { this . typesCount = 0 ; this . modifiersCount ++ ; if ( this . modifiersCount > 25 ) { this . save ( false , null , false ) ; this . modifiersCount = 1 ; } } else if ( ! isReset ) { this . modifiersCount = 0 ; this . typesCount ++ ; if ( this . typesCount > 25 ) { this . save ( false , null , false ) ; this . typesCount = 1 ; } } }
Process undo system regard keystrikes.
@param {CKEDITOR.dom.event} event
Process undo system regard keystrikes .