mirror of https://github.com/espruino/BangleApps
0.03: Fix unfreed memory, and clearInterval that disabled all clocks at midnight (fix #946)
Fix app icon Change menu order so 'back' is at the toppull/987/head
parent
ce2d182247
commit
5b967184b6
|
@ -4310,7 +4310,7 @@
|
||||||
"name": "Q Alarm and Timer",
|
"name": "Q Alarm and Timer",
|
||||||
"shortName": "Q Alarm",
|
"shortName": "Q Alarm",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"version": "0.02",
|
"version": "0.03",
|
||||||
"description": "Alarm and timer app with days of week and 'hard' option.",
|
"description": "Alarm and timer app with days of week and 'hard' option.",
|
||||||
"tags": "tool,alarm,widget",
|
"tags": "tool,alarm,widget",
|
||||||
"supports": ["BANGLEJS", "BANGLEJS2"],
|
"supports": ["BANGLEJS", "BANGLEJS2"],
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
0.01: First version!
|
0.01: First version!
|
||||||
0.02: Fixed alarms not working and localised days of week.
|
0.02: Fixed alarms not working and localised days of week.
|
||||||
|
0.03: Fix unfreed memory, and clearInterval that disabled all clocks at midnight
|
||||||
|
Fix app icon
|
||||||
|
Change menu order so 'back' is at the top
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
require("heatshrink").decompress(atob("/wA/AH4A/AH4AF0WiF1wwtF73GB53MAAgkY4wABFqIxPEhQuXGB4vUFxYwMEpBpGBwouNGAwfFF5I1KF6ZQHGAwNLFx4wHF/4v/F/4v/AoYGDF6gaFF5AwHL7QuMBJQvWEpwvxBQ4uRGBAkJT4wuWGBIuIRjKRNF8wwXFy4wWFzIwU53NFzPN5wuR5/PGK4tBDYSNQ5wVCCwIzBAAQoIAAQWGSJ5HFDYYAQIYTCRKRIeBAAYmDAAZsJMCQAbeCAybFiQ0XFTQAIzgAGFcYvz0QAGF84wGF1AwFF1QA/AH4A/ADQ="))
|
require("heatshrink").decompress(atob("mEw4UA///gH+93+oH9Jf8AgfABZMP+ALRmADCitUAgUMAQP8AQMBqtVoAFBn4CBDwUFBYNQFAQLEioLBEgQLBgfwE4IKBAAI3BBYXAE4ILE/gJBAIM8HQQ8CngL/n4LFKYR3BhgLFNYSDCBYqPFBZKzBUwSoDWYTLBUwSoDZYQABBQa0DBZCoBAAY6EcojhEHgoACkoLFrALD1WVBQdW1QLDtQMDBQOpHQmqAAg8DIwQKEJAg6FMApfLDIoJFAAX//4KIBbE/aAIAIh7oBAH4A=="))
|
||||||
|
|
|
@ -41,6 +41,7 @@ function getCurrentTime() {
|
||||||
function showMainMenu() {
|
function showMainMenu() {
|
||||||
const menu = {
|
const menu = {
|
||||||
"": { title: "Alarms" },
|
"": { title: "Alarms" },
|
||||||
|
"< Back" : () => load(),
|
||||||
"New Alarm": () => showEditAlarmMenu(-1),
|
"New Alarm": () => showEditAlarmMenu(-1),
|
||||||
"New Timer": () => showEditTimerMenu(-1),
|
"New Timer": () => showEditTimerMenu(-1),
|
||||||
};
|
};
|
||||||
|
@ -54,9 +55,7 @@ function showMainMenu() {
|
||||||
else showEditAlarmMenu(idx);
|
else showEditAlarmMenu(idx);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
menu["< Back"] = () => {
|
menu
|
||||||
load();
|
|
||||||
};
|
|
||||||
|
|
||||||
if (WIDGETS["qalarm"]) WIDGETS["qalarm"].reload();
|
if (WIDGETS["qalarm"]) WIDGETS["qalarm"].reload();
|
||||||
return E.showMenu(menu);
|
return E.showMenu(menu);
|
||||||
|
@ -86,6 +85,7 @@ function showEditAlarmMenu(alarmIndex, alarm) {
|
||||||
|
|
||||||
const menu = {
|
const menu = {
|
||||||
"": { title: alarm.msg ? alarm.msg : "Alarms" },
|
"": { title: alarm.msg ? alarm.msg : "Alarms" },
|
||||||
|
"< Back" : showMainMenu,
|
||||||
Hours: {
|
Hours: {
|
||||||
value: hrs,
|
value: hrs,
|
||||||
onchange: function (v) {
|
onchange: function (v) {
|
||||||
|
@ -162,7 +162,6 @@ function showEditAlarmMenu(alarmIndex, alarm) {
|
||||||
showMainMenu();
|
showMainMenu();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
menu["< Back"] = showMainMenu;
|
|
||||||
return E.showMenu(menu);
|
return E.showMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,6 +205,7 @@ function showEditTimerMenu(timerIndex) {
|
||||||
|
|
||||||
const menu = {
|
const menu = {
|
||||||
"": { title: "Timer" },
|
"": { title: "Timer" },
|
||||||
|
"< Back" : showMainMenu,
|
||||||
Hours: {
|
Hours: {
|
||||||
value: hrs,
|
value: hrs,
|
||||||
onchange: function (v) {
|
onchange: function (v) {
|
||||||
|
@ -264,7 +264,7 @@ function showEditTimerMenu(timerIndex) {
|
||||||
showMainMenu();
|
showMainMenu();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
menu["< Back"] = showMainMenu;
|
|
||||||
return E.showMenu(menu);
|
return E.showMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
eval(require("Storage").read("qalarmcheck.js"));
|
(function() { eval(require("Storage").read("qalarmcheck.js")); })()
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
|
|
||||||
print("Checking for alarms...");
|
print("Checking for alarms...");
|
||||||
|
|
||||||
clearInterval();
|
if (Bangle.QALARM) {
|
||||||
|
clearInterval(Bangle.QALARM);
|
||||||
|
Bangle.QALARM = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
function getCurrentTime() {
|
function getCurrentTime() {
|
||||||
let time = new Date();
|
let time = new Date();
|
||||||
|
@ -29,13 +32,13 @@ let nextAlarms = (require("Storage").readJSON("qalarm.json", 1) || [])
|
||||||
.sort((a, b) => a.t - b.t);
|
.sort((a, b) => a.t - b.t);
|
||||||
|
|
||||||
if (nextAlarms[0]) {
|
if (nextAlarms[0]) {
|
||||||
setTimeout(() => {
|
Bangle.QALARM = setTimeout(() => {
|
||||||
eval(require("Storage").read("qalarmcheck.js"));
|
eval(require("Storage").read("qalarmcheck.js"));
|
||||||
load("qalarm.js");
|
load("qalarm.js");
|
||||||
}, nextAlarms[0].t - t);
|
}, nextAlarms[0].t - t);
|
||||||
} else {
|
} else {
|
||||||
// No alarms found: will re-check at midnight
|
// No alarms found: will re-check at midnight
|
||||||
setTimeout(() => {
|
Bangle.QALARM = setTimeout(() => {
|
||||||
eval(require("Storage").read("qalarmcheck.js"));
|
eval(require("Storage").read("qalarmcheck.js"));
|
||||||
}, 86400000 - t);
|
}, 86400000 - t);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue