Skip to content

Commit

Permalink
make hidden ssid work minimally
Browse files Browse the repository at this point in the history
  • Loading branch information
tve committed Nov 14, 2015
1 parent cf7abfc commit 9920fd5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions html/wifi/wifi.html
Expand Up @@ -29,8 +29,8 @@ <h1>Wifi Association</h1>
<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">
Expand Down
24 changes: 14 additions & 10 deletions html/wifi/wifi.js
Expand Up @@ -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;
}
Expand Down Expand Up @@ -78,7 +82,7 @@ function scanResult() {
}

function scanAPs() {
console.log("scanning now");
console.log("scanning now");
if (blockScan) {
scanTimeout = window.setTimeout(scanAPs, 1000);
return;
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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', '');
}

0 comments on commit 9920fd5

Please sign in to comment.