/* This software is licensed under the MIT License: https://github.com/spacehuhntech/esp8266_deauther */ var settingsJson = {}; function load() { getFile("settings.json", function (res) { settingsJson = JSON.parse(res); draw(); }); } function draw() { var html = ""; for (var key in settingsJson) { key = esc(key); if (settingsJson.hasOwnProperty(key)) { html += "
" + "
" + "" + "
" + "
"; if (typeof settingsJson[key] == "boolean") { html += ""; } else if (typeof settingsJson[key] == "number") { html += ""; } else if (typeof settingsJson[key] == "string") { html += ""; } html += "
" + "
" + "
" + "
" + "

" + lang("setting_" + key) + "

" + "
" + "
" + "
"; } } getE("settingsList").innerHTML = html; } function save(key, value) { if (key) { settingsJson[key] = value; getFile("run?cmd=set " + key + " \"" + value + "\""); } else { getFile("run?cmd=save settings", function (res) { load(); }); } }