mirror of https://github.com/espruino/BangleApps
tweaks and docs for readme file
parent
a884905384
commit
fc2060e7f0
|
@ -4,3 +4,4 @@ App Loader ChangeLog
|
||||||
Changed for individual apps are listed in `apps/appname/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
|
* `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
|
||||||
|
|
|
@ -216,6 +216,10 @@ and which gives information about the app for the Launcher.
|
||||||
"type":"...", // optional(if app) - 'app'/'widget'/'launch'/'bootloader'
|
"type":"...", // optional(if app) - 'app'/'widget'/'launch'/'bootloader'
|
||||||
"tags": "", // comma separated tag list for searching
|
"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
|
"custom": "custom.html", // if supplied, apps/custom.html is loaded in an
|
||||||
// iframe, and it must post back an 'app' structure
|
// iframe, and it must post back an 'app' structure
|
||||||
// like this one with 'storage','name' and 'id' set up
|
// like this one with 'storage','name' and 'id' set up
|
||||||
|
|
|
@ -403,6 +403,7 @@
|
||||||
"description": "Simple stopwatch with Lap Time logging to a JSON file",
|
"description": "Simple stopwatch with Lap Time logging to a JSON file",
|
||||||
"tags": "health",
|
"tags": "health",
|
||||||
"allow_emulator":true,
|
"allow_emulator":true,
|
||||||
|
"readme": "README.md",
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name":"swatch.app.js","url":"stopwatch.js"},
|
{"name":"swatch.app.js","url":"stopwatch.js"},
|
||||||
{"name":"swatch.img","url":"stopwatch-icon.js","evaluate":true}
|
{"name":"swatch.img","url":"stopwatch-icon.js","evaluate":true}
|
||||||
|
|
|
@ -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.
|
Enjoy watching Mario, or one of the other game characters run through a level while showing you the time and date.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
@ -25,11 +25,13 @@ function showChangeLog(appid) {
|
||||||
}
|
}
|
||||||
function showReadme(appid) {
|
function showReadme(appid) {
|
||||||
var app = appNameToApp(appid);
|
var app = appNameToApp(appid);
|
||||||
|
var appPath = `apps/${appid}/`;
|
||||||
|
var markedOptions = { baseUrl : appPath };
|
||||||
function show(contents) {
|
function show(contents) {
|
||||||
if (!contents) return;
|
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) {
|
function handleCustomApp(appTemplate) {
|
||||||
// Pops up an IFRAME that allows an app to be customised
|
// Pops up an IFRAME that allows an app to be customised
|
||||||
|
|
Loading…
Reference in New Issue