r105400 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105399‎ | r105400 | r105401 >
Date:01:10, 7 December 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Added support for inserting tab and newline characters
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
@@ -442,8 +442,16 @@
443443 };
444444
445445 es.SurfaceView.prototype.onKeyDown = function( e ) {
446 - var _this = this;
447446 switch ( e.keyCode ) {
 447+ // Tab
 448+ case 9:
 449+ if ( !e.metaKey && !e.ctrlKey && !e.altKey ) {
 450+ this.$input.val( '\t' );
 451+ this.handleInsert();
 452+ e.preventDefault();
 453+ return false;
 454+ }
 455+ return true;
448456 // Shift
449457 case 16:
450458 this.keyboard.keys.shift = true;
@@ -538,6 +546,12 @@
539547 break;
540548 // Enter
541549 case 13:
 550+ if ( this.keyboard.keys.shift ) {
 551+ this.$input.val( '\n' );
 552+ this.handleInsert();
 553+ e.preventDefault();
 554+ return false;
 555+ }
542556 this.handleEnter();
543557 e.preventDefault();
544558 break;

Status & tagging log