mirror of https://github.com/espruino/BangleApps
Alarm: Change 'New Alarm' to 'Save', allow Deletion of Alarms
parent
36a8957942
commit
3b7eec70e3
|
@ -134,7 +134,7 @@
|
|||
"name": "Default Alarm",
|
||||
"shortName":"Alarms",
|
||||
"icon": "app.png",
|
||||
"version":"0.05",
|
||||
"version":"0.06",
|
||||
"description": "Set and respond to alarms",
|
||||
"tags": "tool,alarm,widget",
|
||||
"storage": [
|
||||
|
|
|
@ -3,3 +3,4 @@
|
|||
0.03: More alarm scheduling issues
|
||||
0.04: Tweaks for variable size widget system
|
||||
0.05: Add alarm.boot.js and move code from the bootloader
|
||||
0.06: Change 'New Alarm' to 'Save', allow Deletion of Alarms
|
||||
|
|
|
@ -84,15 +84,15 @@ function editAlarm(alarmIndex) {
|
|||
last : day, rp : repeat
|
||||
};
|
||||
}
|
||||
if (newAlarm) {
|
||||
menu["> New Alarm"] = function() {
|
||||
alarms.push(getAlarm());
|
||||
menu["> Save"] = function() {
|
||||
if (newAlarm) alarms.push(getAlarm());
|
||||
else alarms[alarmIndex] = getAlarm();
|
||||
require("Storage").write("alarm.json",JSON.stringify(alarms));
|
||||
showMainMenu();
|
||||
};
|
||||
} else {
|
||||
menu["> Save"] = function() {
|
||||
alarms[alarmIndex] = getAlarm();
|
||||
if (!newAlarm) {
|
||||
menu["> Delete"] = function() {
|
||||
alarms.splice(alarmIndex,1);
|
||||
require("Storage").write("alarm.json",JSON.stringify(alarms));
|
||||
showMainMenu();
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue