|
1 | 1 | (function(back) { |
2 | | - const FILE = "flex.settings.json"; |
| 2 | + const FILE = "flux.settings.json"; |
| 3 | + |
| 4 | + // Color list shared across fields |
| 5 | + const COLORS = [ |
| 6 | + "White", "Black", "Red", "Blue", "Green", |
| 7 | + "Yellow", "Orange", "Purple", "Lime", |
| 8 | + "Cyan", "Pink", "Light Blue" |
| 9 | + ]; |
| 10 | + |
| 11 | + const directions = [ |
| 12 | + "Up > Down", |
| 13 | + "Down > Up" |
| 14 | + ]; |
| 15 | + |
| 16 | + function colorIndex(name) { |
| 17 | + let i = COLORS.indexOf(name); |
| 18 | + return i >= 0 ? i : 0; |
| 19 | + } |
3 | 20 |
|
4 | 21 | // Load existing settings with defaults |
5 | 22 | let settings = Object.assign({ |
6 | | - "24hour": false, |
| 23 | + direction: 0, |
7 | 24 | bg: "Black", |
8 | 25 | fg: "White", |
9 | 26 | bg2: "Lime", |
|
15 | 32 | } |
16 | 33 |
|
17 | 34 | E.showMenu({ |
18 | | - "": { title: "Flex Watchface" }, |
| 35 | + "": { title: "Flux Watchface" }, |
19 | 36 | "< Back": back, |
20 | | - "24 Hour Time": { |
21 | | - value: !!settings["24hour"], |
22 | | - onchange: v => { |
23 | | - settings["24hour"] = v; |
| 37 | + "Direction": { |
| 38 | + value: settings.direction, |
| 39 | + min: 0, max: 1, |
| 40 | + format: i => directions[i], |
| 41 | + onchange: i => { |
| 42 | + settings.direction = i; |
24 | 43 | writeSettings(); |
25 | 44 | } |
26 | 45 | }, |
|
61 | 80 | } |
62 | 81 | }, |
63 | 82 | }); |
64 | | - |
65 | | - // Color list shared across fields |
66 | | - const COLORS = [ |
67 | | - "White", "Black", "Red", "Blue", "Green", |
68 | | - "Yellow", "Orange", "Purple", "Lime", |
69 | | - "Cyan", "Pink", "Light Blue" |
70 | | - ]; |
71 | | - |
72 | | - function colorIndex(name) { |
73 | | - let i = COLORS.indexOf(name); |
74 | | - return i >= 0 ? i : 0; |
75 | | - } |
76 | 83 | }); |
0 commit comments