2022-11-23 16:24:19 +00:00
|
|
|
(function(back) {
|
|
|
|
const SETTINGS_FILE_NAME="messages_light.settings.json";
|
|
|
|
let settings = function() {
|
|
|
|
let settings = require('Storage').readJSON(SETTINGS_FILE_NAME, true) || {};
|
|
|
|
return settings;
|
|
|
|
}
|
|
|
|
function updateSetting(setting, value) {
|
|
|
|
let settings = require('Storage').readJSON(SETTINGS_FILE_NAME, true) || {};
|
|
|
|
settings[setting] = value;
|
|
|
|
require('Storage').writeJSON(SETTINGS_FILE_NAME, settings);
|
|
|
|
}
|
2022-11-23 22:10:49 +00:00
|
|
|
const timeOutChoices = [/*LANG*/"Off", "10s", "15s", "20s", "30s"];
|
2022-11-23 16:24:19 +00:00
|
|
|
var mainmenu = {
|
|
|
|
"" : { "title" : /*LANG*/"Messages Light" },
|
|
|
|
"< Back" : back,
|
2022-11-23 22:10:49 +00:00
|
|
|
/*LANG*/'Time Out': {
|
|
|
|
value: timeOutChoices.indexOf(settings.timeOut),
|
|
|
|
min: 0, max: timeOutChoices.length-1,
|
|
|
|
format: v => timeOutChoices[v],
|
|
|
|
onchange: m => {
|
|
|
|
updateSetting("timeOut", timeOutChoices[m]);
|
|
|
|
}
|
|
|
|
},
|
2022-11-23 16:24:19 +00:00
|
|
|
};
|
|
|
|
E.showMenu(mainmenu);
|
2024-10-28 19:16:14 +00:00
|
|
|
})
|