Compare commits

...
2 Commits
Author SHA1 Message Date
paris 670efc4454 Bump Bower version to 0.19 2014-09-18 09:06:53 +00:00
paris 74f9526177 [addon attach] Implement auto-detaching on socket close/error 2014-09-18 09:06:23 +00:00
3 changed files with 20 additions and 8 deletions
+17 -5
View File
@@ -25,14 +25,26 @@
bidirectional = (typeof bidirectional == 'undefined') ? true : bidirectional; bidirectional = (typeof bidirectional == 'undefined') ? true : bidirectional;
this.socket = socket; this.socket = socket;
socket.addEventListener('message', function (ev) { function _getMessage (ev) {
term.write(ev.data); term.write(ev.data);
}); }
function _sendData (data) {
socket.send(data);
}
function _detach () {
term.off('data', _sendData);
socket.removeEventListener('message', _getMessage);
}
socket.addEventListener('message', _getMessage);
if (bidirectional) { if (bidirectional) {
this.on('data', function (data) { this.on('data', _sendData);
socket.send(data);
});
} }
socket.addEventListener('close', _detach);
socket.addEventListener('error', _detach);
}; };
}); });
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
"name": "xterm.js", "name": "xterm.js",
"version": "0.18", "version": "0.19",
"ignore": ["demo", "docs", "test", ".gitignore"] "ignore": ["demo", "docs", "test", ".gitignore"]
} }
+2 -2
View File
@@ -51,9 +51,9 @@ copyright = u'2014, SourceLair Limited'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '0.18' version = '0.19'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '0.18 Alpha' release = '0.19 Alpha'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.