From 4551ad6dbed1798d567921f4b47da401925364e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 5 Aug 2017 23:46:11 +0200 Subject: [PATCH] added info about the new commands to help. also e]FRa is removed bc it is no longer useful for anything --- html_orig/_debug_replacements.php | 2 +- html_orig/js/app.js | 42 +++++++++++++++++--- html_orig/jssrc/appcommon.js | 12 ++++-- html_orig/jssrc/term.js | 30 +++++++++++++- html_orig/pages/help.php | 10 +++++ html_orig/pages/term.php | 20 ++++++---- user/ansi_parser_callbacks.c | 8 ++-- user/cgi_sockets.c | 65 ++++++++++++++++++++++++++++--- user/cgi_sockets.h | 3 ++ user/screen.c | 46 +++++++++++----------- user/screen.h | 12 +++++- 11 files changed, 197 insertions(+), 53 deletions(-) diff --git a/html_orig/_debug_replacements.php b/html_orig/_debug_replacements.php index ef20620..93fdf77 100644 --- a/html_orig/_debug_replacements.php +++ b/html_orig/_debug_replacements.php @@ -11,7 +11,7 @@ return [ '%btn1%' => '1', '%btn2%' => '2', '%btn3%' => '3', - '%btn4%' => '4', + '%btn4%' => '', '%btn5%' => '5', '%screenData%' => '  HELLOx NRE3',//'\u000b\u0001\u001b\u0001\u0001\u0001\u0001\u0001\f\u0005\u0001\u0010\u0003HELLOx\u0002\u000b\u0001\u0001N\u0001RE\u00023\u0001', //, diff --git a/html_orig/js/app.js b/html_orig/js/app.js index e2744a5..3417498 100644 --- a/html_orig/js/app.js +++ b/html_orig/js/app.js @@ -1011,10 +1011,16 @@ $._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); + } }); // Generated from PHP locale file var _tr = { @@ -1333,8 +1339,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(); @@ -1402,6 +1407,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) }; @@ -1458,6 +1488,8 @@ var Conn = (function() { if (status !== 200) location.reload(true); console.log("Data received!"); Screen.load(resp); + + showPage(); }); } diff --git a/html_orig/jssrc/appcommon.js b/html_orig/jssrc/appcommon.js index e350ed2..091f806 100644 --- a/html_orig/jssrc/appcommon.js +++ b/html_orig/jssrc/appcommon.js @@ -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); + } }); diff --git a/html_orig/jssrc/term.js b/html_orig/jssrc/term.js index 50d3377..3155c57 100644 --- a/html_orig/jssrc/term.js +++ b/html_orig/jssrc/term.js @@ -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(); }); } diff --git a/html_orig/pages/help.php b/html_orig/pages/help.php index e77ae20..bdd1ed1 100644 --- a/html_orig/pages/help.php +++ b/html_orig/pages/help.php @@ -338,6 +338,16 @@ -- Query device status, replies with \e[0n "device is OK". Can be used to check if the UART works. + + \e]TITLE=…\a + Title text + Set terminal title. Avoid ", ', < and >. This is a custom ESPTerm OSC command. + + + \e]BTNn=…\a + 1-5, label + Set button label. Avoid ", ', < and >. This is a custom ESPTerm OSC command. + ASCII 24 (18h) diff --git a/html_orig/pages/term.php b/html_orig/pages/term.php index 1f2480b..f7507d1 100644 --- a/html_orig/pages/term.php +++ b/html_orig/pages/term.php @@ -8,17 +8,17 @@ }, 2000); -

%term_title%

+

- +
@@ -31,10 +31,14 @@ -->About + + +