From a53124de42891c86799554d3efe9b30570e1486d Mon Sep 17 00:00:00 2001 From: pcbbc Date: Sun, 22 May 2022 23:31:48 +0100 Subject: [PATCH] Added 'type' proptert to text input elements Now the text input element can support other HTML input types suxh as date, time, color, password, etc --- data/js/controls.js | 5 +++-- data/js/controls.min.js | 4 ++-- src/ESPUI.cpp | 15 ++++++++++++++- src/ESPUI.h | 2 ++ src/dataControlsJS.h | 9 +++++---- src/dataGraphJS.h | 2 +- src/dataIndexHTML.h | 2 +- src/dataNormalizeCSS.h | 2 +- src/dataSliderJS.h | 2 +- src/dataStyleCSS.h | 2 +- src/dataTabbedcontentJS.h | 2 +- src/dataZeptoJS.h | 2 +- 12 files changed, 33 insertions(+), 16 deletions(-) diff --git a/data/js/controls.js b/data/js/controls.js index e394c9f..46a61ce 100644 --- a/data/js/controls.js +++ b/data/js/controls.js @@ -212,7 +212,7 @@ function start() { window.location.port != 443 ) { websock = new WebSocket( - "ws://" + window.location.hostname + ":" + window.location.port + "/ws" + "ws://" + window.location.hostname + ":" + window.location.port + "/ws" ); } else { websock = new WebSocket("ws://" + window.location.hostname + "/ws"); @@ -769,6 +769,7 @@ var addToHTML = function(data) { var elementHTML = function(data) { var id = data.id var elementStyle = data.hasOwnProperty('elementStyle') ? " style='" + data.elementStyle + "' " : ""; + var inputType = data.hasOwnProperty('inputType') ? " type='" + data.inputType + "' " : ""; switch(data.type) { case UI_LABEL: return ""; case UI_TEXT_INPUT: - return ""; case UI_SELECT: return "";case UI_TEXT_INPUT:return"";case UI_TEXT_INPUT:return"";case UI_SELECT:return"";case UI_ACCEL:return"ACCEL // Not implemented fully!