Allow 'data' style app files to be uploaded with the app (and switch over settings files for various apps)

pull/717/head
Gordon Williams 2021-04-09 09:58:38 +01:00
parent c05d44286e
commit 039024c4ad
6 changed files with 35 additions and 12 deletions

View File

@ -29,3 +29,4 @@ Changed for individual apps are listed in `apps/appname/ChangeLog`
* Added progress bar on Bangle.js for uploads
* Provide a proper error message in case JSON decode fails
* Check you're connecting with a Bangle.js of the correct version
* Allow 'data' style app files to be uploaded with the app (and switch over settings files for various apps)

View File

@ -249,14 +249,20 @@ and which gives information about the app for the Launcher.
{"name":"appid.js", // filename to use in storage.
// If name=='RAM', the code is sent directly to Bangle.js and is not saved to a file
"url":"", // URL of file to load (currently relative to apps/)
"content":"..." // if supplied, this content is loaded directly
"evaluate":true // if supplied, data isn't quoted into a String before upload
"content":"...", // if supplied, this content is loaded directly
"evaluate":true, // if supplied, data isn't quoted into a String before upload
// (eg it's evaluated as JS)
"noOverwrite":true // if supplied, this file will not be overwritten if it
// already exists
},
]
"data": [ // list of files the app writes to
{"name":"appid.data.json", // filename used in storage
"storageFile":true // if supplied, file is treated as storageFile
"url":"", // if supplied URL of file to load (currently relative to apps/)
"content":"...", // if supplied, this content is loaded directly
"evaluate":true, // if supplied, data isn't quoted into a String before upload
// (eg it's evaluated as JS)
},
{"wildcard":"appid.data.*" // wildcard of filenames used in storage
}, // this is mutually exclusive with using "name"

View File

@ -180,6 +180,9 @@
{"name":"setting.boot.js","url":"boot.js"},
{"name":"setting.img","url":"settings-icon.js","evaluate":true}
],
"data": [
{"name":"setting.json", "url":"settings.min.json","evaluate":true}
],
"sortorder" : -2
},
{ "id": "alarm",
@ -439,8 +442,10 @@
"interface":"waypoints.html",
"storage": [
{"name":"gpsnav.app.js","url":"app.min.js"},
{"name":"waypoints.json","url":"waypoints.json","evaluate":false},
{"name":"gpsnav.img","url":"app-icon.js","evaluate":true}
],
"data": [
{"name":"waypoints.json","url":"waypoints.json"}
]
},
{ "id": "heart",
@ -2414,8 +2419,10 @@
"readme": "README.md",
"storage": [
{"name":"worldclock.app.js","url":"app.js"},
{"name":"worldclock.settings.json"},
{"name":"worldclock.img","url":"worldclock-icon.js","evaluate":true}
],
"data": [
{"name":"worldclock.settings.json"}
]
},
{ "id": "digiclock",
@ -2659,8 +2666,10 @@
"readme": "README.md",
"storage": [
{"name":"breath.app.js","url":"app.js"},
{"name":"breath.settings.json","url":"settings.json"},
{"name":"breath.img","url":"app-icon.js","evaluate":true}
],
"data": [
{"name":"breath.settings.json","url":"settings.json"}
]
},
{ "id": "lazyclock",
@ -2757,9 +2766,11 @@
"storage": [
{"name":"gpsservice.app.js","url":"app.js"},
{"name":"gpsservice.settings.js","url":"settings.js"},
{"name":"gpsservice.settings.json","url":"settings.json"},
{"name":"gpsservice.wid.js","url":"widget.js"},
{"name":"gpsservice.img","url":"gpsservice-icon.js","evaluate":true}
],
"data": [
{"name":"gpsservice.settings.json","url":"settings.json"}
]
},
{ "id": "mclockplus",
@ -2856,9 +2867,11 @@
"storage": [
{"name":"gpssetup","url":"gpssetup.js"},
{"name":"gpssetup.settings.js","url":"settings.js"},
{"name":"gpssetup.settings.json","url":"settings.json"},
{"name":"gpssetup.app.js","url":"app.js"},
{"name":"gpssetup.img","url":"icon.js","evaluate":true}
],
"data": [
{"name":"gpssetup.settings.json","url":"settings.json"}
]
},
{ "id": "walkersclock",
@ -2959,8 +2972,10 @@
"interface":"waypoints.html",
"storage": [
{"name":"waypointer.app.js","url":"app.js"},
{"name":"waypoints.json","url":"waypoints.json","evaluate":false},
{"name":"waypointer.img","url":"icon.js","evaluate":true}
],
"data": [
{"name":"waypoints.json","url":"waypoints.json"}
]
},
{ "id": "color_catalog",

View File

@ -0,0 +1 @@
{"ble":true,"blerepl":true,"log":false,"timeout":10,"vibrate":true,"beep":"vib","timezone":0,"HID":false,"clock":null,"12hour":false,"brightness":1,"options":{"wakeOnBTN1":true,"wakeOnBTN2":true,"wakeOnBTN3":true,"wakeOnFaceUp":false,"wakeOnTouch":false,"wakeOnTwist":true,"twistThreshold":819.2,"twistMaxY":-800,"twistTimeout":1000}}

View File

@ -54,8 +54,8 @@ const APP_KEYS = [
'sortorder', 'readme', 'custom', 'interface', 'storage', 'data', 'allow_emulator',
'dependencies'
];
const STORAGE_KEYS = ['name', 'url', 'content', 'evaluate'];
const DATA_KEYS = ['name', 'wildcard', 'storageFile'];
const STORAGE_KEYS = ['name', 'url', 'content', 'evaluate', 'noOverwite'];
const DATA_KEYS = ['name', 'wildcard', 'storageFile', 'url', 'content', 'evaluate'];
const FORBIDDEN_FILE_NAME_CHARS = /[,;]/; // used as separators in appid.info
const VALID_DUPLICATES = [ '.tfmodel', '.tfnames' ];

2
core

@ -1 +1 @@
Subproject commit e65920a91f9f7178c9d8ed6551ac7d9af0a5d6e1
Subproject commit 7d04c488496c873f392c5a068f72a6c75df40f70