Restructured settings file handling.
parent
2818c1049f
commit
7a409f74a3
|
|
@ -887,19 +887,19 @@
|
|||
{ "id": "berlinc",
|
||||
"name": "Berlin Clock",
|
||||
"icon": "berlin-clock.png",
|
||||
"version":"0.03.07",
|
||||
"version":"0.03.08",
|
||||
"description": "Berlin Clock (see https://en.wikipedia.org/wiki/Mengenlehreuhr)",
|
||||
"tags": "clock",
|
||||
"type":"clock",
|
||||
"allow_emulator":true,
|
||||
"data": [
|
||||
{"name":"berlin-clock.json"}
|
||||
{ "name":"berlinc.json","storageFile":true}
|
||||
],
|
||||
"storage": [
|
||||
{"name":"berlinc.app.js","url":"berlin-clock.js"},
|
||||
{"name":"berlinc.img","url":"berlin-clock-icon.js","evaluate":true},
|
||||
{"name":"berlinc.settings.js","url":"settings.js"},
|
||||
{"name":"berlin-clock.json","url":"berlin-clock.json"}
|
||||
{"name":"berlinc.json","url":"berlin-clock.json"}
|
||||
]
|
||||
},
|
||||
{ "id": "ctrclk",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const height = g.getHeight() - 2 * offset;
|
|||
const rowHeight = height / 4;
|
||||
|
||||
const storage = require("Storage");
|
||||
const settingsfile = 'berlin-clock.json';
|
||||
const settingsfile = 'berlinc.json';
|
||||
var show_date = false;
|
||||
|
||||
rowlights = [];
|
||||
|
|
@ -63,7 +63,15 @@ function drawBerlinClock() {
|
|||
// try to read settings
|
||||
try {
|
||||
const settings = storage.readJSON(settingsfile);
|
||||
show_date=settings['showdate'] || false;
|
||||
if (settings) {
|
||||
if (settings.showdate) {
|
||||
show_date=settings.showdate;
|
||||
} else {
|
||||
console.log("Settings file does not contain showdate.");
|
||||
}
|
||||
} else {
|
||||
console.log("Settings file not defined.")
|
||||
}
|
||||
} catch (exception) {
|
||||
console.log(exception)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
(function(back) {
|
||||
|
||||
const SETTINGS_FILE = 'berlin-clock.json'
|
||||
const SETTINGS_FILE = 'berlinc.json'
|
||||
|
||||
// initialize structure
|
||||
let s = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue