From 2f1dbab72eccc463ad2334652aba59ea36352d62 Mon Sep 17 00:00:00 2001 From: Albert Date: Thu, 13 Jun 2024 23:26:47 +0200 Subject: [PATCH 01/11] nostt app init --- apps/nostt/ChangeLog | 1 + apps/nostt/README.md | 8 + apps/nostt/metadata.json | 17 + apps/nostt/nostt.app.js | 506 ++++++++++++++++++++++++++++++ apps/nostt/nostt.icon.js | 1 + apps/nostt/nostt_logo.png | Bin 0 -> 1646 bytes apps/nostt/nostt_screenshot_1.png | Bin 0 -> 4415 bytes apps/nostt/nostt_screenshot_2.png | Bin 0 -> 5107 bytes 8 files changed, 533 insertions(+) create mode 100644 apps/nostt/ChangeLog create mode 100644 apps/nostt/README.md create mode 100644 apps/nostt/metadata.json create mode 100644 apps/nostt/nostt.app.js create mode 100644 apps/nostt/nostt.icon.js create mode 100644 apps/nostt/nostt_logo.png create mode 100644 apps/nostt/nostt_screenshot_1.png create mode 100644 apps/nostt/nostt_screenshot_2.png diff --git a/apps/nostt/ChangeLog b/apps/nostt/ChangeLog new file mode 100644 index 000000000..5314d96b9 --- /dev/null +++ b/apps/nostt/ChangeLog @@ -0,0 +1 @@ +1.00: NOS Teletekst finished! \ No newline at end of file diff --git a/apps/nostt/README.md b/apps/nostt/README.md new file mode 100644 index 000000000..ea3d7b3ff --- /dev/null +++ b/apps/nostt/README.md @@ -0,0 +1,8 @@ +# NOS Teletekst + + +Dutch Teletekst using the NOS Teletekst api. Requires http access via BangleJS GadgetBridge. See https://www.espruino.com/Gadgetbridge. Make sure `Allow Internet Access` is enabled. + +## Usage + +Tap once to bring up a numpad to enter the desired page. You can also swipe left/right to change the page, or swipe up/down to walk through the subpages. \ No newline at end of file diff --git a/apps/nostt/metadata.json b/apps/nostt/metadata.json new file mode 100644 index 000000000..8d59abd7a --- /dev/null +++ b/apps/nostt/metadata.json @@ -0,0 +1,17 @@ +{ + "id":"nostt", + "name":"NOS Teletekst", + "shortName": "Teletekst", + "version": "1.00", + "description": "Dutch Teletekst using the NOS Teletekst api. Requires http access via BangleJS GadgetBridge.", + "src":"nostt.app.js", + "storage": [ + {"name":"nostt.app.js","url":"nostt.app.js"}, + {"name":"nostt.img","url":"nostt.icon.js","evaluate":true} + ], + "readme": "README.md", + "icon":"nostt_logo.png", + "supports": ["BANGLEJS2"], + "screenshots": [{"url": "nostt_screenshot_1.png"}, {"url": "nostt_screenshot_2.png"}], + "tags": "nos,teletext,teletekst,news,weather" +} \ No newline at end of file diff --git a/apps/nostt/nostt.app.js b/apps/nostt/nostt.app.js new file mode 100644 index 000000000..ee8f0b5f6 --- /dev/null +++ b/apps/nostt/nostt.app.js @@ -0,0 +1,506 @@ +class View { + + constructor() { + + this.navigationState = { + prevPage: { + p: undefined, + s: undefined, + }, + prevSubPage: { + p: undefined, + s: undefined, + }, + nextPage: { + p: undefined, + s: undefined, + }, + nextSubPage: { + p: undefined, + s: undefined, + }, + currentPage: { + p: undefined, + s: undefined, + }, + }; + + this.colorArray = { + 0: [0, 0, 0], + 1: [1, 0, 0], + 2: [0, 1, 0], + 3: [1, 1, 0], + 4: [0, 0, 1], + 5: [1, 0, 1], + 6: [0, 1, 1], + 7: [1, 1, 1], + 16: [0, 0, 0], + 17: [1, 0, 0], + 18: [0, 1, 0], + 19: [1, 1, 0], + 20: [0, 0, 1], + 21: [1, 0, 1], + 22: [0, 1, 1], + 23: [1, 1, 1], + }; + + + } + + start() { + // @ts-ignore + g.clear(); + if (this.nextStartPage) { + this.show(this.nextStartPage); + this.nextStartPage = undefined; + } + else { + if (this.navigationState.currentPage.p) { + this.show(this.navigationState.currentPage.p); + } + else { + this.show(101); //load default + } + } + + } + + split_at_fourty(res, value) { + res.push(value.substring(0, 40)); + if (value.length > 40) { // at least two rows + return this.split_at_fourty(res, value.substring(40)); + } + else { + return res; + } + + } + +// strToUtf8Bytes(str) { +// const utf8 = []; +// for (let ii = 0; ii < str.length; ii++) { +// let charCode = str.charCodeAt(ii); +// if (charCode < 0x80) utf8.push(charCode); +// else if (charCode < 0x800) { +// utf8.push(0xc0 | (charCode >> 6), 0x80 | (charCode & 0x3f)); +// } else if (charCode < 0xd800 || charCode >= 0xe000) { +// utf8.push(0xe0 | (charCode >> 12), 0x80 | ((charCode >> 6) & 0x3f), 0x80 | (charCode & 0x3f)); +// } else { +// ii++; +// // Surrogate pair: +// // UTF-16 encodes 0x10000-0x10FFFF by subtracting 0x10000 and +// // splitting the 20 bits of 0x0-0xFFFFF into two halves +// charCode = 0x10000 + (((charCode & 0x3ff) << 10) | (str.charCodeAt(ii) & 0x3ff)); +// utf8.push( +// 0xf0 | (charCode >> 18), +// 0x80 | ((charCode >> 12) & 0x3f), +// 0x80 | ((charCode >> 6) & 0x3f), +// 0x80 | (charCode & 0x3f), +// ); +// } +// } +// return utf8; +// } + + loadPrevPage() { + if (this.navigationState.prevPage.p) { + this.show(this.navigationState.prevPage.p, this.navigationState.prevPage.s); + } + } + + loadNextPage() { + if (this.navigationState.nextPage.p) { + this.show(this.navigationState.nextPage.p, this.navigationState.nextPage.s); + } + } + + loadPrevSubPage() { + if (this.navigationState.prevSubPage.p) { + this.show(this.navigationState.prevSubPage.p, this.navigationState.prevSubPage.s); + } + } + + loadNextSubPage() { + if (this.navigationState.nextSubPage.p) { + this.show(this.navigationState.nextSubPage.p, this.navigationState.nextSubPage.s); + } + } + + handleSwipe(lr, ud){ + if (lr == -1 && ud == 0) { + this.loadNextPage(); + } + if (lr == 1 && ud == 0) { + this.loadPrevPage(); + } + if (lr == 0 && ud == 1) { + this.loadPrevSubPage(); + } + if (lr == 0 && ud == -1) { + this.loadNextSubPage(); + } + } + + show(pageId, subPageId) { + if(!subPageId){ + subPageId = 1; + } + + if (Bangle.http) { + Bangle.http('https://teletekst-data.nos.nl/page/' + pageId + '-' + subPageId).then((data) => { + + const res = data.resp; + g.clear(); + + + this.navigationState = { + prevPage: { + p: undefined, + s: undefined, + }, + prevSubPage: { + p: undefined, + s: undefined, + }, + nextPage: { + p: undefined, + s: undefined, + }, + nextSubPage: { + p: undefined, + s: undefined, + }, + currentPage: { + p: pageId, + s: subPageId, + }, + }; + + // set next -, previous -, next sub - and previous sub page + let navNIndex = res.indexOf('pn=n_'); + if (navNIndex > -1) { + this.navigationState.nextPage.p = parseInt(res.substring(navNIndex + 5, navNIndex + 8)); + this.navigationState.nextPage.s = parseInt(res.substring(navNIndex + 9, navNIndex + 10)); + } + let navPIndex = res.indexOf('pn=p_'); + if (navPIndex > -1) { + this.navigationState.prevPage.p = parseInt(res.substring(navPIndex + 5, navPIndex + 8)); + this.navigationState.prevPage.s = parseInt(res.substring(navPIndex + 9, navPIndex + 10)); + } + let navPSIndex = res.indexOf('pn=ps'); + if (navPSIndex > -1) { + this.navigationState.prevSubPage.p = parseInt(res.substring(navPSIndex + 5, navPSIndex + 8)); + this.navigationState.prevSubPage.s = parseInt(res.substring(navPSIndex + 9, navPSIndex + 10)); + } + let navNSIndex = res.indexOf('pn=ns'); + if (navNSIndex > -1) { + this.navigationState.nextSubPage.p = parseInt(res.substring(navNSIndex + 5, navNSIndex + 8)); + this.navigationState.nextSubPage.s = parseInt(res.substring(navNSIndex + 9, navNSIndex + 10)); + } + + let split = E.toString(res.split('
')[1].split('
')[0]); + + this.render(split); + }); + } + } + + + + + render(source) { + + g.setFontAlign(-1, -1); + g.setFont('4x6'); + + // @ts-ignore + const bytes = E.toUint8Array(E.decodeUTF8(source)); + let rowIndex = 0; + let totalIndex = 0; + let charIndex = 0; + + for (let charByte of bytes) { + { + if ((charByte >= 0 && charByte <= 7) || (charByte >= 16 && charByte <= 23)) { + const color = this.colorArray[charByte]; + g.setColor(color[0], color[1], color[2]); + } + } + g.drawString(source[totalIndex], (charIndex * 4) + 6, rowIndex * 7); + charIndex++; + totalIndex++; + if (charIndex == 40) { + rowIndex++; + charIndex = 0; + g.flip(); + } + } + } + + +} + +const BUTTON_BORDER_WITH = 2; + +class Button { +// position; +// value; +// highlightTimeoutId; + + + constructor(position, value) { + this.position = position; + this.value = value; + } + + draw(highlight) { + g.setColor(g.theme.fg); + g.fillRect( + this.position.x1, + this.position.y1, + this.position.x2, + this.position.y2 + ); + + if (highlight) { + g.setColor(g.theme.bgH); + } else { + g.setColor(g.theme.bg); + } + g.fillRect( + this.position.x1 + BUTTON_BORDER_WITH, + this.position.y1 + BUTTON_BORDER_WITH, + this.position.x2 - BUTTON_BORDER_WITH, + this.position.y2 - BUTTON_BORDER_WITH + ); + + g.setColor(g.theme.fg); + g.setFontAlign(0, 0); + g.setFont("Vector", 35); + g.drawString( + this.value, + this.position.x1 + (this.position.x2 - this.position.x1) / 2 + 2, + this.position.y1 + (this.position.y2 - this.position.y1) / 2 + 2 + ); + } + + handleTouchInput(n, e) { + if ( + e.x >= this.position.x1 && + e.x <= this.position.x2 && + e.y >= this.position.y1 && + e.y <= this.position.y2 + ) { + this.draw(true); // draw to highlight + this.highlightTimeoutId = setTimeout(() => { + this.draw(); + this.highlightTimeoutId = undefined; + }, 100); + return this.value; + } + else { + return undefined; + } + } + + disable() { + // disable button + if (this.highlightTimeoutId) { + clearTimeout(this.highlightTimeoutId); + this.highlightTimeoutId = undefined; + } + } + +} + +class Input { + + constructor(callback) { + this.inputCallback = callback; + this.inputVal = ""; + + let button1 = new Button({ x1: 1, y1: 35, x2: 58, y2: 70 }, '1'); + let button2 = new Button({ x1: 60, y1: 35, x2: 116, y2: 70 }, '2'); + let button3 = new Button({ x1: 118, y1: 35, x2: 174, y2: 70 }, '3'); + + let button4 = new Button({ x1: 1, y1: 72, x2: 58, y2: 105 }, '4'); + let button5 = new Button({ x1: 60, y1: 72, x2: 116, y2: 105 }, '5'); + let button6 = new Button({ x1: 118, y1: 72, x2: 174, y2: 105 }, '6'); + + let button7 = new Button({ x1: 1, y1: 107, x2: 58, y2: 140 }, '7'); + let button8 = new Button({ x1: 60, y1: 107, x2: 116, y2: 140 }, '8'); + let button9 = new Button({ x1: 118, y1: 107, x2: 174, y2: 140 }, '9'); + + let buttonOK = new Button({ x1: 1, y1: 142, x2: 58, y2: 174 }, "OK"); + let button0 = new Button({ x1: 60, y1: 142, x2: 116, y2: 174 }, "0"); + let buttonDelete = new Button({ x1: 118, y1: 142, x2: 174, y2: 174 }, "<-"); + + this.inputButtons = [ + button1, + button2, + button3, + button4, + button5, + button6, + button7, + button8, + button9, + buttonOK, + button0, + buttonDelete, + ]; + } + + handleTouchInput(n, e) { + let res = 'none'; + for (let button of this.inputButtons) { + const touchResult = button.handleTouchInput(n, e); + if (touchResult) { + res = touchResult; + } + } + + switch (res) { + case 'OK': + if(this.inputVal.length == 3){ + this.inputCallback(parseInt(this.inputVal)); + } + break; + case '<-': + this.removeNumber(); + this.drawField(); + break; + case 'none': + break; + default: + this.appendNumber(parseInt(res)); + this.drawField(); + } + + } + + + hide() { + for (let button of this.inputButtons) { + button.disable(); + } + } + + start(preset) { + if (preset) { + this.inputVal = preset.toString(); + } + else { + this.inputVal = ''; + } + + this.draw(); + } + + appendNumber(number) { + if (number === 0 && this.inputVal.length === 0) { + return; + } + + if (this.inputVal.length <= 2) { + this.inputVal = this.inputVal + number; + } + } + + removeNumber() { + if (this.inputVal.length > 0) { + this.inputVal = this.inputVal.slice(0, -1); + } + } + + reset() { + this.inputVal = ""; + } + + draw() { + g.clear(); + this.drawButtons(); + this.drawField(); + } + + drawButtons() { + for (let button of this.inputButtons) { + button.draw(); + } + } + + drawField() { + g.clearRect(0, 0, 176, 34); + g.setColor(g.theme.fg); + g.setFontAlign(-1, -1); + g.setFont("Vector:26x40"); + g.drawString(this.inputVal, 2, 0); + } +} + +// require('./Input'); + +class NOSTeletekstApp { + + constructor() { + console.log("this is the teletekst app!"); + this.isLeaving = false; + this.viewMode= 'VIEW'; + this.view = new View(); + this.input = new Input((newVal)=>this.inputHandler(newVal)); + this.view.start(); + + Bangle.setUI({ + mode: "custom", + remove: () => { + this.isLeaving = true; + console.log("teletext app: i am packing my stuff, goodbye"); + require("widget_utils").show(); // re-show widgets + }, + touch: (n, e) => { + if (this.viewMode == 'VIEW') { + // we need to go to input mode + this.setViewMode('INPUT'); + return; + } + if (this.viewMode == 'INPUT') { + this.input.handleTouchInput(n, e); + return; + + } + }, + swipe: (lr, ud) => { + if (this.viewMode == 'VIEW') { + this.view.handleSwipe(lr,ud); + } + if (this.viewMode == 'INPUT') { + if(lr == 1 && ud == 0){ + this.setViewMode('VIEW'); + } + } + } + + }); + + } + + inputHandler(input){ + // set viewMode back to view + this.view.nextStartPage = input; + this.setViewMode('VIEW'); + } + + setViewMode(newViewMode){ + this.viewMode = newViewMode; + if(newViewMode=='INPUT'){ + this.input.start(); + } + if(newViewMode=='VIEW'){ + this.input.hide(); + this.view.start(); + } + } + + +} +new NOSTeletekstApp(); \ No newline at end of file diff --git a/apps/nostt/nostt.icon.js b/apps/nostt/nostt.icon.js new file mode 100644 index 000000000..b9ef929be --- /dev/null +++ b/apps/nostt/nostt.icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwwZC/AH4A/AH4AWgmSAwn/wACB/0Agf/4EAhMkyVIB4MB/4AB/ARGpIRBpMggEPCIQAC4ARCgQRDkkAv4jEAQIRLAQIRC/4RCiVJIgJKBwARCgPACIxWCCIn8NwQAB8YRFgIRDNARcFPQgRBNYZHB+IRDEYyPDAAPwn4RJIggRBg4RDNYrGCJQQRGkCSCWYP4CIgpCUI7FFCIMfa5DFFCIL7GJQQRLgARBoBXCO4KhBAH4A/AH4A/AD4A=")) \ No newline at end of file diff --git a/apps/nostt/nostt_logo.png b/apps/nostt/nostt_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..bf8f0d47d30a2c156773e5b1b4e63fa90d1d04ee GIT binary patch literal 1646 zcmV-!29f!RP) zqM!wW=EOvDX`6yl1Hl*@2q*&DLVJOuA)sjpTJ?`2Xh5Mwqfr9^Lli`4lvsI5;>sI5_-AQ2oxG0pMIt86=PA z)5;fLjGCQlYilK6QPIn0n;YXVg2CYBp_0btKUS#sMiz73m;sa)BMb~M`4fp!J1ZLB zQqa=UKb)|-P-ueA*c`_BJ)AK&!C2)8{f!AZS(uyK76=3s002RW$KMBlk*Pqy1wB3#>N%H zt&pAm^0@{1XCrM)QC6G9+u@9PQS92*zQdn=dZv7$WF8BL!}$Y-(QZ)sv|0QRIdU~! zuhf#sooNLC0I0gYd0SJ{q+1ow%gYJ9bm?=@)G4XxLnLl(d}m*a}Ee|vMY=T?&SUH+pAG;LPefGC|tlGF&I6b3=OkR~D#5A>EjJTLWb zQ2MNSoM3!jmgVOKLLL=m`4y3neFz{403e9smg->etdL0*W9+VEG`b4_mShvpYfFXb zp(|@F!Vpq)7+aq6lO|4VEh{TC z22Fb#cJD4$lgT&yIXN2v0MNz{K8S#66Whsgy92lR{jKLaJNwLbx64(!s;L@A&Q108zf;D>oBc7yT^ON5L=f8Y z1mURtrHVk>1{|7-Kq=AdX;^#X!(Sw0CbZ zQvu!shdTh1n8lb(_y7R%yx#Q$AkxU>IYfPs}LIG;#m07ngu-F_0_wMvh=G*uA>Cx?=3e zkz*uDS}X`c6CvarLWtXQQNvi4b_yXvNN~}j{<L^76W0TDr6w06rOf zAk@?}A*Lw14aTOXLK$QJbaC{0tG`}Raa0t=%~{0*fcN0RD9G|Yi_tLdB3*x->YG`z zcHr?TGoqyrm-bD+|6RQ&@*}6zZ}D}xLaAShW5MCq(jG`~j_BdlceGlK--AHi4n-0dwb2>^ilaCoe07`1jk%9xii zHi1%FWFHd+p+0+m1Hg)4@PaJMRYPqeGX>xL^eyp^o`nSQ_hHpb(vPTc^iG*kJY}05Q9t_waWo zy8YuyuqUqqMDYiNv7Q>^1SgRseT_YyCBC`k)4T_cTh9B6K;Y_{6)TqK`+RpulC+Xw ze2`$=g%DzcqA4MyLm=eC5hF&-sHv)2IqX9HU(Q!o%h84N?&w)E=XPFOn{~fs;uFqE sYinyxrhCZ2!NI}7!NI}7!QnsiFRML)y1TwejQ{`u07*qoM6N<$f|RHlq5uE@ literal 0 HcmV?d00001 diff --git a/apps/nostt/nostt_screenshot_1.png b/apps/nostt/nostt_screenshot_1.png new file mode 100644 index 0000000000000000000000000000000000000000..ad65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0M2?|TL+6Ngmwbm_fn4ZS=zz5QSs|* z%|qH_Gd`$bU=Yw*@AE8*+auGDCuXjYG3iSVHdx$s9;bZuEw4lXF_fgmnt5}7HJmqi zZ?Fs{G#VO2>k+XgBrMq9Xysgi)L)a9iTp=C)-`)#VdszH^zpfp0fA4Zr_jz!1GQ*? ztdOdW12@B3h0$5|Uu9^(NgTF&-q`^!(JhDFRwE@Mi4a79G4tM)N!RYe`)k4m zH+L-(`Vcm32TP)lSdl;_zxn*ySy{ndSFA|ZPXm0h*5G<}3z9NL@s5d{)^Bz#(%v2ryRrYOn;1?R2L zXp0O%eR~Z<{CneXh3XBL?O$^5;TNMwLh0rH-mb z`L25-VAqv%B1raw=Rf9$78}s5GhV#$6CfulEa#}-nu5~d9O*=btzkYG!RL_9||DlR-ClR*_J_eFYkPiU>$YR-l#8*WYg8(qwWj=}`I{|ww<3b7 Date: Thu, 13 Jun 2024 23:36:19 +0200 Subject: [PATCH 02/11] type added to nostt metadata.json --- apps/nostt/metadata.json | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/nostt/metadata.json b/apps/nostt/metadata.json index 8d59abd7a..7e5599096 100644 --- a/apps/nostt/metadata.json +++ b/apps/nostt/metadata.json @@ -5,6 +5,7 @@ "version": "1.00", "description": "Dutch Teletekst using the NOS Teletekst api. Requires http access via BangleJS GadgetBridge.", "src":"nostt.app.js", + "type": "app", "storage": [ {"name":"nostt.app.js","url":"nostt.app.js"}, {"name":"nostt.img","url":"nostt.icon.js","evaluate":true} From 14193641dd7f6bfb10c0b27cb5f167ffa15a75e7 Mon Sep 17 00:00:00 2001 From: Albert Date: Thu, 13 Jun 2024 23:39:13 +0200 Subject: [PATCH 03/11] creator added --- apps/nostt/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/nostt/README.md b/apps/nostt/README.md index ea3d7b3ff..f9b57cc66 100644 --- a/apps/nostt/README.md +++ b/apps/nostt/README.md @@ -5,4 +5,8 @@ Dutch Teletekst using the NOS Teletekst api. Requires http access via BangleJS G ## Usage -Tap once to bring up a numpad to enter the desired page. You can also swipe left/right to change the page, or swipe up/down to walk through the subpages. \ No newline at end of file +Tap once to bring up a numpad to enter the desired page. You can also swipe left/right to change the page, or swipe up/down to walk through the subpages. + +## Creator + +[Albert van der Meer](https://github.com/avandermeer) \ No newline at end of file From caaed8fc5ea39f6c7981ec8715398a7cb6098350 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Sun, 16 Jun 2024 19:56:12 +0100 Subject: [PATCH 04/11] widdst: ensure DST is applied when leaving settings --- apps/widdst/ChangeLog | 3 ++- apps/widdst/metadata.json | 2 +- apps/widdst/settings.js | 13 ++++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/widdst/ChangeLog b/apps/widdst/ChangeLog index d1ad50fe2..cedeaa5b4 100644 --- a/apps/widdst/ChangeLog +++ b/apps/widdst/ChangeLog @@ -2,4 +2,5 @@ 0.02: Checks for correct firmware; E.setDST(...) moved to boot.js 0.03: Convert Yes/No On/Off in settings to checkboxes 0.04: Give the boot file the highest priority to ensure it runs before sched (fix #2663) -0.05: Tweaks to ensure Gadgetbridge can't overwrite timezone on 2v19.106 and later \ No newline at end of file +0.05: Tweaks to ensure Gadgetbridge can't overwrite timezone on 2v19.106 and later +0.06: If fastload is present, ensure DST changes are still applied when leaving settings diff --git a/apps/widdst/metadata.json b/apps/widdst/metadata.json index 006e03416..495f06086 100644 --- a/apps/widdst/metadata.json +++ b/apps/widdst/metadata.json @@ -1,6 +1,6 @@ { "id": "widdst", "name": "Daylight Saving", - "version":"0.05", + "version":"0.06", "description": "Widget to set daylight saving rules. Requires Espruino 2v15 or later - see the instructions below for more information.", "icon": "icon.png", "type": "widget", diff --git a/apps/widdst/settings.js b/apps/widdst/settings.js index 7363aa6bf..0017cc499 100644 --- a/apps/widdst/settings.js +++ b/apps/widdst/settings.js @@ -33,8 +33,11 @@ at: 0 }; + var writtenSettings = false; + function writeSettings() { require('Storage').writeJSON("widdst.json", settings); + writtenSettings = true; } function writeSubMenuSettings() { @@ -136,7 +139,15 @@ "": { "Title": /*LANG*/"Daylight Saving" }, - "< Back": () => back(), + "< Back": () => { + if(writtenSettings && global._load){ + // disable fastload to ensure settings are applied + // when we exit the settings app + global.load = global._load; + delete global._load; + } + back(); + }, /*LANG*/"Enabled": { value: !!settings.has_dst, onchange: v => { From c26d85d9d1a6817436e6549c308b83534f03eaaf Mon Sep 17 00:00:00 2001 From: Albert Date: Wed, 19 Jun 2024 11:07:32 +0200 Subject: [PATCH 05/11] [nostt] unnecesary src key remove from metadata.json; cleanup nostt.app.js --- apps/nostt/metadata.json | 1 - apps/nostt/nostt.app.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/nostt/metadata.json b/apps/nostt/metadata.json index 7e5599096..b4f2cc068 100644 --- a/apps/nostt/metadata.json +++ b/apps/nostt/metadata.json @@ -4,7 +4,6 @@ "shortName": "Teletekst", "version": "1.00", "description": "Dutch Teletekst using the NOS Teletekst api. Requires http access via BangleJS GadgetBridge.", - "src":"nostt.app.js", "type": "app", "storage": [ {"name":"nostt.app.js","url":"nostt.app.js"}, diff --git a/apps/nostt/nostt.app.js b/apps/nostt/nostt.app.js index ee8f0b5f6..5eefa928f 100644 --- a/apps/nostt/nostt.app.js +++ b/apps/nostt/nostt.app.js @@ -48,7 +48,6 @@ class View { } start() { - // @ts-ignore g.clear(); if (this.nextStartPage) { this.show(this.nextStartPage); @@ -213,7 +212,7 @@ class View { g.setFontAlign(-1, -1); g.setFont('4x6'); - // @ts-ignore + const bytes = E.toUint8Array(E.decodeUTF8(source)); let rowIndex = 0; let totalIndex = 0; From a363d6da2ca99f67fbb3504001887c4145b31ec2 Mon Sep 17 00:00:00 2001 From: numerist Date: Wed, 19 Jun 2024 16:18:28 -0400 Subject: [PATCH 06/11] Update app-bangle2.js Shifting the position of one line on the screen --- apps/doztime/app-bangle2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/doztime/app-bangle2.js b/apps/doztime/app-bangle2.js index 603ac8904..67d876747 100644 --- a/apps/doztime/app-bangle2.js +++ b/apps/doztime/app-bangle2.js @@ -16,7 +16,7 @@ const B2 = [30,30,30,30,31,31,31,31,31,30,30,30]; const timeColour = "#ffffff"; const dateColours = ["#ff0000","#ff8000","#ffff00","#00ff00","#0080ff","#ff00ff","#ffffff"]; const calen10 = {"size":26,"pt0":[18-g_x_off,16],"step":[16,0],"dx":-4.5,"dy":-4.5}; // positioning for usual calendar line -const calen7 = {"size":26,"pt0":[48-g_x_off,16],"step":[16,0],"dx":-4.5,"dy":-4.5}; // positioning for S-day calendar line +const calen7 = {"size":26,"pt0":[42-g_x_off,16],"step":[16,0],"dx":-4.5,"dy":-4.5}; // positioning for S-day calendar line const time5 = {"size":42,"pt0":[39-g_x_off,24],"step":[26,0],"dx":-6.5,"dy":-6.5}; // positioning for lull time line const time6 = {"size":42,"pt0":[26-g_x_off,24],"step":[26,0],"dx":-6.5,"dy":-6.5}; // positioning for twinkling time line ft w 48, 48-g, step 30 const baseYear = 11584; From 41a1e828be380478025ae389eb699bc4b20aa25f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 22:23:04 +0000 Subject: [PATCH 07/11] build(deps-dev): bump braces from 3.0.2 to 3.0.3 Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index d63d0171f..36589d9eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -730,12 +730,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -1437,9 +1437,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -3984,12 +3984,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "call-bind": { @@ -4531,9 +4531,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" From e5be7c422680af90f4a28223514771328289a19f Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Thu, 20 Jun 2024 08:09:42 +0100 Subject: [PATCH 08/11] lint_exemptions.js: drop astrocalc --- apps/lint_exemptions.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/apps/lint_exemptions.js b/apps/lint_exemptions.js index d3c628503..7f535bbc6 100644 --- a/apps/lint_exemptions.js +++ b/apps/lint_exemptions.js @@ -516,12 +516,6 @@ module.exports = { "no-undef" ] }, - "apps/astrocalc/astrocalc-app.js": { - "hash": "29f978064e42f947b36c94ab3f212512fb5d0a41fa265354c6039e2cf042b92c", - "rules": [ - "no-unused-vars" - ] - }, "apps/HRV/app.js": { "hash": "265b4b0272c43126670b5026079711354cee0a211096bcd2c18139b7a3ee774a", "rules": [ From cf8e8e3c9ae4d90c2ae145039664ea7392a5df3e Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Thu, 20 Jun 2024 08:09:58 +0100 Subject: [PATCH 09/11] doztime: whitespace --- apps/doztime/app-bangle2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/doztime/app-bangle2.js b/apps/doztime/app-bangle2.js index 67d876747..1612ec4fd 100644 --- a/apps/doztime/app-bangle2.js +++ b/apps/doztime/app-bangle2.js @@ -139,7 +139,7 @@ function writeDozTime(text,def){ } } function writeDozDate(text,def,colour){ - + dateColour = colour; //let pts = def.pts; let x=def.pt0[0]; From 1e49bb1e6338f91c78b8c2e819b8bf3a2fdddeda Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Thu, 20 Jun 2024 08:10:28 +0100 Subject: [PATCH 10/11] doztime: create `calenDef`, promote `time` & `wait` --- apps/doztime/app-bangle2.js | 11 +++++++---- apps/lint_exemptions.js | 7 ------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/apps/doztime/app-bangle2.js b/apps/doztime/app-bangle2.js index 1612ec4fd..9d1bb26c8 100644 --- a/apps/doztime/app-bangle2.js +++ b/apps/doztime/app-bangle2.js @@ -21,6 +21,7 @@ const time5 = {"size":42,"pt0":[39-g_x_off,24],"step":[26,0],"dx":-6.5,"dy":-6.5 const time6 = {"size":42,"pt0":[26-g_x_off,24],"step":[26,0],"dx":-6.5,"dy":-6.5}; // positioning for twinkling time line ft w 48, 48-g, step 30 const baseYear = 11584; const baseDate = Date(2020,11,21); // month values run from 0 to 11 +let calenDef = calen10; let accum = new Date(baseDate.getTime()); let sequence = []; let timeActiveUntil; @@ -169,20 +170,22 @@ function drawTime() let date = ""; let timeDef; let x = 0; + let time; + let wait; dt.setDate(dt.getDate()); if(addTimeDigit){ x = 10368*dt.getHours()+172.8*dt.getMinutes()+2.88*dt.getSeconds()+0.00288*dt.getMilliseconds(); let msg = "00000"+Math.floor(x).toString(12); - let time = msg.substr(-5,3)+"."+msg.substr(-2); //TODO: should `time` and `wait` have been defined outside the if block? - let wait = 347*(1-(x%1)); + time = msg.substr(-5,3)+"."+msg.substr(-2); //TODO: should `time` and `wait` have been defined outside the if block? + wait = 347*(1-(x%1)); timeDef = time6; } else { x = 864*dt.getHours()+14.4*dt.getMinutes()+0.24*dt.getSeconds()+0.00024*dt.getMilliseconds(); let msg = "0000"+Math.floor(x).toString(12); - let time = msg.substr(-4,3)+"."+msg.substr(-1); - let wait = 4167*(1-(x%1)); + time = msg.substr(-4,3)+"."+msg.substr(-1); + wait = 4167*(1-(x%1)); timeDef = time5; } if(lastX > x){ res = getDate(dt); } // calculate date once at start-up and once when turning over to a new day diff --git a/apps/lint_exemptions.js b/apps/lint_exemptions.js index 7f535bbc6..1bd285a9f 100644 --- a/apps/lint_exemptions.js +++ b/apps/lint_exemptions.js @@ -412,13 +412,6 @@ module.exports = { "no-unused-vars" ] }, - "apps/doztime/app-bangle2.js": { - "hash": "81592fe1bc6537f80d7dbe7b2e8145924d2400f98ea780c68dd5bd9694376c8a", - "rules": [ - "no-unused-vars", - "no-undef" - ] - }, "apps/devstopwatch/app.js": { "hash": "28ca59e605f280a2d8fd4a74f553783205d51f8bb7042d6f51cf8ec11d44c264", "rules": [ From 51bab7ceec4e07856981f1c83f90e2c81bbc5a6f Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Thu, 20 Jun 2024 08:13:49 +0100 Subject: [PATCH 11/11] doztime: bump version --- apps/doztime/ChangeLog | 3 ++- apps/doztime/metadata.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/doztime/ChangeLog b/apps/doztime/ChangeLog index 03c1877b4..dc73a3c23 100644 --- a/apps/doztime/ChangeLog +++ b/apps/doztime/ChangeLog @@ -5,4 +5,5 @@ 0.05: extraneous comments and code removed display improved now supports Adjust Clock widget, if installed -0.06: Minor code improvements \ No newline at end of file +0.06: Minor code improvements +0.07: Bangle2: Shift the position of one line on the screen diff --git a/apps/doztime/metadata.json b/apps/doztime/metadata.json index 83be15724..407b474ca 100644 --- a/apps/doztime/metadata.json +++ b/apps/doztime/metadata.json @@ -2,7 +2,7 @@ "id": "doztime", "name": "Dozenal Digital Time", "shortName": "Dozenal Digital", - "version": "0.06", + "version": "0.07", "description": "A dozenal Holocene calendar and dozenal diurnal digital clock", "icon": "app.png", "type": "clock",