Skip to content

Commit

Permalink
html updates
Browse files Browse the repository at this point in the history
reformatted wifi list - this should be refactored because I did a lazy solution, creating a table for every line.

Added line break for show password

fixed text alignment of ssid/password form
  • Loading branch information
eMadman committed Nov 8, 2023
1 parent 4af19da commit 3e84799
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 25 deletions.
49 changes: 33 additions & 16 deletions data/HTML_testing_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
a {
color: #000;
font-weight: 700;
text-decoration: none
text-decoration: underline
}

a:hover {
Expand All @@ -423,29 +423,46 @@ <h1>
<strong>WiFi Setup</strong>
</h1>
<div class='wrap'>
<div>
<a href='#p' onclick='c(this)' data-ssid='NetwalkerLair'>NetwalkerLair</a>
<div role='img' aria-label='86%' title='86%' class='q q-3 l {h}'></div>
<div class='q {h}'>86%</div>
</div>
<div>
<table align="center">
<tr>
<td><div>
<a href='#p' onclick='c(this)' data-ssid='NetwalkerLair'>NetwalkerLair</a>
<div role='img' aria-label='86%' title='86%' class='q q-3 l {h}'></div>
<div class='q {h}'>86%</div>
</div></td>
</tr>
<tr><td><div>
<a href='#p' onclick='c(this)' data-ssid='danger55-plus'>danger55-plus</a>
<div role='img' aria-label='34%' title='34%' class='q q-2 l {h}'></div>
<div class='q {h}'>34%</div>
</div>
<div>
</div></td>
</tr>
<tr><td><div>
<a href='#p' onclick='c(this)' data-ssid='Emily'>Emily</a>
<div role='img' aria-label='18%' title='18%' class='q q-1 l {h}'></div>
<div class='q {h}'>18%</div>
</div>
</div></td>
</tr>
</table>
<br/>
<form method='POST' action='send_settings'>
<label for='ssid'>SSID</label>
<input id='ssid' name='ssid' maxlength='32' autocorrect='off' autocapitalize='none' placeholder='NetwalkerLair'>
<br/>
<label for='password'>Password</label>
<input id='password' name='password' maxlength='64' type='password' placeholder='password'>
<input type='checkbox' onclick='f()'>
<table align="center">
<tr>
<td align="right">
<label for='ssid'>SSID</label>
</td>
<td><input id='ssid' name='ssid' maxlength='32' autocorrect='off' autocapitalize='none' placeholder='NetwalkerLair'></td>
</tr>
<tr>
<td align="right">
<label for='password'>Password</label>
</td>
<td>
<input id='password' name='password' maxlength='64' type='password' placeholder='password'>
</td>
</tr>
</table>
<br/><input type='checkbox' onclick='f()'>
Show Password<br/>
<br/>
<br/>
Expand Down
16 changes: 8 additions & 8 deletions include/Builtin_Pages.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const char HTTP_STYLE[] =
"label {font-size: medium;}"
"div {font-size: medium;}"
"a{color: #000000;text-decoration:underline}"
"a:visited {color: #000000;}"
"a:visited {color: #000000;text-decoration:underline}"
"h1{color: #03245c;padding: 0.5rem;line-height: 1em;}"
"h2{color: #000000;font-size: 1.5rem;font-weight: bold;}"
"p{font-size: 1rem;}"
Expand Down Expand Up @@ -199,7 +199,7 @@ const char HTTP_STYLE[] =
"button.D{background-color:#dc3630}"
"button:active{opacity:50% !important;cursor:wait;transition-delay: 0s}"
// links
"a{color:#000;font-weight:700;text-decoration:none}a:hover{color:#1fa3ec;text-decoration:underline}"
"a{color:#000;font-weight:700;text-decoration:underline}a:hover{color:#1fa3ec;text-decoration:underline}"
"</style>";

/* Login page */
Expand Down Expand Up @@ -307,16 +307,16 @@ const char* const HTTP_PORTAL_MENU[] = {

// const char HTTP_PORTAL_OPTIONS[] = strcat(HTTP_PORTAL_MENU[0] , HTTP_PORTAL_MENU[3] , HTTP_PORTAL_MENU[7]);
const char HTTP_PORTAL_OPTIONS[] = "";
const char HTTP_ITEM_QI[] = "<div role='img' aria-label='{r}%' title='{r}%' class='q q-{q} {i} {h}'></div>"; // rssi icons
const char HTTP_ITEM_QP[] = "<div class='q {h}'>{r}%</div>"; // rssi percentage {h} = hidden showperc pref
const char HTTP_ITEM[] = "<div><a href='#p' onclick='c(this)' data-ssid='{V}'>{v}</a>{qi}{qp}</div>"; // {q} = HTTP_ITEM_QI, {r} = HTTP_ITEM_QP
const char HTTP_ITEM_QI[] = "<div role='img' aria-label='{r}%' title='{r}%' class='q q-{q} {i} {h}'></div></td></tr></table>"; // rssi icons
// const char HTTP_ITEM_QP[] = "<div class='q {h}'>{r}%</div>"; // rssi percentage {h} = hidden showperc pref
const char HTTP_ITEM[] = "<table align=center><tr><td><div><a href='#p' onclick='c(this)' data-ssid='{V}'>{v}</a>{qi}</div>"; // {q} = HTTP_ITEM_QI, {r} = HTTP_ITEM_QP
// const char HTTP_ITEM[] = "<div><a href='#p' onclick='c(this)'>{v}</a> {R} {r}% {q} {e}</div>"; // test all tokens

const char HTTP_FORM_START[] = "<form method='POST' action='{v}'>";
const char HTTP_FORM_WIFI[] =
"<label for='ssid'>SSID</label><input id='ssid' name='ssid' maxlength='32' autocorrect='off' autocapitalize='none' placeholder='{v}'><br/><label "
"for='password'>Password</label><input id='password' "
"name='password' maxlength='64' type='password' placeholder='password'><input type='checkbox' onclick='f()'> Show Password";
"<table align=center><tr><td align=right><label for='ssid'>SSID</label></td><td><input id='ssid' name='ssid' maxlength='32' autocorrect='off' autocapitalize='none' placeholder='{v}'></td><tr><td align=right><label "
"for='password'>Password</label></td><td><input id='password' "
"name='password' maxlength='64' type='password' placeholder='password'></td></tr></table><br/><input type='checkbox' onclick='f()'> Show Password";
const char HTTP_FORM_WIFI_END[] = "";
const char HTTP_FORM_STATIC_HEAD[] = "<hr><br/>";
const char HTTP_FORM_END[] = "<br/><br/><button type='submit'>Save</button></form>";
Expand Down
3 changes: 2 additions & 1 deletion src/HTTP_Server_Basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,11 +605,12 @@ String getScanItemOut() {
}
}


// token precheck, to speed up replacements on large ap lists
String HTTP_ITEM_STR = FPSTR(HTTP_ITEM);

// toggle icons with percentage
HTTP_ITEM_STR.replace("{qp}", FPSTR(HTTP_ITEM_QP));
// HTTP_ITEM_STR.replace("{qp}", FPSTR(HTTP_ITEM_QP));
HTTP_ITEM_STR.replace("{qi}", FPSTR(HTTP_ITEM_QI));

// set token precheck flags
Expand Down

0 comments on commit 3e84799

Please sign in to comment.