Browse files

add glevel methods and eventemitter calls.

  • Loading branch information...
1 parent db64632 commit 2a6668379c3220a7c351439c1d53fe07ca9387cd @chjj committed Jun 15, 2012
Showing with 16 additions and 0 deletions.
  1. +14 −0 static/term.js
  2. +2 −0 static/tty.js
View
14 static/term.js
@@ -105,6 +105,8 @@ var normal = 0
*/
function Terminal(cols, rows, handler) {
+ EventEmitter.call(this);
+
this.cols = cols || Terminal.geometry[0];
this.rows = rows || Terminal.geometry[1];
@@ -2057,6 +2059,18 @@ Terminal.prototype.keyDown = function(ev) {
return true;
};
+Terminal.prototype.setgLevel = function(g) {
+ this.glevel = g;
+ this.charset = this.charsets[g];
+};
+
+Terminal.prototype.setgCharset = function(g, charset) {
+ this.charsets[g] = charset;
+ if (this.glevel === g) {
+ this.charset = charset;
+ }
+};
+
Terminal.prototype.keyPress = function(ev) {
var key;
View
2 static/tty.js
@@ -164,6 +164,8 @@ tty.toggleLights = function() {
function Window(socket) {
var self = this;
+ EventEmitter.call(this);
+
var el
, grip
, bar

0 comments on commit 2a66683

Please sign in to comment.