adding data.json in settings and updating links

pull/1994/head
greg@1m 2022-06-23 20:57:30 +02:00
parent 8fe186df28
commit 3d86cb3e23
3 changed files with 6 additions and 11 deletions

View File

@ -137,7 +137,7 @@ function drawTimer() {
function getDataJson(){ function getDataJson(){
var res = {"tasks":"", "weather":[]}; var res = {"tasks":"", "weather":[]};
try { try {
res = storage.readJSON('advCasioData.json'); res = storage.readJSON('advcasio.data.json');
} catch(ex) { } catch(ex) {
return res; return res;
} }
@ -145,7 +145,7 @@ function getDataJson(){
} }
function setDataJson(resJson){ function setDataJson(resJson){
try { try {
res = storage.writeJSON('advCasioData.json', resJson); res = storage.writeJSON('advcasio.data.json', resJson);
} catch(ex) { } catch(ex) {
return res; return res;
} }
@ -181,13 +181,10 @@ function drawWeather(arr) {
// DRAWING FUNCS // DRAWING FUNCS
// //
function drawTasks(str) { function drawTasks(str) {
//g.setFont("8x12", 1);
g.setFont("6x8", 1); g.setFont("6x8", 1);
var t = 60; var t = 60;
var l = 0; var l = 0;
g.drawString(str, l+5, t+0); g.drawString(str, l+5, t+0);
//g.drawString(".meeting", l+5, t+10);
//g.drawString("15h gisele", l+5, t+20);
} }
@ -272,18 +269,12 @@ function draw() {
g.setColor(0, 0, 0); g.setColor(0, 0, 0);
g.setFont("6x12"); g.setFont("6x12");
//g.drawString("woop Process", 30, 20);
//g.setFont("8x12");
//g.drawString("ACTIVATE", 40, 35);
if(dataJson && dataJson.weather) drawWeather(dataJson.weather); if(dataJson && dataJson.weather) drawWeather(dataJson.weather);
if(dataJson && dataJson.tasks) drawTasks(dataJson.tasks); if(dataJson && dataJson.tasks) drawTasks(dataJson.tasks);
g.setFontAlign(0,-1); g.setFontAlign(0,-1);
g.setFont("8x12", 2); g.setFont("8x12", 2);
//g.drawString(getTemperature(), 155, 132);
//g.drawString(Math.round(Bangle.getHealthStatus("last").bpm || 0), 109, 98);
drawSteps(); drawSteps();
g.setFontAlign(-1,-1); g.setFontAlign(-1,-1);

1
apps/advcasio/data.json Normal file
View File

@ -0,0 +1 @@
{"tasks":"", "weather":[]};

View File

@ -16,5 +16,8 @@
"storage": [ "storage": [
{"name":"advcasio.app.js","url":"app.js"}, {"name":"advcasio.app.js","url":"app.js"},
{"name":"advcasio.img","url":"app-icon.js","evaluate":true} {"name":"advcasio.img","url":"app-icon.js","evaluate":true}
],
"data": [
{ "name": "advcasio.data.json", "url": "data.json", "storageFile": true }
] ]
} }