r112168 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112167‎ | r112168 | r112169 >
Date:00:08, 23 February 2012
Author:inez
Status:deferred
Tags:
Comment:
Use flag 'isime' to correctly detect keyboard input in firefox.
Modified paths:
  • /trunk/extensions/VisualEditor/playground/playground.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/playground/playground.js
@@ -43,14 +43,14 @@
4444 };
4545
4646 app.prototype.onKeyPress = function() {
47 - console.log("onKeyPress");
 47+ //console.log("onKeyPress");
4848 };
4949
5050 app.prototype.onKeyUp = function() {
5151 //console.log("onKeyUp");
5252 if ( this.inime ) {
5353 this.inime = false;
54 - console.log("inime = false");
 54+ //console.log("inime = false");
5555 }
5656 };
5757
@@ -59,7 +59,7 @@
6060 //console.log("onKeyDown");
6161 if ( e.which === 229 ) {
6262 this.inime = true;
63 - console.log("inime = true");
 63+ //console.log("inime = true");
6464 }
6565 };
6666
@@ -79,7 +79,7 @@
8080 //console.log(text);
8181
8282 if(this.keydown || this.inime) {
83 - //console.log("change from keyboard");
 83+ console.log("change from keyboard");
8484 // we are going to need a cursor position
8585 var selection = rangy.getSelection();
8686 var offset = this.getOffset( selection.anchorNode, selection.anchorOffset );
@@ -87,14 +87,11 @@
8888 //console.log("diffLength: " + diffLength);
8989
9090 if ( diffLength > 0 ) {
91 - console.log( text.substring(offset - diffLength, offset) );
 91+ //console.log( text.substring(offset - diffLength, offset) );
9292 } else if ( diffLength === 0 ) {
93 - console.log( text.substring(offset - 1, offset) );
 93+ //console.log( text.substring(offset - 1, offset) );
9494 }
95 -
96 -
97 -
98 -
 95+
9996 } else {
10097 console.log("change not from keyboard");
10198 // find a change and commit to the model

Status & tagging log