Skip to content

Commit 163df7b

Browse files
author
thyttan
committed
spotrem: fix lint warnings no-undef
1 parent c217a4f commit 163df7b

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

apps/spotrem/ChangeLog

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
0.07: Remove just the specific listeners to not interfere with Quick Launch
88
when fastloading.
99
0.08: Issue newline before GB commands (solves issue with console.log and ignored commands)
10-
0.09: Don't send the gadgetbridge wake command twice. Once should do since we
11-
issue newline before GB commands.
10+
0.09: Don't send the gadgetbridge wake command twice. Once should do since we issue newline before GB commands.
1211
0.10: Some refactoring to shorten the code.
13-
0.11: Further refactoring to shorten the code. Fixed search and play that was
14-
broken in v0.10.
15-
12+
0.11: Further refactoring to shorten the code. Fixed search and play that was broken in v0.10.
13+
0.12: Fix some warnings from the linter.

apps/spotrem/app.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,46 @@ let dark = g.theme.dark; // bool
1313
let gfx = function() {
1414
widgetUtils.hide();
1515
R = Bangle.appRect;
16-
marigin = 8;
16+
const MARIGIN = 8;
1717
// g.drawString(str, x, y, solid)
1818
g.clearRect(R);
1919
g.reset();
2020

2121
if (dark) {g.setColor(0x07E0);} else {g.setColor(0x03E0);} // Green on dark theme, DarkGreen on light theme.
2222
g.setFont("4x6:2");
2323
g.setFontAlign(1, 0, 0);
24-
g.drawString("->", R.x2 - marigin, R.y + R.h/2);
24+
g.drawString("->", R.x2 - MARIGIN, R.y + R.h/2);
2525

2626
g.setFontAlign(-1, 0, 0);
27-
g.drawString("<-", R.x + marigin, R.y + R.h/2);
27+
g.drawString("<-", R.x + MARIGIN, R.y + R.h/2);
2828

2929
g.setFontAlign(-1, 0, 1);
30-
g.drawString("<-", R.x + R.w/2, R.y + marigin);
30+
g.drawString("<-", R.x + R.w/2, R.y + MARIGIN);
3131

3232
g.setFontAlign(1, 0, 1);
33-
g.drawString("->", R.x + R.w/2, R.y2 - marigin);
33+
g.drawString("->", R.x + R.w/2, R.y2 - MARIGIN);
3434

3535
g.setFontAlign(0, 0, 0);
3636
g.drawString("Play\nPause", R.x + R.w/2, R.y + R.h/2);
3737

3838
g.setFontAlign(-1, -1, 0);
39-
g.drawString("Menu", R.x + 2*marigin, R.y + 2*marigin);
39+
g.drawString("Menu", R.x + 2*MARIGIN, R.y + 2*MARIGIN);
4040

4141
g.setFontAlign(-1, 1, 0);
42-
g.drawString("Wake", R.x + 2*marigin, R.y + R.h - 2*marigin);
42+
g.drawString("Wake", R.x + 2*MARIGIN, R.y + R.h - 2*MARIGIN);
4343

4444
g.setFontAlign(1, -1, 0);
45-
g.drawString("Srch", R.x + R.w - 2*marigin, R.y + 2*marigin);
45+
g.drawString("Srch", R.x + R.w - 2*MARIGIN, R.y + 2*MARIGIN);
4646

4747
g.setFontAlign(1, 1, 0);
48-
g.drawString("Saved", R.x + R.w - 2*marigin, R.y + R.h - 2*marigin);
48+
g.drawString("Saved", R.x + R.w - 2*MARIGIN, R.y + R.h - 2*MARIGIN);
4949
};
5050

5151
// Touch handler for main layout
5252
let touchHandler = function(_, xy) {
53-
x = xy.x;
54-
y = xy.y;
55-
len = (R.w<R.h+1)?(R.w/3):(R.h/3);
53+
let x = xy.x;
54+
let y = xy.y;
55+
let len = (R.w<R.h+1)?(R.w/3):(R.h/3);
5656

5757
// doing a<b+1 seemed faster than a<=b, also using a>b-1 instead of a>b.
5858
if ((R.x-1<x && x<R.x+len) && (R.y-1<y && y<R.y+len)) {
@@ -82,7 +82,7 @@ let touchHandler = function(_, xy) {
8282
spotifyWidget("NEXT");
8383
} else if ((R.x-1<x && x<R.x2+1) && (R.y-1<y && y<R.y2+1)){
8484
//play/pause
85-
playPause = isPaused?"play":"pause";
85+
let playPause = isPaused?"play":"pause";
8686
Bangle.musicControl(playPause);
8787
isPaused = !isPaused;
8888
}

apps/spotrem/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "spotrem",
33
"name": "Remote for Spotify",
4-
"version": "0.11",
4+
"version": "0.12",
55
"description": "Control spotify on your android device.",
66
"readme": "README.md",
77
"type": "app",

0 commit comments

Comments
 (0)