r103867 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103866‎ | r103867 | r103868 >
Date:23:25, 21 November 2011
Author:inez
Status:deferred
Tags:
Comment:
Bind ctrl+z to history undo and ctrl+y to history redo.
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js
@@ -351,6 +351,16 @@
352352 this.handleEnter();
353353 e.preventDefault();
354354 break;
 355+ case 90: // z (undo)
 356+ if ( e.ctrlKey ) {
 357+ this.history.undo();
 358+ break;
 359+ }
 360+ case 89: // y (redo)
 361+ if ( e.ctrlKey ) {
 362+ this.history.redo();
 363+ break;
 364+ }
355365 default: // Insert content (maybe)
356366 if ( this.keyboard.keydownTimeout ) {
357367 clearTimeout( this.keyboard.keydownTimeout );
@@ -462,7 +472,7 @@
463473 nodeOffset + node.getElementLength(),
464474 [ { 'type': 'paragraph' }, { 'type': '/paragraph' } ]
465475 );
466 - this.documentView.model.commit( tx );
 476+ this.history.commit( tx );
467477 this.selection.from = this.selection.to = nodeOffset + node.getElementLength() + 1;
468478 this.showCursor();
469479 } else {
@@ -489,7 +499,7 @@
490500 splitable = es.DocumentView.splitRules[ elementType ].self;
491501 } );
492502 var tx = this.documentView.model.prepareInsertion( this.selection.to, stack );
493 - this.documentView.model.commit( tx );
 503+ this.history.commit( tx );
494504 this.selection.from = this.selection.to =
495505 this.documentView.getModel().getRelativeContentOffset( this.selection.to, 1 );
496506 this.showCursor();

Status & tagging log