From 992f4cdf88f0faa404d9def0d680d17aa096bc6d Mon Sep 17 00:00:00 2001 From: Ronin0000 <89286474+Ronin0000@users.noreply.github.com> Date: Thu, 3 Feb 2022 17:02:34 -0800 Subject: [PATCH 01/11] Create appb2.js --- apps/torch/appb2.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 apps/torch/appb2.js diff --git a/apps/torch/appb2.js b/apps/torch/appb2.js new file mode 100644 index 000000000..e15e3c9e1 --- /dev/null +++ b/apps/torch/appb2.js @@ -0,0 +1,16 @@ +const SETTINGS_FILE = "torch.json"; +let settings; + +function loadSettings() { + settings = require("Storage").readJSON(SETTINGS_FILE,1)|| {'bg': '#FFFFFF', 'color': 'White'}; +} + +loadSettings(); + +Bangle.setLCDPower(1); +Bangle.setLCDTimeout(0); +g.reset(); +g.setColor(settings.bg); +g.fillRect(0,0,g.getWidth(),g.getHeight()); +// Any button turns off +setWatch(()=>load(), BTN1); From 697d12e18d3d144540058564dac06af9757f0d3a Mon Sep 17 00:00:00 2001 From: Ronin0000 <89286474+Ronin0000@users.noreply.github.com> Date: Thu, 3 Feb 2022 17:03:47 -0800 Subject: [PATCH 02/11] Update metadata.json --- apps/torch/metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/torch/metadata.json b/apps/torch/metadata.json index 1f64e1e82..90741384e 100644 --- a/apps/torch/metadata.json +++ b/apps/torch/metadata.json @@ -8,7 +8,8 @@ "tags": "tool,torch", "supports": ["BANGLEJS"], "storage": [ - {"name":"torch.app.js","url":"app.js"}, + {"name":"torch.app.js","url":"app.js","supports": ["BANGLEJS"]}, + {"name":"torch.app.js","url":"appb2.js","supports": ["BANGLEJS2"]}, {"name":"torch.wid.js","url":"widget.js"}, {"name":"torch.img","url":"app-icon.js","evaluate":true}, {"name":"torch.settings.js","url":"settings.js"} From 4c72fe50d5fbc346c21adf5e3712258041b51631 Mon Sep 17 00:00:00 2001 From: Ronin0000 <89286474+Ronin0000@users.noreply.github.com> Date: Thu, 3 Feb 2022 17:04:17 -0800 Subject: [PATCH 03/11] Delete apps/rtorch directory --- apps/rtorch/ChangeLog | 2 -- apps/rtorch/app-icon.js | 1 - apps/rtorch/app.js | 39 -------------------------------------- apps/rtorch/app.png | Bin 1770 -> 0 bytes apps/rtorch/metadata.json | 16 ---------------- apps/rtorch/widget.js | 26 ------------------------- 6 files changed, 84 deletions(-) delete mode 100644 apps/rtorch/ChangeLog delete mode 100644 apps/rtorch/app-icon.js delete mode 100644 apps/rtorch/app.js delete mode 100644 apps/rtorch/app.png delete mode 100644 apps/rtorch/metadata.json delete mode 100644 apps/rtorch/widget.js diff --git a/apps/rtorch/ChangeLog b/apps/rtorch/ChangeLog deleted file mode 100644 index 13cbb6e72..000000000 --- a/apps/rtorch/ChangeLog +++ /dev/null @@ -1,2 +0,0 @@ -0.01: Cloning torch and making it red :D -0.02: Modify for setUI and Bangle 2 diff --git a/apps/rtorch/app-icon.js b/apps/rtorch/app-icon.js deleted file mode 100644 index ff1265c9b..000000000 --- a/apps/rtorch/app-icon.js +++ /dev/null @@ -1 +0,0 @@ -require("heatshrink").decompress(atob("mEw4UA///oP4gH+t9TCQ1VAAYLpgILunoLK/4LJgf/6oLIh//+oLK/oLIhapBBZEqBYIwDBYu/GAgLE1WvGAgLF1YwEBQcC1WqGAgLGGAgLDhQLBGAdQBYwwCBQgLDGASlFlQLC3/8BYoIBGAXwBQkCFgILC4AuFBYeAFw2v/wLBBQqNCBYOgBQp1B1/qCw5dDFoxdEBQwuBAAOoBQykCHI4uXgZPBFxEP/QuJn5/CFw7DBLpILB9QuHEYP//QuHHYP//wuHKYL0HGAoLJn/8BZMP+ALJgfABRA=")) \ No newline at end of file diff --git a/apps/rtorch/app.js b/apps/rtorch/app.js deleted file mode 100644 index 03a50ee10..000000000 --- a/apps/rtorch/app.js +++ /dev/null @@ -1,39 +0,0 @@ -Bangle.setLCDPower(1); -Bangle.setLCDTimeout(0); -g.reset(); -c = 1; - -function setColor(delta){ - c+=delta; - c = Math.max(c,0); - c = Math.min(c,2); - if (c<1){ - g.setColor(c,0,0); - Bangle.setLCDBrightness(c >= 0.1 ? c : 0.1); - }else{ - g.setColor(1,c-1,c-1); - Bangle.setLCDBrightness(1); - } - g.fillRect(0,0,g.getWidth(),g.getHeight()); -} - -function updownHandler(direction){ - if (direction == undefined){ - c=1; - setColor(0); - } else { - setColor(-direction * 0.1); - } -} - -setColor(0); - -// Bangle 1: -// BTN1: light up toward white -// BTN3: light down to red -// BTN2: reset -// Bangle 2: -// Swipe up: light up toward white -// Swipe down: light down to red -// BTN1: reset -Bangle.setUI("updown", updownHandler); diff --git a/apps/rtorch/app.png b/apps/rtorch/app.png deleted file mode 100644 index 17b0f3efcd9ff5c3fb5656b12b728983569670c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1770 zcmVpF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H126stB zK~!jg?U`+CTUQy!f9GDuzVW+bJ9VE0hf~F-=-07%v|-B-Acw0*$p}w1Nr* zlTeZN0av0R_(FwHp%V}d_My;qA2zX}ma(oc+8P#G&{n1;OVT8c7bmfuI8OX}4en=Q-y&_g=v!OWJII2U?AaCyWYIjwG0{*^+=}R7}OFKxN5h z+l7Jfu-OLS9-{;P-@q#MziU9wY#4itj=Om?plMBj$LO#dzKyoEwW)ed%c*=a@z_&W zFWVlu*==Zi)zD~*6bglusOoOdPEQ_;4h@d6U1#@R3fzCHIpo0&>IIU4Rq*L7?z51v3Rx~lSLhZ|Qm zOUrm{-Q#T7BF;`F+ZMwMARdhn8;|poh8_GfP`B=JHe?2*M4_kfc*h4Wzt!oUhadis z$wUkx1m4;@I(P1-Wu57?AqGO9(SG=`n&_j=wRyVJcazuES@13Dz z`8p@>G)ctMt33mAgIdj=YHj}2pVqx1Xd^$DBNVp%V>%3dv#68LJveU^h1EGWF z{Rr_?sWv`q62CJ~M}IB8x_S7~@Bm1O-Q~d*sO8PZJ8>t*%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++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "rtorch", - "name": "Red Torch", - "shortName": "RedTorch", - "version": "0.02", - "description": "Turns screen RED to help you see in the dark without breaking your night vision. Select from the launcher or on Bangle 1 press BTN3,BTN1,BTN3,BTN1 quickly to start when in any app that shows widgets", - "icon": "app.png", - "tags": "tool,torch", - "supports": ["BANGLEJS","BANGLEJS2"], - "allow_emulator": true, - "storage": [ - {"name":"rtorch.app.js","url":"app.js"}, - {"name":"rtorch.wid.js","url":"widget.js", "supports": ["BANGLEJS"]}, - {"name":"rtorch.img","url":"app-icon.js","evaluate":true} - ] -} diff --git a/apps/rtorch/widget.js b/apps/rtorch/widget.js deleted file mode 100644 index 89009266d..000000000 --- a/apps/rtorch/widget.js +++ /dev/null @@ -1,26 +0,0 @@ -(function() { - var clickTimes = []; - var clickPattern = ""; - var TAPS = 4; // number of taps - var PERIOD = 1; // seconds - - // we don't actually create/draw a widget here at all... - Bangle.on("lcdPower",function(on) { - // First click (that turns LCD on) isn't given to - // setWatch, so handle it here - if (!on) return; - clickTimes=[getTime()]; - clickPattern="x"; - }); - function tap(e,c) { - clickPattern = clickPattern.substr(-3)+c; - while (clickTimes.length>=TAPS) clickTimes.shift(); - clickTimes.push(e.time); - var clickPeriod = e.time-clickTimes[0]; - if (clickPeriod Date: Thu, 3 Feb 2022 17:06:35 -0800 Subject: [PATCH 04/11] Update metadata.json --- apps/torch/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/torch/metadata.json b/apps/torch/metadata.json index 90741384e..dacc21432 100644 --- a/apps/torch/metadata.json +++ b/apps/torch/metadata.json @@ -6,7 +6,7 @@ "description": "Turns screen white to help you see in the dark. Select from the launcher or press BTN1,BTN3,BTN1,BTN3 quickly to start when in any app that shows widgets. You can also set the color through the apps settings menu.", "icon": "app.png", "tags": "tool,torch", - "supports": ["BANGLEJS"], + "supports": ["BANGLEJS","BANGLEJS2"], "storage": [ {"name":"torch.app.js","url":"app.js","supports": ["BANGLEJS"]}, {"name":"torch.app.js","url":"appb2.js","supports": ["BANGLEJS2"]}, From 1bd2da533abb98da5e7721b94a5597a8f07f09fc Mon Sep 17 00:00:00 2001 From: Ronin0000 <89286474+Ronin0000@users.noreply.github.com> Date: Thu, 3 Feb 2022 17:13:07 -0800 Subject: [PATCH 05/11] Update metadata.json --- apps/torch/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/torch/metadata.json b/apps/torch/metadata.json index dacc21432..574ccbae5 100644 --- a/apps/torch/metadata.json +++ b/apps/torch/metadata.json @@ -2,7 +2,7 @@ "id": "torch", "name": "Torch", "shortName": "Torch", - "version": "0.03", + "version": "0.04", "description": "Turns screen white to help you see in the dark. Select from the launcher or press BTN1,BTN3,BTN1,BTN3 quickly to start when in any app that shows widgets. You can also set the color through the apps settings menu.", "icon": "app.png", "tags": "tool,torch", From aafb1dda50feecab187a70f831d8fe2c9959e54e Mon Sep 17 00:00:00 2001 From: Ronin0000 <89286474+Ronin0000@users.noreply.github.com> Date: Thu, 3 Feb 2022 17:14:49 -0800 Subject: [PATCH 06/11] Update ChangeLog --- apps/torch/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/torch/ChangeLog b/apps/torch/ChangeLog index de1bcd265..4d8f47500 100644 --- a/apps/torch/ChangeLog +++ b/apps/torch/ChangeLog @@ -1,3 +1,4 @@ 0.01: New App! 0.02: Change start sequence to BTN1/3/1/3 to avoid accidental turning on (fix #342) 0.03: Add Color Changing Settings +0.04: Add Support For Bangle.js 2 From 42d0104d02d8647b255bdd7ade6b67a2000e9afb Mon Sep 17 00:00:00 2001 From: Ronin0000 <89286474+Ronin0000@users.noreply.github.com> Date: Thu, 3 Feb 2022 17:23:06 -0800 Subject: [PATCH 07/11] Update metadata.json --- apps/torch/metadata.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/torch/metadata.json b/apps/torch/metadata.json index 574ccbae5..30ca36c1b 100644 --- a/apps/torch/metadata.json +++ b/apps/torch/metadata.json @@ -3,14 +3,14 @@ "name": "Torch", "shortName": "Torch", "version": "0.04", - "description": "Turns screen white to help you see in the dark. Select from the launcher or press BTN1,BTN3,BTN1,BTN3 quickly to start when in any app that shows widgets. You can also set the color through the apps settings menu.", + "description": "Turns screen white to help you see in the dark. Select from the launcher or press BTN1,BTN3,BTN1,BTN3 quickly to start when in any app that shows widgets on Bangle.js 1. You can also set the color through the app's setting menu.", "icon": "app.png", "tags": "tool,torch", "supports": ["BANGLEJS","BANGLEJS2"], "storage": [ {"name":"torch.app.js","url":"app.js","supports": ["BANGLEJS"]}, {"name":"torch.app.js","url":"appb2.js","supports": ["BANGLEJS2"]}, - {"name":"torch.wid.js","url":"widget.js"}, + {"name":"torch.wid.js","url":"widget.js","supports": ["BANGLEJS"]}, {"name":"torch.img","url":"app-icon.js","evaluate":true}, {"name":"torch.settings.js","url":"settings.js"} ] From 8d3f6bb0ba9a607c8479ddb46173f6ace023eed3 Mon Sep 17 00:00:00 2001 From: Ronin0000 <89286474+Ronin0000@users.noreply.github.com> Date: Thu, 3 Feb 2022 17:32:20 -0800 Subject: [PATCH 08/11] Add files via upload --- apps/rtorch/ChangeLog | 2 ++ apps/rtorch/app-icon.js | 1 + apps/rtorch/app.js | 39 ++++++++++++++++++++++++++++++++++++++ apps/rtorch/app.png | Bin 0 -> 1770 bytes apps/rtorch/metadata.json | 16 ++++++++++++++++ apps/rtorch/widget.js | 26 +++++++++++++++++++++++++ 6 files changed, 84 insertions(+) create mode 100644 apps/rtorch/ChangeLog create mode 100644 apps/rtorch/app-icon.js create mode 100644 apps/rtorch/app.js create mode 100644 apps/rtorch/app.png create mode 100644 apps/rtorch/metadata.json create mode 100644 apps/rtorch/widget.js diff --git a/apps/rtorch/ChangeLog b/apps/rtorch/ChangeLog new file mode 100644 index 000000000..13cbb6e72 --- /dev/null +++ b/apps/rtorch/ChangeLog @@ -0,0 +1,2 @@ +0.01: Cloning torch and making it red :D +0.02: Modify for setUI and Bangle 2 diff --git a/apps/rtorch/app-icon.js b/apps/rtorch/app-icon.js new file mode 100644 index 000000000..ff1265c9b --- /dev/null +++ b/apps/rtorch/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEw4UA///oP4gH+t9TCQ1VAAYLpgILunoLK/4LJgf/6oLIh//+oLK/oLIhapBBZEqBYIwDBYu/GAgLE1WvGAgLF1YwEBQcC1WqGAgLGGAgLDhQLBGAdQBYwwCBQgLDGASlFlQLC3/8BYoIBGAXwBQkCFgILC4AuFBYeAFw2v/wLBBQqNCBYOgBQp1B1/qCw5dDFoxdEBQwuBAAOoBQykCHI4uXgZPBFxEP/QuJn5/CFw7DBLpILB9QuHEYP//QuHHYP//wuHKYL0HGAoLJn/8BZMP+ALJgfABRA=")) \ No newline at end of file diff --git a/apps/rtorch/app.js b/apps/rtorch/app.js new file mode 100644 index 000000000..03a50ee10 --- /dev/null +++ b/apps/rtorch/app.js @@ -0,0 +1,39 @@ +Bangle.setLCDPower(1); +Bangle.setLCDTimeout(0); +g.reset(); +c = 1; + +function setColor(delta){ + c+=delta; + c = Math.max(c,0); + c = Math.min(c,2); + if (c<1){ + g.setColor(c,0,0); + Bangle.setLCDBrightness(c >= 0.1 ? c : 0.1); + }else{ + g.setColor(1,c-1,c-1); + Bangle.setLCDBrightness(1); + } + g.fillRect(0,0,g.getWidth(),g.getHeight()); +} + +function updownHandler(direction){ + if (direction == undefined){ + c=1; + setColor(0); + } else { + setColor(-direction * 0.1); + } +} + +setColor(0); + +// Bangle 1: +// BTN1: light up toward white +// BTN3: light down to red +// BTN2: reset +// Bangle 2: +// Swipe up: light up toward white +// Swipe down: light down to red +// BTN1: reset +Bangle.setUI("updown", updownHandler); diff --git a/apps/rtorch/app.png b/apps/rtorch/app.png new file mode 100644 index 0000000000000000000000000000000000000000..17b0f3efcd9ff5c3fb5656b12b728983569670c9 GIT binary patch literal 1770 zcmVpF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuU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{QWgKo1Y@o}jjN$@J+3ah$!G zb|F~xQ!iH8b)Xm?ARLy2hvx79BkZERBS?iRIe2eBd+(Z{dB=hsXbQN5l&6ShUlL!Y ztQY+|unm9*W`5Ba~xUr#nO|%k)^gR!pI#;7e%{{3-Tkz9|H9eVEIu z|5l09GM|C|n63yIy$NQMo6%T}41`nVp ziu`MQIMQ_MEIxCbwb3==c6G%0Lu8-usRQ4k7l(|$mbau=wo;+!{O7P zWh!S`s_&M=11LhbJZRP`CuZR7bMU!r2D7H2xSBY2v5jPA!5iak0S~i_xb4tU7n=H) zd_I3)F}%O75k*x=rzXiHhIsD48`L-_ZX0+g+D6+B9d(Vw!rjx!q_4uFQC&X+Kb=f6 z7Mb}$5v+40{`8yYt8N!~C@N%Up8e^#+2s6$)!~ZH!Kadp&cZvYyhvL^@9hK+iz@NC z(a?uI*OpKcY#^>NgRF(EtDd M07*qoM6N<$f@-*GDF6Tf literal 0 HcmV?d00001 diff --git a/apps/rtorch/metadata.json b/apps/rtorch/metadata.json new file mode 100644 index 000000000..ee056ac57 --- /dev/null +++ b/apps/rtorch/metadata.json @@ -0,0 +1,16 @@ +{ + "id": "rtorch", + "name": "Red Torch", + "shortName": "RedTorch", + "version": "0.02", + "description": "Turns screen RED to help you see in the dark without breaking your night vision. Select from the launcher or on Bangle 1 press BTN3,BTN1,BTN3,BTN1 quickly to start when in any app that shows widgets", + "icon": "app.png", + "tags": "tool,torch", + "supports": ["BANGLEJS","BANGLEJS2"], + "allow_emulator": true, + "storage": [ + {"name":"rtorch.app.js","url":"app.js"}, + {"name":"rtorch.wid.js","url":"widget.js", "supports": ["BANGLEJS"]}, + {"name":"rtorch.img","url":"app-icon.js","evaluate":true} + ] +} diff --git a/apps/rtorch/widget.js b/apps/rtorch/widget.js new file mode 100644 index 000000000..89009266d --- /dev/null +++ b/apps/rtorch/widget.js @@ -0,0 +1,26 @@ +(function() { + var clickTimes = []; + var clickPattern = ""; + var TAPS = 4; // number of taps + var PERIOD = 1; // seconds + + // we don't actually create/draw a widget here at all... + Bangle.on("lcdPower",function(on) { + // First click (that turns LCD on) isn't given to + // setWatch, so handle it here + if (!on) return; + clickTimes=[getTime()]; + clickPattern="x"; + }); + function tap(e,c) { + clickPattern = clickPattern.substr(-3)+c; + while (clickTimes.length>=TAPS) clickTimes.shift(); + clickTimes.push(e.time); + var clickPeriod = e.time-clickTimes[0]; + if (clickPeriod Date: Fri, 4 Feb 2022 07:00:13 -0800 Subject: [PATCH 09/11] Update app.js --- apps/torch/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/torch/app.js b/apps/torch/app.js index 9504f3ac0..864efb883 100644 --- a/apps/torch/app.js +++ b/apps/torch/app.js @@ -14,5 +14,6 @@ g.setColor(settings.bg); g.fillRect(0,0,g.getWidth(),g.getHeight()); // Any button turns off setWatch(()=>load(), BTN1); -setWatch(()=>load(), BTN2); -setWatch(()=>load(), BTN3); +if (global.BTN2) setWatch(()=>load(), BTN2); +if (global.BTN3) setWatch(()=>load(), BTN3); + From 17ee846faf822b0b5cf8495d05136b61f8606c9b Mon Sep 17 00:00:00 2001 From: Ronin0000 <89286474+Ronin0000@users.noreply.github.com> Date: Fri, 4 Feb 2022 07:00:22 -0800 Subject: [PATCH 10/11] Delete appb2.js --- apps/torch/appb2.js | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 apps/torch/appb2.js diff --git a/apps/torch/appb2.js b/apps/torch/appb2.js deleted file mode 100644 index e15e3c9e1..000000000 --- a/apps/torch/appb2.js +++ /dev/null @@ -1,16 +0,0 @@ -const SETTINGS_FILE = "torch.json"; -let settings; - -function loadSettings() { - settings = require("Storage").readJSON(SETTINGS_FILE,1)|| {'bg': '#FFFFFF', 'color': 'White'}; -} - -loadSettings(); - -Bangle.setLCDPower(1); -Bangle.setLCDTimeout(0); -g.reset(); -g.setColor(settings.bg); -g.fillRect(0,0,g.getWidth(),g.getHeight()); -// Any button turns off -setWatch(()=>load(), BTN1); From 4f7a439f2df2cf40ba3f4fe49060970eb6e0ff65 Mon Sep 17 00:00:00 2001 From: Ronin0000 <89286474+Ronin0000@users.noreply.github.com> Date: Fri, 4 Feb 2022 07:00:41 -0800 Subject: [PATCH 11/11] Update metadata.json --- apps/torch/metadata.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/torch/metadata.json b/apps/torch/metadata.json index 30ca36c1b..37e6f6b95 100644 --- a/apps/torch/metadata.json +++ b/apps/torch/metadata.json @@ -8,8 +8,7 @@ "tags": "tool,torch", "supports": ["BANGLEJS","BANGLEJS2"], "storage": [ - {"name":"torch.app.js","url":"app.js","supports": ["BANGLEJS"]}, - {"name":"torch.app.js","url":"appb2.js","supports": ["BANGLEJS2"]}, + {"name":"torch.app.js","url":"app.js"}, {"name":"torch.wid.js","url":"widget.js","supports": ["BANGLEJS"]}, {"name":"torch.img","url":"app-icon.js","evaluate":true}, {"name":"torch.settings.js","url":"settings.js"}