feat: allow to disable BTN1 and BTN3 buttons

master
Francesco Bedussi 2020-06-14 16:15:59 +02:00
parent 1658b5f035
commit 2ffdd2d282
6 changed files with 11 additions and 6 deletions

View File

@ -1605,7 +1605,7 @@
"id": "largeclock", "id": "largeclock",
"name": "Large Clock", "name": "Large Clock",
"icon": "largeclock.png", "icon": "largeclock.png",
"version": "0.03", "version": "0.04",
"description": "A readable and informational digital watch, with date, seconds and moon phase", "description": "A readable and informational digital watch, with date, seconds and moon phase",
"readme": "README.md", "readme": "README.md",
"tags": "clock", "tags": "clock",

View File

@ -1,3 +1,4 @@
0.01: Init 0.01: Init
0.02: fix 3/4 moon orientation 0.02: fix 3/4 moon orientation
0.03: Change `largeclock.json` to 'data' file to allow settings to be preserved 0.03: Change `largeclock.json` to 'data' file to allow settings to be preserved
0.04: Allow to disable BTN1 and BTN3 buttons

View File

@ -11,7 +11,7 @@ A readable and informational digital watch, with date, seconds and moon phase an
## How to use it ## How to use it
- The clock can be used as any other one, if you like it just set it as the default clock app in settings > select clock - The clock can be used as any other one, if you like it just set it as the default clock app in settings > select clock
- In setting > large clock you can select which app is to be open by BTN1 and BTN3 - In setting > large clock you can select which app, if any, is to be open by BTN1 and BTN3
## Credits ## Credits

View File

@ -9,8 +9,8 @@ const moonX = 215;
const moonY = 50; const moonY = 50;
const settings = require("Storage").readJSON("largeclock.json", 1); const settings = require("Storage").readJSON("largeclock.json", 1);
const BTN1app = settings.BTN1 || ""; const BTN1app = settings && settings.BTN1 || "";
const BTN3app = settings.BTN3 || ""; const BTN3app = settings && settings.BTN3 || "";
function drawMoon(d) { function drawMoon(d) {
const BLACK = 0, const BLACK = 0,

View File

@ -1,4 +1,4 @@
{ {
"BTN1": "timer.app.js", "BTN1": "",
"BTN3": "calendar.app.js" "BTN3": ""
} }

View File

@ -21,6 +21,10 @@
if (a.n > b.n) return 1; if (a.n > b.n) return 1;
return 0; return 0;
}); });
apps.push({
n: "NONE",
src: ""
});
const settings = s.readJSON("largeclock.json", 1) || { const settings = s.readJSON("largeclock.json", 1) || {
BTN1: "", BTN1: "",