diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-25 17:08:26 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-25 17:08:26 +0200 |
commit | 9cc5356fb7a347aac223997c8ece296fe2bd4f96 (patch) | |
tree | 14ed326f255a8723f9ad594d972e9a3caeb4b3da /webPage/index.html | |
parent | 883d5171ef945fc6312cb7be9e4c771199f005bd (diff) | |
download | Luxcena-cs-9cc5356fb7a347aac223997c8ece296fe2bd4f96.tar.gz Luxcena-cs-9cc5356fb7a347aac223997c8ece296fe2bd4f96.zip |
Updated webapp-content, now we have a local fallback for CDN
Diffstat (limited to 'webPage/index.html')
-rw-r--r-- | webPage/index.html | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/webPage/index.html b/webPage/index.html index c80ee61..a3564a6 100644 --- a/webPage/index.html +++ b/webPage/index.html @@ -7,7 +7,7 @@ <title>{{NAME}}</title> - <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous"> + {{BOOTSTRAPLINK}} <link rel="stylesheet" href="./style.css"> </head> @@ -15,8 +15,8 @@ <body> <nav class="navbar navbar-dark bg-dark"> - <a class="navbar-brand" href="/">IOT Device</a> - <a class="navbar-toggler navbar-toggler-right" href="/settings"> + <a id="homePageAddr" class="navbar-brand" href="/">IOT Device</a> + <a id="settingsPageAddr" class="navbar-toggler navbar-toggler-right" href="/settings"> ⚙ </a> </nav> @@ -31,7 +31,7 @@ {{NAME}} <span class="text-align:right;"> <label class="switch float-right"> - <input type="checkbox" id="lampActive"> + <input type="checkbox" id="lampActive" {{LAMPACTIVECHECKED}}> <span class="slider round"></span> </label> </span> @@ -41,7 +41,7 @@ <hr /> <div class="toggle-button toggle-button--tuli"> - <input id="sensorActive" type="checkbox"> + <input id="sensorActive" type="checkbox" {{SENSORCHECKED}}> <label for="sensorActive">Clap sensor</label> <div class="toggle-button__icon"></div> </div> @@ -52,26 +52,14 @@ </div> + <script src="/script.js" charset="utf-8"></script> <script type="text/javascript"> + fixNoNetwork(); var pollingActive = true; // Prevent states from being updated while trying to change them. document.getElementById("lampActive").addEventListener("change", changLampState); document.getElementById("sensorActive").addEventListener("change", changSensorState); setInterval(getStates, 1000); - function ajax_request(adress, callback_function) { - /* A simple ajax request wrapper - Doesn´t return anything else than the callback */ - var xhttp = new XMLHttpRequest(); - xhttp.onreadystatechange = function() { - if (this.readyState == 4 && this.status == 200) { - callback_function(this.responseText); - } - }; - xhttp.open("POST", adress, true); - xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); - xhttp.send(); - } - function changLampState() { var boxState = document.getElementById("lampActive").checked; if (boxState) { |