added info about the new commands to help. also e]FRa is removed bc it is no longer useful for anything

This commit is contained in:
2017-08-05 23:46:11 +02:00
parent 3f4b8a94f1
commit 4551ad6dbe
11 changed files with 197 additions and 53 deletions
+9 -3
View File
@@ -112,8 +112,14 @@ $._loader = function(vis) {
$('#loader').toggleClass('show', vis);
};
function showPage() {
$('#content').addClass('load');
}
$.ready(function() {
setTimeout(function() {
$('#content').addClass('load');
}, 1);
if (window.noAutoShow !== true) {
setTimeout(function () {
showPage();
}, 1);
}
});
+28 -2
View File
@@ -147,8 +147,7 @@ var Screen = (function () {
var SEQ_SET_COLOR = 1;
var SEQ_REPEAT = 2;
/** Load screen content from a binary sequence (new) */
function load(str) {
function _load_content(str) {
var i = 0, ci = 0, j, jc, num, num2, t = ' ', fg, bg, bold, cell;
if (!inited) _init();
@@ -216,6 +215,31 @@ var Screen = (function () {
_drawAll();
}
function _load_labels(str) {
var pieces = str.split('|');
qs('h1').textContent = pieces[0];
qsa('#buttons button').forEach(function(x, i) {
var s = pieces[i+1].trim();
x.innerHTML = s.length >0 ? e(s) : " ";
x.style.opacity = s.length > 0 ? 1 : 0.2;
});
}
/** Load screen content from a binary sequence (new) */
function load(str) {
var content = str.substr(1);
switch(str.charAt(0)) {
case 'S':
_load_content(content);
break;
case 'T':
_load_labels(content);
break;
default:
console.warn("Bad data message type, ignoring.");
}
}
return {
load: load, // full load (string)
};
@@ -272,6 +296,8 @@ var Conn = (function() {
if (status !== 200) location.reload(true);
console.log("Data received!");
Screen.load(resp);
showPage();
});
}