webtty: begin experimenting with JSON protocol.
This commit is contained in:
parent
02cc454ad1
commit
71d43603a9
2 changed files with 6 additions and 5 deletions
|
|
@ -302,13 +302,13 @@ function login(h, w) {
|
|||
req.onreadystatechange = function () {
|
||||
if (req.readyState == 4 && req.status == 200) {
|
||||
var datalines = req.responseText.split("\n");
|
||||
if (datalines[0] == 'l1') {
|
||||
var logindict = JSON.parse(req.responseText);
|
||||
if (logindict.login) {
|
||||
/* Success */
|
||||
// FIXME extract the size from the response instead of hardcoding
|
||||
termemu.resize(25, 80);
|
||||
termemu.resize(logindict.h, logindict.w);
|
||||
termemu.alive = true;
|
||||
setTitle("Logged in");
|
||||
debug(1, "Logged in with id " + datalines[1]);
|
||||
debug(1, "Logged in with id " + logindict.id);
|
||||
getData();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue