2022-01-13 15:48:05 +00:00
|
|
|
(function(back) {
|
|
|
|
var FILE = "vectorclock.json";
|
|
|
|
// Load settings
|
|
|
|
var settings = Object.assign({
|
|
|
|
}, require('Storage').readJSON(FILE, true) || {});
|
|
|
|
|
|
|
|
function writeSettings() {
|
|
|
|
require('Storage').writeJSON(FILE, settings);
|
|
|
|
}
|
|
|
|
|
2022-01-14 17:58:35 +00:00
|
|
|
var colnames = ["white", "yellow", "green", "cyan", "red", "orange", "magenta", "black"];
|
|
|
|
var colvalues = [0xFFFF, 0xFFE0, 0x07E0, 0x07FF, 0xF800, 0xFD20, 0xF81F, 0x0000];
|
2022-01-13 15:48:05 +00:00
|
|
|
// Show the menu
|
|
|
|
E.showMenu({
|
|
|
|
"" : { "title" : "VectorClock colours" },
|
|
|
|
"< Back" : () => back(),
|
|
|
|
'Time': {
|
|
|
|
value: Math.max(0 | colvalues.indexOf(settings.timecol),0),
|
|
|
|
min: 0, max: colvalues.length-1,
|
|
|
|
format: v => colnames[v],
|
|
|
|
onchange: v => {
|
2022-01-13 16:55:21 +00:00
|
|
|
settings.timecol = colvalues[v];
|
2022-01-13 15:48:05 +00:00
|
|
|
writeSettings();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'Weekday': {
|
|
|
|
value: Math.max(0 | colvalues.indexOf(settings.dowcol),0),
|
|
|
|
min: 0, max: colvalues.length-1,
|
|
|
|
format: v => colnames[v],
|
|
|
|
onchange: v => {
|
2022-01-13 16:55:21 +00:00
|
|
|
settings.dowcol = colvalues[v];
|
2022-01-13 15:48:05 +00:00
|
|
|
writeSettings();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'Date': {
|
|
|
|
value: Math.max(0 | colvalues.indexOf(settings.datecol),0),
|
|
|
|
min: 0, max: colvalues.length-1,
|
|
|
|
format: v => colnames[v],
|
|
|
|
onchange: v => {
|
2022-01-13 16:55:21 +00:00
|
|
|
settings.datecol = colvalues[v];
|
2022-01-13 15:48:05 +00:00
|
|
|
writeSettings();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
})
|