From e62c4ece907f1382a44f6eb5c53ae770b9ae6929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sun, 29 Jan 2017 01:58:36 +0100 Subject: [PATCH] improvements + page testing php scripts (use with php -S localhost:1337 in the folder) --- html/js/app.js | 4 ++-- html_orig/js/app.js | 8 +++++--- html_orig/jssrc/wifi.js | 4 ++-- html_orig/term_test.php | 15 +++++++++++++++ html_orig/wifi_test.php | 13 +++++++++++++ user/user_main.c | 1 + 6 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 html_orig/term_test.php create mode 100644 html_orig/wifi_test.php diff --git a/html/js/app.js b/html/js/app.js index bdc2c45..7b8aced 100644 --- a/html/js/app.js +++ b/html/js/app.js @@ -1286,7 +1286,7 @@ $._loader = function(vis) { /** Ask the CGI what APs are visible (async) */ function scanAPs() { - $.get('/wifi/scan', onScan); + $.get('http://'+_root+'/wifi/scan', onScan); } function rescan(time) { @@ -1340,7 +1340,7 @@ $._loader = function(vis) { var abortTmeo; function getStatus() { - xhr.open("GET", "/wifi/connstatus"); + xhr.open("GET", 'http://'+_root+"/wifi/connstatus"); xhr.onreadystatechange = function () { if (xhr.readyState == 4 && xhr.status >= 200 && xhr.status < 300) { clearTimeout(abortTmeo); diff --git a/html_orig/js/app.js b/html_orig/js/app.js index aae60c2..7b8aced 100644 --- a/html_orig/js/app.js +++ b/html_orig/js/app.js @@ -894,6 +894,7 @@ $._loader = function(vis) { var W, H; var cursor = {a: false, x: 0, y: 0, suppress: false, hidden: false}; var screen = []; + var blinkIval; /** Colors table */ var CLR = [// dark gray #2E3436 @@ -1071,7 +1072,8 @@ $._loader = function(vis) { } /* Cursor blinking */ - setInterval(function() { + clearInterval(blinkIval); + blinkIval = setInterval(function() { cursor.a = !cursor.a; if (cursor.hidden) { cursor.a = false; @@ -1284,7 +1286,7 @@ $._loader = function(vis) { /** Ask the CGI what APs are visible (async) */ function scanAPs() { - $.get('/wifi/scan', onScan); + $.get('http://'+_root+'/wifi/scan', onScan); } function rescan(time) { @@ -1338,7 +1340,7 @@ $._loader = function(vis) { var abortTmeo; function getStatus() { - xhr.open("GET", "/wifi/connstatus"); + xhr.open("GET", 'http://'+_root+"/wifi/connstatus"); xhr.onreadystatechange = function () { if (xhr.readyState == 4 && xhr.status >= 200 && xhr.status < 300) { clearTimeout(abortTmeo); diff --git a/html_orig/jssrc/wifi.js b/html_orig/jssrc/wifi.js index 8d0ff4c..dd7f370 100644 --- a/html_orig/jssrc/wifi.js +++ b/html_orig/jssrc/wifi.js @@ -75,7 +75,7 @@ /** Ask the CGI what APs are visible (async) */ function scanAPs() { - $.get('/wifi/scan', onScan); + $.get('http://'+_root+'/wifi/scan', onScan); } function rescan(time) { @@ -129,7 +129,7 @@ var abortTmeo; function getStatus() { - xhr.open("GET", "/wifi/connstatus"); + xhr.open("GET", 'http://'+_root+"/wifi/connstatus"); xhr.onreadystatechange = function () { if (xhr.readyState == 4 && xhr.status >= 200 && xhr.status < 300) { clearTimeout(abortTmeo); diff --git a/html_orig/term_test.php b/html_orig/term_test.php new file mode 100644 index 0000000..6b04bc5 --- /dev/null +++ b/html_orig/term_test.php @@ -0,0 +1,15 @@ + #include #include +#include #include "serial.h" #include "io.h" #include "screen.h"