From 1226b20e1939598870427744656c257834ebe8e7 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 28 Apr 2025 21:49:08 +0100 Subject: [PATCH 1/6] qrcode: whitespace --- apps/qrcode/custom.html | 480 ++++++++++++++++++++-------------------- 1 file changed, 239 insertions(+), 241 deletions(-) diff --git a/apps/qrcode/custom.html b/apps/qrcode/custom.html index a3362f101..2149dcde7 100644 --- a/apps/qrcode/custom.html +++ b/apps/qrcode/custom.html @@ -17,61 +17,61 @@
-

Text/URL:

+

Text/URL:

-
- -
-
- -
-
- -
-
- Detected QR code: - None -
- - +
+ +
+
+ +
+
+ +
+
+ Detected QR code: + None +
+ +
- -
- Detected QR code: - None + +
+ Detected QR code: + None
-

Wifi name:

-

Wifi password:

-
- -
- -
+

Wifi name:

+

Wifi password:

+
+ +
+ +
-
-
- - -
+
+
+ + +
-

First Name:

-

Last Name:

-

Phone Number:

-

Email:

-

Website:

+

First Name:

+

Last Name:

+

Phone Number:

+

Email:

+

Website:


@@ -82,228 +82,225 @@

Additional options:


- -
- -
- -
- -
- - - -
+ +
+ +
+ +
+ +
+ + + +
-
-

Click

+
+

Click

- - - - - - - + + + + + + From 86baa4ceddcaa391c618d32eade4876450d7b762 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 28 Apr 2025 22:05:53 +0100 Subject: [PATCH 2/6] qrcode: remove "Click" text --- apps/qrcode/custom.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/qrcode/custom.html b/apps/qrcode/custom.html index 2149dcde7..ec6221a59 100644 --- a/apps/qrcode/custom.html +++ b/apps/qrcode/custom.html @@ -101,7 +101,7 @@ -

Click

+ From 0a4cc641c0bc5362fae65f48ce9da1c196123d93 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 28 Apr 2025 22:06:12 +0100 Subject: [PATCH 3/6] qrcode: return on error (instead of generating more) --- apps/qrcode/custom.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/qrcode/custom.html b/apps/qrcode/custom.html index ec6221a59..9106fdbb5 100644 --- a/apps/qrcode/custom.html +++ b/apps/qrcode/custom.html @@ -270,6 +270,7 @@ } catch (error) { document.getElementById("errors").innerText="Error: QR could not be created."; console.error(error); + return; } targetSize = Math.min(deviceWidth - border, deviceHeight - border); @@ -300,6 +301,7 @@ } catch (error) { document.getElementById("errors").innerText="Error: QR could not be created."; console.error(error); + return; } } From 2401063c7d604aed0e062a6757a4e0bfef069737 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 28 Apr 2025 22:06:37 +0100 Subject: [PATCH 4/6] qrcode: simplify `if` --- apps/qrcode/custom.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/qrcode/custom.html b/apps/qrcode/custom.html index 9106fdbb5..a51190153 100644 --- a/apps/qrcode/custom.html +++ b/apps/qrcode/custom.html @@ -341,7 +341,7 @@ if(document.getElementById("useWIFI").checked){ content = document.getElementById("ssid").value } - if(!(document.getElementById("description").value === "")){ + if(document.getElementById("description").value !== ""){ content = document.getElementById("description").value; } var img = imageconverter.canvastoString(document.getElementsByTagName("canvas")[0],{mode:"1bit",output:"string",compression:true}); From e146686b070db37d397770a614fa032e92c05688 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 28 Apr 2025 22:07:53 +0100 Subject: [PATCH 5/6] qrcode: allow custom app name (for multiple QR codes) --- apps/qrcode/custom.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/qrcode/custom.html b/apps/qrcode/custom.html index a51190153..2ff1cd9db 100644 --- a/apps/qrcode/custom.html +++ b/apps/qrcode/custom.html @@ -101,6 +101,8 @@ + + @@ -365,8 +367,10 @@ g.drawString(content,g.getWidth()/2,g.getHeight()-(g.getHeight()-img[1])/4); `} g.setColor(1,1,1); `; + + var appname = document.getElementById("appname").value.trim() || "qrcode"; sendCustomizedApp({ - storage:[{name:"qrcode.app.js", url:"app.js", content:app}] + storage:[{name:`${appname}.app.js`, url:"app.js", content:app}] }); }); From 0bf0a3fb972117aa44d6f142a87fd0624c23282e Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 28 Apr 2025 22:08:39 +0100 Subject: [PATCH 6/6] qrcode: bump version --- apps/qrcode/ChangeLog | 1 + apps/qrcode/metadata.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/qrcode/ChangeLog b/apps/qrcode/ChangeLog index 52eadbcf9..9b4526c10 100644 --- a/apps/qrcode/ChangeLog +++ b/apps/qrcode/ChangeLog @@ -4,3 +4,4 @@ 0.04: Allow scanning of QR codes from camera or file 0.05: Change brightness on touch 0.06: Add ability to generate contact info (MeCard format) QR code +0.07: Add custom appname (for storing multiple QR codes) diff --git a/apps/qrcode/metadata.json b/apps/qrcode/metadata.json index 89c859a0c..fc70ab27d 100644 --- a/apps/qrcode/metadata.json +++ b/apps/qrcode/metadata.json @@ -2,7 +2,7 @@ "id": "qrcode", "name": "Custom QR Code", "shortName": "QR Code", - "version": "0.06", + "version": "0.07", "description": "Use this to upload a customised QR code to Bangle.js", "icon": "app.png", "tags": "qrcode",