let settingsJson = {}; const load = () => { getFile("settings.json", res => { settingsJson = JSON.parse(res); draw(); }); } const draw = () => { let 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; } const save = (key, value) => { if (key) { settingsJson[key] = value; getFile(`run?cmd=set ${key} "${value}"`); } else { getFile("run?cmd=save settings", load); } }