firmware wip - add JSreplaceStr

This commit is contained in:
Marcus 2024-04-16 03:06:05 +02:00
parent 819f3f3750
commit c7b3bc2d2f
1 changed files with 7 additions and 2 deletions

View File

@ -157,6 +157,7 @@ const char HTMLheader[] PROGMEM = R"EOF(
<li><a id="systemSettings" href="/systemSettings">System settings</a></li>
<li><a href="/wifiSettings">WiFi settings</a></li>
<li><a href="/help">Help</a></li>
<li><span id="GrowName"></span></li>
</ul>
<div class="center">
@ -232,7 +233,7 @@ a:active {
border-bottom-left-radius: 3px;
}
.nav li a {
.nav li a , .nav span {
color: #ddd;
display: block;
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
@ -911,6 +912,7 @@ void WEBlogout() {
void WEBhelp() {
String body = FPSTR(HTMLheader);
body += FPSTR(HTMLhelp);
body += JSreplaceStr("GrowName", "abcdefgh");
body += FPSTR(HTMLfooter);
webserver.send(200, "text/html", body);
}
@ -1067,7 +1069,10 @@ void POSTwifiSettings() {
}
String JSreplaceStr(String elementID, String content) {
String jsReturn = "<script>document.getElementById('" + elementID + "').innerHTML='" + content + "';</script>";
return jsReturn;
}