From 9c36b4268a81947a5694e5f811d7b29692638dd7 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Sun, 7 May 2017 17:09:18 +0200 Subject: [PATCH] started HTML index page rework setting nightlight now possible --- wled00/data/index.htm | 88 ++++++++++++++++++++++++++++------- wled00/data/settingssaved.htm | 1 - wled00/wled02_xml.ino | 2 +- 3 files changed, 73 insertions(+), 18 deletions(-) diff --git a/wled00/data/index.htm b/wled00/data/index.htm index 2e9d6120c..d7ab40d15 100644 --- a/wled00/data/index.htm +++ b/wled00/data/index.htm @@ -6,6 +6,8 @@ strR = ""; strG = ""; strB = ""; + strNL = ""; + var nla = false; function Startup() { @@ -25,22 +27,24 @@ document.Ctrl_form.SR.value = this.responseXML.getElementsByTagName('cl')[0].childNodes[0].nodeValue; document.Ctrl_form.SG.value = this.responseXML.getElementsByTagName('cl')[1].childNodes[0].nodeValue; document.Ctrl_form.SB.value = this.responseXML.getElementsByTagName('cl')[2].childNodes[0].nodeValue; + nla = (this.responseXML.getElementsByTagName('nl')[0].innerHTML)!=0?true:false; + document.getElementsByClassName("desc")[0].innerHTML = this.responseXML.getElementsByTagName('desc')[0].innerHTML; UpdateVals(); } } } } // send HTTP request - request.open("GET", "win/" + strA + strR + strG + strB + nocache, true); + request.open("GET", "win/" + strA + strR + strG + strB + strNL + nocache, true); request.send(null); strA = ""; strR = ""; strG = ""; strB = ""; + strNL = ""; } function GetCheck() { - strA = "&A=" + Ctrl_form.SA.value; strR = "&R=" + Ctrl_form.SR.value; strG = "&G=" + Ctrl_form.SG.value; @@ -59,24 +63,42 @@ function UpdateVals() { document.body.style.background = lingrad(Ctrl_form.SR.value, Ctrl_form.SG.value, Ctrl_form.SB.value); + if (nla) { + nlb.style.fill="white"; + } else { + nlb.style.fill="black"; + } } function OpenSettings() { window.open("/settings","_self"); } - function ToggleNightMode() + function ToggleNl() { - + nla = !nla; + if (nla) { + strNL="&NL=1"; + } else { + strNL="&NL=0"; + } + UpdateVals(); + GetArduinoIO(); } + Loading...
- - + + + + + +
@@ -203,4 +226,37 @@

- \ No newline at end of file + + + + +clock + + + +clock2 + + + +download + + + +upload + + + +equalizer + + + +cog + + + +star-full + + + + + \ No newline at end of file diff --git a/wled00/data/settingssaved.htm b/wled00/data/settingssaved.htm index af0f6bf05..8ffaa3261 100644 --- a/wled00/data/settingssaved.htm +++ b/wled00/data/settingssaved.htm @@ -11,7 +11,6 @@ { window.open("/reset","_self"); } -
diff --git a/wled00/wled02_xml.ino b/wled00/wled02_xml.ino index ef578e053..643cc9301 100644 --- a/wled00/wled02_xml.ino +++ b/wled00/wled02_xml.ino @@ -212,7 +212,7 @@ void XML_response_settings() resp = resp + "Not active"; } resp = resp + ""; - resp = resp + "WLED 0.3pd (build"; + resp = resp + "WLED 0.3pd (build "; resp = resp + VERSION; resp = resp + ") OK"; resp = resp + "";