diff --git a/simpledemo.html b/simpledemo.html index b297005..7d2932c 100644 --- a/simpledemo.html +++ b/simpledemo.html @@ -435,7 +435,7 @@ = document.getElementById('wifiChange_ssidInput').value; newPSK = document.getElementById('wifiChange_pskInput').value; http = new XMLHttpRequest();http.open('GET', - 'http://' + document.cookie + '/api/v1/system/wifi/change?ssid='+newSSID+'&psk='+newPSK);http.send();"> + 'http://' + document.cookie + '/api/v1/system/wifi/change?ssid='+newSSID+'&psk='+newPSK);http.send();updateStrings();"> Change @@ -458,17 +458,15 @@

Restoring the old/last state can be toggeled on or off over the API. Doing so can have many reasons, one could be that you wanted to build a device always playing some startup sound, or so.

- +
- +
@@ -556,7 +554,9 @@ frnameLabel2 = document.getElementById('updatedLabel_FRNAME_table'); frnameLabel3 = document.getElementById('updatedLabel_FRNAME_oldinputtext'); restoreStateLabel1 = document.getElementById('updatedLabel_RESTORESTATE_table') + restoreStateSwitch1 = document.getElementById('updatedLabel_RESTORESTATE_switch') restorePlayingStateLabel1 = document.getElementById('updatedLabel_RESTOREPLAYING_table') + restorePlayingStateSwitch1 = document.getElementById('updatedLabel_RESTOREPLAYING_switch') wifiLabel1 = document.getElementById('updatedLabel_WIFISSID_table'); apSsidLabel1 = document.getElementById('updatedLabel_APSSID_table'); apSsidLabel2 = document.getElementById('updatedLabel_APSSID_code'); @@ -639,8 +639,9 @@ var restoreStateRequest = new XMLHttpRequest(); restoreStateRequest.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { - var restoreStateString = JSON.parse(this.responseText).restore_state; - restoreStateLabel1.innerHTML = restoreStateString ? "yes" : "no"; + var restoreStateValue = JSON.parse(this.responseText).restore_state; + restoreStateLabel1.innerHTML = restoreStateValue ? "yes" : "no"; + restoreStateSwitch1.checked = restoreStateValue; } } restoreStateRequest.open("GET", apiBase + restoreStateApiEndpoint, true); @@ -649,8 +650,9 @@ var restorePlayingRequest = new XMLHttpRequest(); restorePlayingRequest.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { - var restorePlayingString = JSON.parse(this.responseText).restore_playing; - restorePlayingStateLabel1.innerHTML = restorePlayingString ? "yes" : "no"; + var restorePlayingValue = JSON.parse(this.responseText).restore_playing; + restorePlayingStateLabel1.innerHTML = restorePlayingValue ? "yes" : "no"; + restorePlayingStateSwitch1.checked = restorePlayingValue; } } restorePlayingRequest.open("GET", apiBase + restorePlayingStateApiEndpoint, true);