From ffbd2b5d605778dedf94bb508abee69572842169 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 2 Sep 2021 11:51:17 +0100 Subject: [PATCH] Add support for 'customConnect' so custom app loaders can tailor what they upload based on the device --- README.md | 5 +++++ apps.json | 6 +++--- apps/openstmap/custom.html | 12 +++++++++++- apps/qrcode/custom.html | 37 +++++++++++++++++++++++-------------- core | 2 +- 5 files changed, 43 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index e71d7eee0..9797e2243 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,11 @@ and which gives information about the app for the Launcher. // like this one with 'storage','name' and 'id' set up // see below for more info + "customConnect": true, // if supplied, ensure we are connected to a device + // before the "custom.html" iframe is loaded. An + // onInit function in "custom.html" is then called + // with info on the currently connected device. + "interface": "interface.html", // if supplied, apps/interface.html is loaded in an // iframe, and it may interact with the connected Bangle // to retrieve information from it diff --git a/apps.json b/apps.json index d8b05de24..289889d65 100644 --- a/apps.json +++ b/apps.json @@ -814,8 +814,8 @@ "icon": "app.png", "version":"0.02", "description": "Use this to upload a customised QR code to Bangle.js", - "tags": "qrcode", - "custom": "custom.html", + "tags": "qrcode,b2", + "custom": "custom.html", "customConnect":true, "storage": [ {"name":"qrcode.app.js"}, {"name":"qrcode.img","url":"app-icon.js","evaluate":true} @@ -1520,7 +1520,7 @@ "version":"0.08", "description": "[BETA] Loads map tiles from OpenStreetMap onto your Bangle.js and displays a map of where you are", "tags": "outdoors,gps,b2", - "custom": "custom.html", + "custom": "custom.html", "customConnect":true, "storage": [ {"name":"openstmap","url":"openstmap.js"}, {"name":"openstmap.app.js","url":"app.js"}, diff --git a/apps/openstmap/custom.html b/apps/openstmap/custom.html index ac046d41d..88d94ed37 100644 --- a/apps/openstmap/custom.html +++ b/apps/openstmap/custom.html @@ -32,7 +32,7 @@
-

3 bit
+

3 bit