Skip to content
Permalink
Browse files

Merge branch 't/11677'

  • Loading branch information...
Reinmar committed Mar 31, 2014
2 parents 32de5b6 + 0ba8eac commit 954f689ba6c56bffb30e8637ee426e4cdaa0a151
Showing with 17 additions and 12 deletions.
  1. +1 −0 CHANGES.md
  2. +2 −9 core/config.js
  3. +14 −3 plugins/undo/plugin.js
@@ -5,6 +5,7 @@ CKEditor 4 Changelog

Fixed Issues:

* [#11677](http://dev.ckeditor.com/ticket/11677): Fixed: undo/redo keystrokes are blocked in source mode.
* [#11717](http://dev.ckeditor.com/ticket/11717): [Docprops](http://ckeditor.com/addon/docprops) plugin requires the [Colordialog](http://ckeditor.com/addon/colordialog) plugin to work.

## CKEditor 4.3.4
@@ -333,22 +333,15 @@ CKEDITOR.config = {
* config.blockedKeystrokes = [
* CKEDITOR.CTRL + 66, // CTRL+B
* CKEDITOR.CTRL + 73, // CTRL+I
* CKEDITOR.CTRL + 85, // CTRL+U
* CKEDITOR.CTRL + 89, // CTRL+Y
* CKEDITOR.CTRL + 90, // CTRL+Z
* CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 // CTRL+SHIFT+Z
* CKEDITOR.CTRL + 85 // CTRL+U
* ];
*
* @cfg {Array} [blockedKeystrokes=see example]
*/
blockedKeystrokes: [
CKEDITOR.CTRL + 66, // CTRL+B
CKEDITOR.CTRL + 73, // CTRL+I
CKEDITOR.CTRL + 85, // CTRL+U

CKEDITOR.CTRL + 89, // CTRL+Y
CKEDITOR.CTRL + 90, // CTRL+Z
CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 // CTRL+SHIFT+Z
CKEDITOR.CTRL + 85 // CTRL+U
]
};

@@ -38,12 +38,23 @@
canUndo: false
} );

var keystrokes = [ CKEDITOR.CTRL + 90 /*Z*/, CKEDITOR.CTRL + 89 /*Y*/, CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 /*Z*/ ];

editor.setKeystroke( [
[ CKEDITOR.CTRL + 90 /*Z*/, 'undo' ],
[ CKEDITOR.CTRL + 89 /*Y*/, 'redo' ],
[ CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 /*Z*/, 'redo' ]
[ keystrokes[ 0 ], 'undo' ],
[ keystrokes[ 1 ], 'redo' ],
[ keystrokes[ 2 ], 'redo' ]
] );

// Block undo/redo keystrokes when at the bottom/top of the undo stack (#11126 and #11677).
editor.on( 'contentDom', function() {
var editable = editor.editable();
editable.attachListener( editable, 'keydown', function( evt ) {
if ( CKEDITOR.tools.indexOf( keystrokes, evt.data.getKeystroke() ) > -1 )
evt.data.preventDefault();
} );
} );

undoManager.onChange = function() {
undoCommand.setState( undoManager.undoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );
redoCommand.setState( undoManager.redoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );

0 comments on commit 954f689

Please sign in to comment.
You can’t perform that action at this time.