tweaks and docs for readme file

pull/246/head
Gordon Williams 2020-04-07 08:59:24 +01:00
parent a884905384
commit fc2060e7f0
6 changed files with 31 additions and 3 deletions

View File

@ -4,3 +4,4 @@ App Loader ChangeLog
Changed for individual apps are listed in `apps/appname/ChangeLog`
* `Remove All Apps` now doesn't perform a reset before erase - fixes inability to update firmware if settings are wrong
* Added optional `README.md` file for apps

View File

@ -216,6 +216,10 @@ and which gives information about the app for the Launcher.
"type":"...", // optional(if app) - 'app'/'widget'/'launch'/'bootloader'
"tags": "", // comma separated tag list for searching
"readme": "README.md", // if supplied, a link to a markdown-style text file
// that contains more information about this app (usage, etc)
// A 'Read more...' link will be added under the app
"custom": "custom.html", // if supplied, apps/custom.html is loaded in an
// iframe, and it must post back an 'app' structure
// like this one with 'storage','name' and 'id' set up

View File

@ -403,6 +403,7 @@
"description": "Simple stopwatch with Lap Time logging to a JSON file",
"tags": "health",
"allow_emulator":true,
"readme": "README.md",
"storage": [
{"name":"swatch.app.js","url":"stopwatch.js"},
{"name":"swatch.img","url":"stopwatch-icon.js","evaluate":true}

View File

@ -3,7 +3,7 @@ Let's go back in time with this Gameboy inspired Mario retro clock.
Enjoy watching Mario, or one of the other game characters run through a level while showing you the time and date.
![](https://raw.githubusercontent.com/paulcockrell/BangleApps/master/apps/marioclock/mario-clock-screen-shot.png)
![](mario-clock-screen-shot.png)
## Features

20
apps/swatch/README.md Normal file
View File

@ -0,0 +1,20 @@
# Stopwatch
This is stopwatch and lap timer that allows you to save the lap times for later use.
## Usage
* Use `BTN2` (GO/STOP) to start stop the timer
* When running, use `BTN1` (LAP) to store a lap time
* `BTN3` (RESET) resets the time
When stopped, pressing `BTN1` (SAVE) will save the lap times to a file called `swatch-DATEandTIME.json` on the watch.
## Getting lap times
In the App Loader:
* Connect to your Bangle.js
* Go to `My Apps`
* Under `Stopwatch` click the `Download data from app` icon
* You should now see a list of your saved lap times

View File

@ -25,11 +25,13 @@ function showChangeLog(appid) {
}
function showReadme(appid) {
var app = appNameToApp(appid);
var appPath = `apps/${appid}/`;
var markedOptions = { baseUrl : appPath };
function show(contents) {
if (!contents) return;
showPrompt(app.name + " Documentation", marked(contents), {ok: true}, false).catch(() => {});
showPrompt(app.name + " Documentation", marked(contents, markedOptions), {ok: true}, false).catch(() => {});
}
httpGet(`apps/${appid}/${app.readme}`).then(show).catch(()=>show("Failed to load README."));
httpGet(appPath+app.readme).then(show).catch(()=>show("Failed to load README."));
}
function handleCustomApp(appTemplate) {
// Pops up an IFRAME that allows an app to be customised