This commit is contained in:
Paul
2019-10-27 23:01:29 +01:00
parent 2fcfc4a97e
commit 28b42f797c
6 changed files with 58 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ var custom_config = {
"shower_timer": false,
"shower_alert": false,
"publish_time": 120,
"publish_always": false,
"tx_mode": 1
}
};
@@ -23,18 +24,26 @@ function listcustom() {
if (custom_config.settings.led) {
$("input[name=\"led\"][value=\"1\"]").prop("checked", true);
}
if (custom_config.settings.dallas_parasite) {
$("input[name=\"dallas_parasite\"][value=\"1\"]").prop("checked", true);
}
if (custom_config.settings.listen_mode) {
$("input[name=\"listen_mode\"][value=\"1\"]").prop("checked", true);
}
if (custom_config.settings.shower_timer) {
$("input[name=\"shower_timer\"][value=\"1\"]").prop("checked", true);
}
if (custom_config.settings.shower_alert) {
$("input[name=\"shower_alert\"][value=\"1\"]").prop("checked", true);
}
if (custom_config.settings.publish_always) {
$("input[name=\"publish_always\"][value=\"1\"]").prop("checked", true);
}
}
function savecustom() {
@@ -66,6 +75,11 @@ function savecustom() {
custom_config.settings.led = true;
}
custom_config.settings.publish_always = false;
if (parseInt($("input[name=\"publish_always\"]:checked").val()) === 1) {
custom_config.settings.publish_always = true;
}
custom_config.settings.publish_time = parseInt(document.getElementById("publish_time").value);
custom_config.settings.tx_mode = parseInt(document.getElementById("tx_mode").value);