fix benchmark.

This commit is contained in:
Christopher Jeffrey
2013-08-11 05:30:04 -05:00
parent 15f6833598
commit 791127bc88
4 changed files with 64 additions and 23 deletions
+8 -6
View File
@@ -525,7 +525,7 @@ Terminal.prototype.open = function(parent) {
: null;
// Does IE9 do this?
if (~navigator.userAgent.indexOf('MSIE')) {
if (self.isMSIE) {
button = button === 1 ? 0 : button === 4 ? 1 : button;
}
@@ -559,6 +559,11 @@ Terminal.prototype.open = function(parent) {
this.element.style.backgroundColor = Terminal.defaultColors.bg;
this.element.style.color = Terminal.defaultColors.fg;
if (this.context.navigator && this.context.navigator.userAgent) {
this.isMac = !!~this.context.navigator.userAgent.indexOf('Mac');
this.isMSIE = !!~this.context.navigator.userAgent.indexOf('MSIE');
}
// this.emit('open');
};
@@ -753,7 +758,7 @@ Terminal.prototype.bindMouse = function() {
? ev.which - 1
: null;
if (~navigator.userAgent.indexOf('MSIE')) {
if (self.isMSIE) {
button = button === 1 ? 0 : button === 4 ? 1 : button;
}
break;
@@ -2343,7 +2348,7 @@ Terminal.prototype.keyDown = function(ev) {
// ^] - group sep
key = String.fromCharCode(29);
}
} else if ((!isMac && ev.altKey) || (isMac && ev.metaKey)) {
} else if ((!this.isMac && ev.altKey) || (this.isMac && ev.metaKey)) {
if (ev.keyCode >= 65 && ev.keyCode <= 90) {
key = '\x1b' + String.fromCharCode(ev.keyCode + 32);
} else if (ev.keyCode === 192) {
@@ -4417,8 +4422,6 @@ function inherits(child, parent) {
child.prototype = new f;
}
var isMac = ~navigator.userAgent.indexOf('Mac');
// if bold is broken, we can't
// use it in the terminal.
function isBoldBroken(document) {
@@ -4506,7 +4509,6 @@ matchColor.distance = function(r1, g1, b1, r2, g2, b2) {
*/
Terminal.EventEmitter = EventEmitter;
Terminal.isMac = isMac;
Terminal.inherits = inherits;
Terminal.on = on;
Terminal.off = off;