Update pebbled.settings.js

master
Romanist 2023-05-26 13:37:00 +04:00 committed by GitHub
parent ea18926dc8
commit 48a2671ff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -2,7 +2,7 @@
const SETTINGS_FILE = "pebbleDistance.json";
// initialize with default settings...
let s = {'bg': '#0f0', 'color': 'Green', 'avStep': 0.75};
let s = {'bg': '#0f0', 'color': 'Green', 'avStep': 0.75, 'localization': 'World'};
// ...and overwrite them with any saved values
// This way saved values are preserved if a new version adds more settings
@ -20,9 +20,10 @@
var color_options = ['Green','Orange','Cyan','Purple','Red','Blue'];
var bg_code = ['#0f0','#ff0','#0ff','#f0f','#f00','#00f'];
var local_options = ['World', 'US'];
E.showMenu({
'': { 'title': 'Pebble Clock' },
'': { 'title': 'PebbleD Clock' },
'< Back': back,
'Color': {
value: 0 | color_options.indexOf(s.color),
@ -43,6 +44,15 @@
s.avStep = v;
save();
}
},
'Localization': {
value: 0 | local_options.indexOf(s.localization),
min: 0, max: 1,
format: v => local_options[v],
onchange: v => {
s.localization = local_options[v];
save();
},
}
});
});