From ba9b8167141540e700411993e5a01adde7994f97 Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Tue, 13 Jan 2026 21:59:45 -0500 Subject: [PATCH 1/8] Update upload and uninstall messages for clarity --- js/comms.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/comms.js b/js/comms.js index f119985..246a5b3 100644 --- a/js/comms.js +++ b/js/comms.js @@ -323,7 +323,8 @@ const Comms = { // Start the upload function doUpload() { Progress.show({min:0.05, max:0.10}); // 5-10% for progress writing - Comms.showMessage(`Installing\n${app.id}...`). + var msg = app.id=="fwupdate"?`Updating Firmware...`:`Installing\n${app.name}...` + Comms.showMessage(msg). then(() => Comms.write("\x10"+Comms.getProgressCmd()+"\n", {noWait:true})). then(() => { doUploadFiles(); @@ -507,7 +508,7 @@ const Comms = { /* App Info now doesn't contain .files, so to erase, we need to read the info file ourselves. */ return (options.noReset ? Promise.resolve() : Comms.reset()). - then(()=>Comms.showMessage(`Erasing\n${app.id}...`)). + then(()=>Comms.showMessage(`Uninstalling\n${app.name}...`)). then(()=>options.containsFileList ? app : Comms.getAppInfo(app)). then(app=>{ let cmds = ''; From 5467bea4237c2ff7f10507ec57bb1a584ca6e0a4 Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Tue, 13 Jan 2026 22:06:23 -0500 Subject: [PATCH 2/8] Fix message formatting in upload and uninstall functions --- js/comms.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/comms.js b/js/comms.js index 246a5b3..a1787c1 100644 --- a/js/comms.js +++ b/js/comms.js @@ -323,7 +323,8 @@ const Comms = { // Start the upload function doUpload() { Progress.show({min:0.05, max:0.10}); // 5-10% for progress writing - var msg = app.id=="fwupdate"?`Updating Firmware...`:`Installing\n${app.name}...` + console.log(JSON.stringify(app)); + let msg = app.id=="fwupdate"?`Updating firmware...`:`Installing\n'${app.name}'...` Comms.showMessage(msg). then(() => Comms.write("\x10"+Comms.getProgressCmd()+"\n", {noWait:true})). then(() => { @@ -508,7 +509,7 @@ const Comms = { /* App Info now doesn't contain .files, so to erase, we need to read the info file ourselves. */ return (options.noReset ? Promise.resolve() : Comms.reset()). - then(()=>Comms.showMessage(`Uninstalling\n${app.name}...`)). + then(()=>Comms.showMessage(`Uninstalling\n'${app.name}'...`)). then(()=>options.containsFileList ? app : Comms.getAppInfo(app)). then(app=>{ let cmds = ''; From 16bb9977fb6511317a681080db43a461a491f2e4 Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Mon, 19 Jan 2026 15:56:29 -0500 Subject: [PATCH 3/8] Update comms.js --- js/comms.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/comms.js b/js/comms.js index a1787c1..eadf6f8 100644 --- a/js/comms.js +++ b/js/comms.js @@ -324,7 +324,7 @@ const Comms = { function doUpload() { Progress.show({min:0.05, max:0.10}); // 5-10% for progress writing console.log(JSON.stringify(app)); - let msg = app.id=="fwupdate"?`Updating firmware...`:`Installing\n'${app.name}'...` + let msg = app.id=="fwupdate"?`Installing new firmware...`:`Installing\n'${app.name}'...` Comms.showMessage(msg). then(() => Comms.write("\x10"+Comms.getProgressCmd()+"\n", {noWait:true})). then(() => { From 12dbf3e371a6c32a44fe3cb6f9a4311d76874ee3 Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Wed, 21 Jan 2026 15:38:03 -0500 Subject: [PATCH 4/8] Fix promise chain for uninstalling app message so uninstall name works --- js/comms.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/comms.js b/js/comms.js index eadf6f8..2e808ed 100644 --- a/js/comms.js +++ b/js/comms.js @@ -509,8 +509,8 @@ const Comms = { /* App Info now doesn't contain .files, so to erase, we need to read the info file ourselves. */ return (options.noReset ? Promise.resolve() : Comms.reset()). - then(()=>Comms.showMessage(`Uninstalling\n'${app.name}'...`)). then(()=>options.containsFileList ? app : Comms.getAppInfo(app)). + then(app=>Comms.showMessage(`Uninstalling\n'${app.name}'...`).then(()=>app)). then(app=>{ let cmds = ''; // remove App files: regular files, exact names only From 91de1a986471aaf8b7464681cd60c2256e424bc0 Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Wed, 21 Jan 2026 15:39:46 -0500 Subject: [PATCH 5/8] Change upload message from 'Installing' to 'Downloading' --- js/comms.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/comms.js b/js/comms.js index 2e808ed..4b892ce 100644 --- a/js/comms.js +++ b/js/comms.js @@ -324,7 +324,7 @@ const Comms = { function doUpload() { Progress.show({min:0.05, max:0.10}); // 5-10% for progress writing console.log(JSON.stringify(app)); - let msg = app.id=="fwupdate"?`Installing new firmware...`:`Installing\n'${app.name}'...` + let msg = app.id=="fwupdate"?`Downloading firmware...`:`Installing\n'${app.name}'...` Comms.showMessage(msg). then(() => Comms.write("\x10"+Comms.getProgressCmd()+"\n", {noWait:true})). then(() => { From 4e4f803b472c2a4fea6663d8b25e6c5c011a466e Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Wed, 21 Jan 2026 15:41:19 -0500 Subject: [PATCH 6/8] Refactor CODE_PROGRESSBAR for improved rendering with round progress bar --- js/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/utils.js b/js/utils.js index 557cc1d..ee7581b 100644 --- a/js/utils.js +++ b/js/utils.js @@ -29,7 +29,7 @@ const Const = { CONNECTION_DEVICE : undefined, /* The code to upload to the device show a progress bar on the screen (should define a fn. called 'p') */ - CODE_PROGRESSBAR : "g.drawRect(10,g.getHeight()-16,g.getWidth()-10,g.getHeight()-8).flip();p=x=>g.fillRect(10,g.getHeight()-16,10+(g.getWidth()-20)*x/100,g.getHeight()-8).flip();", + CODE_PROGRESSBAR : "g.setColor(g.theme.fg).fillRect({x:10,y:g.getHeight()-18,w:g.getWidth()-20,h:10,r:30}).setColor(g.theme.bg).fillRect({x:11,y:g.getHeight()-17,w:g.getWidth()-22,h:8,r:30}).flip();g.setColor(g.theme.fg);p=x=>g.fillRect({x:11,y:g.getHeight()-17,w:(g.getWidth()-22)*(x/100),h:8,r:30}).flip();", /* Maximum number of apps shown in the library, then a 'Show more...' entry is added.. */ MAX_APPS_SHOWN : 30, From 3ff983df842443c0cd157bfa5bf15b12ec5caf98 Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Wed, 21 Jan 2026 16:09:14 -0500 Subject: [PATCH 7/8] Fix message formatting for firmware update notification --- js/comms.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/comms.js b/js/comms.js index 4b892ce..cad0d24 100644 --- a/js/comms.js +++ b/js/comms.js @@ -324,7 +324,7 @@ const Comms = { function doUpload() { Progress.show({min:0.05, max:0.10}); // 5-10% for progress writing console.log(JSON.stringify(app)); - let msg = app.id=="fwupdate"?`Downloading firmware...`:`Installing\n'${app.name}'...` + let msg = app.id=="fwupdate"?`Downloading\nfirmware...`:`Installing\n'${app.name}'...` Comms.showMessage(msg). then(() => Comms.write("\x10"+Comms.getProgressCmd()+"\n", {noWait:true})). then(() => { From 78ee6835ed6f003249b595873271bc57d6ebac2b Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Mon, 1 Jun 2026 21:45:57 -0400 Subject: [PATCH 8/8] Use showAppInfo --- js/utils.js | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/js/utils.js b/js/utils.js index ee7581b..3ced064 100644 --- a/js/utils.js +++ b/js/utils.js @@ -29,7 +29,7 @@ const Const = { CONNECTION_DEVICE : undefined, /* The code to upload to the device show a progress bar on the screen (should define a fn. called 'p') */ - CODE_PROGRESSBAR : "g.setColor(g.theme.fg).fillRect({x:10,y:g.getHeight()-18,w:g.getWidth()-20,h:10,r:30}).setColor(g.theme.bg).fillRect({x:11,y:g.getHeight()-17,w:g.getWidth()-22,h:8,r:30}).flip();g.setColor(g.theme.fg);p=x=>g.fillRect({x:11,y:g.getHeight()-17,w:(g.getWidth()-22)*(x/100),h:8,r:30}).flip();", + CODE_PROGRESSBAR : "g.drawRect(10,g.getHeight()-16,g.getWidth()-10,g.getHeight()-8).flip();p=x=>g.fillRect(10,g.getHeight()-16,10+(g.getWidth()-20)*x/100,g.getHeight()-8).flip();", /* Maximum number of apps shown in the library, then a 'Show more...' entry is added.. */ MAX_APPS_SHOWN : 30, @@ -59,13 +59,19 @@ let DEVICEINFO = [ name : "Bangle.js 1", features : ["BLE","BLEHID","GRAPHICS","ACCEL","MAG"], g : { width : 240, height : 240, bpp : 16 }, - img : "https://www.espruino.com/img/BANGLEJS_thumb.jpg" + img : "https://www.espruino.com/img/BANGLEJS_thumb.jpg", + link : "https://www.espruino.com/Bangle.js", + emulatorURL : "/emu/emu_banglejs1.html", + emulatorWin : "innerWidth=290,innerHeight=268,location=0" }, { id : "BANGLEJS2", name : "Bangle.js 2", features : ["BLE","BLEHID","GRAPHICS","ACCEL","MAG","PRESSURE","TOUCH"], g : { width : 176, height : 176, bpp : 3 }, - img : "https://www.espruino.com/img/BANGLEJS2_thumb.jpg" + img : "https://www.espruino.com/img/BANGLEJS2_thumb.jpg", + link : "https://www.espruino.com/Bangle.js2", + emulatorURL : "/emu/emu_banglejs2.html", + emulatorWin : "innerWidth=290,innerHeight=268,location=0" }, { id : "PUCKJS", name : "Puck.js", @@ -114,6 +120,19 @@ let DEVICEINFO = [ img : "https://www.espruino.com/img/ESP32_thumb.jpg" } ]; +if ((typeof window !== "undefined") && window.localStorage.getItem("BANGLEJS3")) { + // type window.localStorage.setItem("BANGLEJS3",true) to enable this for testing + DEVICEINFO.push({ + id : "BANGLEJS3", + name : "Bangle.js 3", + features : ["BLE","BLEHID","GRAPHICS","ACCEL","MAG","PRESSURE","TOUCH"], + g : { width : 240, height : 240, bpp : 6 }, + img : "https://www.espruino.com/img/BANGLEJS3_thumb.jpg", + link : "https://www.espruino.com/Bangle.js3", + emulatorURL : "/emu/emu_banglejs3.html", + emulatorWin : "innerWidth=290,innerHeight=268,location=0" + }); +} /* When a char is not in Espruino's iso8859-1 codepage, try and use these conversions */ @@ -360,8 +379,8 @@ function getVersionInfo(appListing, appInstalled) { let canUpdate = false; function clicky(v) { if (appInstalled) - return `${v}`; - return `${v}`; + return `${v}`; + return `${v}`; } if (!appInstalled) {