make hidden ssid work minimally

v2.1 v2.1.beta3
Thorsten von Eicken 9 years ago
parent cf7abfc59a
commit 9920fd500e
  1. 4
      html/wifi/wifi.html
  2. 24
      html/wifi/wifi.js

@ -29,8 +29,8 @@
<label>Network SSID</label>
<div id="aps">Scanning... <div class="spinner spinner-small"></div></div>
<label for="opt-hiddenssid">
<input type="radio" name="essid" value="" id="opt-hiddenssid">
<input type="text" value="">
<input type="radio" name="essid" value="_hidden_ssid_" id="opt-hiddenssid">
<input type="text" id="hidden-ssid" value="" style="width:auto; display:inline-block;">
</label>
<label>WiFi password, if applicable:</label>
<input id="wifi-passwd" type="password" name="passwd" placeholder="password">

@ -41,7 +41,11 @@ function createInputForAp(ap) {
function getSelectedEssid() {
var e = document.forms.wifiform.elements;
for (var i=0; i<e.length; i++) {
if (e[i].type == "radio" && e[i].checked) return e[i].value;
if (e[i].type == "radio" && e[i].checked) {
var v = e[i].value;
if (v == "_hidden_ssid_") v = $("#hidden-ssid").value;
return v;
}
}
return currAp;
}
@ -78,7 +82,7 @@ function scanResult() {
}
function scanAPs() {
console.log("scanning now");
console.log("scanning now");
if (blockScan) {
scanTimeout = window.setTimeout(scanAPs, 1000);
return;
@ -106,10 +110,10 @@ function getStatus() {
showWifiInfo(data);
blockScan = 0;
if (data.modechange == "yes") {
var txt2 = "esp-link will switch to STA-only mode in a few seconds";
window.setTimeout(function() { showNotification(txt2); }, 4000);
}
if (data.modechange == "yes") {
var txt2 = "esp-link will switch to STA-only mode in a few seconds";
window.setTimeout(function() { showNotification(txt2); }, 4000);
}
$("#reconnect").removeAttribute("hidden");
$("#reconnect").innerHTML =
@ -190,11 +194,11 @@ function changeSpecial(e) {
}
function doDhcp() {
$('#dhcp-on').removeAttribute('hidden');
$('#dhcp-off').setAttribute('hidden', '');
$('#dhcp-on').removeAttribute('hidden');
$('#dhcp-off').setAttribute('hidden', '');
}
function doStatic() {
$('#dhcp-off').removeAttribute('hidden');
$('#dhcp-on').setAttribute('hidden', '');
$('#dhcp-off').removeAttribute('hidden');
$('#dhcp-on').setAttribute('hidden', '');
}

Loading…
Cancel
Save