commit
43b2a0b55c
|
|
@ -49,6 +49,7 @@ function ClockFace(options) {
|
|||
}
|
||||
|
||||
ClockFace.prototype.tick = function() {
|
||||
"ram"
|
||||
const time = new Date();
|
||||
const now = {
|
||||
d: `${time.getFullYear()}-${time.getMonth()}-${time.getDate()}`,
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ let menu = {
|
|||
/*LANG*/"< Back": back,
|
||||
};
|
||||
require("ClockFace_menu").addSettingsFile(menu, "<appid>.settings.json", [
|
||||
"showDate", "loadWidgets"
|
||||
"showDate", "loadWidgets", "powerSave",
|
||||
]);
|
||||
E.showMenu(menu);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,12 +11,16 @@ exports.addItems = function(menu, callback, items) {
|
|||
const label = {
|
||||
showDate:/*LANG*/"Show date",
|
||||
loadWidgets:/*LANG*/"Load widgets",
|
||||
powerSave:/*LANG*/"Power saving",
|
||||
}[key];
|
||||
switch(key) {
|
||||
// boolean options which default to true
|
||||
case "showDate":
|
||||
case "loadWidgets":
|
||||
// boolean options, which default to true
|
||||
if (value===undefined) value = true;
|
||||
// fall through
|
||||
case "powerSave":
|
||||
// same for all boolean options:
|
||||
menu[label] = {
|
||||
value: !!value,
|
||||
onchange: v => callback(key, v),
|
||||
|
|
|
|||
Loading…
Reference in New Issue