|
|
@ -896,7 +896,8 @@ $._loader = function(vis) { |
|
|
|
var screen = []; |
|
|
|
var screen = []; |
|
|
|
var blinkIval; |
|
|
|
var blinkIval; |
|
|
|
|
|
|
|
|
|
|
|
/** Clear screen */ |
|
|
|
/* |
|
|
|
|
|
|
|
/!** Clear screen *!/ |
|
|
|
function cls() { |
|
|
|
function cls() { |
|
|
|
screen.forEach(function(cell, i) { |
|
|
|
screen.forEach(function(cell, i) { |
|
|
|
cell.t = ' '; |
|
|
|
cell.t = ' '; |
|
|
@ -905,6 +906,7 @@ $._loader = function(vis) { |
|
|
|
blit(cell); |
|
|
|
blit(cell); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
/** Set text and color at XY */ |
|
|
|
/** Set text and color at XY */ |
|
|
|
function cellAt(y, x) { |
|
|
|
function cellAt(y, x) { |
|
|
@ -916,14 +918,15 @@ $._loader = function(vis) { |
|
|
|
return cellAt(cursor.y, cursor.x); |
|
|
|
return cellAt(cursor.y, cursor.x); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** Enable or disable cursor visibility */ |
|
|
|
/* |
|
|
|
|
|
|
|
/!** Enable or disable cursor visibility *!/ |
|
|
|
function cursorEnable(enable) { |
|
|
|
function cursorEnable(enable) { |
|
|
|
cursor.hidden = !enable; |
|
|
|
cursor.hidden = !enable; |
|
|
|
cursor.a &= enable; |
|
|
|
cursor.a &= enable; |
|
|
|
blit(cursorCell(), cursor.a); |
|
|
|
blit(cursorCell(), cursor.a); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** Safely move cursor */ |
|
|
|
/!** Safely move cursor *!/ |
|
|
|
function cursorSet(y, x) { |
|
|
|
function cursorSet(y, x) { |
|
|
|
// Hide and prevent from showing up during the move
|
|
|
|
// Hide and prevent from showing up during the move
|
|
|
|
cursor.suppress = true; |
|
|
|
cursor.suppress = true; |
|
|
@ -936,6 +939,7 @@ $._loader = function(vis) { |
|
|
|
cursor.suppress = false; |
|
|
|
cursor.suppress = false; |
|
|
|
blit(cursorCell(), cursor.a); |
|
|
|
blit(cursorCell(), cursor.a); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
/** Update cell on display. inv = invert (for cursor) */ |
|
|
|
/** Update cell on display. inv = invert (for cursor) */ |
|
|
|
function blit(cell, inv) { |
|
|
|
function blit(cell, inv) { |
|
|
@ -1081,7 +1085,10 @@ $._loader = function(vis) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function onClose(evt) { |
|
|
|
function onClose(evt) { |
|
|
|
console.error("SOCKET CLOSED"); |
|
|
|
console.warn("SOCKET CLOSED, code "+evt.code+". Reconnecting..."); |
|
|
|
|
|
|
|
setTimeout(function() { |
|
|
|
|
|
|
|
init(); |
|
|
|
|
|
|
|
}, 2000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function onMessage(evt) { |
|
|
|
function onMessage(evt) { |
|
|
@ -1094,10 +1101,6 @@ $._loader = function(vis) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function onError(evt) { |
|
|
|
|
|
|
|
console.error(evt.data); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function doSend(message) { |
|
|
|
function doSend(message) { |
|
|
|
console.log("TX: ", message); |
|
|
|
console.log("TX: ", message); |
|
|
|
if (ws.readyState != 1) { |
|
|
|
if (ws.readyState != 1) { |
|
|
@ -1115,7 +1118,6 @@ $._loader = function(vis) { |
|
|
|
ws.onopen = onOpen; |
|
|
|
ws.onopen = onOpen; |
|
|
|
ws.onclose = onClose; |
|
|
|
ws.onclose = onClose; |
|
|
|
ws.onmessage = onMessage; |
|
|
|
ws.onmessage = onMessage; |
|
|
|
ws.onerror = onError; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log("Opening socket."); |
|
|
|
console.log("Opening socket."); |
|
|
|
} |
|
|
|
} |
|
|
|