mirror of https://github.com/espruino/BangleApps
commit
46e4bba312
|
@ -43,3 +43,4 @@
|
||||||
Display alarm label in delete prompt
|
Display alarm label in delete prompt
|
||||||
0.39: Dated event repeat option
|
0.39: Dated event repeat option
|
||||||
0.40: Use substring of message when it's longer than fits the designated menu entry.
|
0.40: Use substring of message when it's longer than fits the designated menu entry.
|
||||||
|
0.41: Fix a menu bug affecting alarms with empty messages.
|
||||||
|
|
|
@ -56,6 +56,16 @@ function trimLabel(label, maxLength) {
|
||||||
: label.substring(0,maxLength));
|
: label.substring(0,maxLength));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatAlarmMessage(msg) {
|
||||||
|
if (msg == null) {
|
||||||
|
return msg;
|
||||||
|
} else if (msg.length > 7) {
|
||||||
|
return msg.substring(0,6)+"...";
|
||||||
|
} else {
|
||||||
|
return msg.substring(0,7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function showMainMenu() {
|
function showMainMenu() {
|
||||||
const menu = {
|
const menu = {
|
||||||
"": { "title": /*LANG*/"Alarms & Timers" },
|
"": { "title": /*LANG*/"Alarms & Timers" },
|
||||||
|
@ -145,9 +155,7 @@ function showEditAlarmMenu(selectedAlarm, alarmIndex, withDate) {
|
||||||
},
|
},
|
||||||
/*LANG*/"Message": {
|
/*LANG*/"Message": {
|
||||||
value: alarm.msg,
|
value: alarm.msg,
|
||||||
format: v => (v.length > 7
|
format: formatAlarmMessage,
|
||||||
? (v.substring(0,6)+"...")
|
|
||||||
: v.substring(0,7)),
|
|
||||||
onchange: () => {
|
onchange: () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
keyboard.input({text:alarm.msg}).then(result => {
|
keyboard.input({text:alarm.msg}).then(result => {
|
||||||
|
@ -379,9 +387,7 @@ function showEditTimerMenu(selectedTimer, timerIndex) {
|
||||||
},
|
},
|
||||||
/*LANG*/"Message": {
|
/*LANG*/"Message": {
|
||||||
value: timer.msg,
|
value: timer.msg,
|
||||||
format: v => (v.length > 7
|
format: formatAlarmMessage,
|
||||||
? (v.substring(0,6)+"...")
|
|
||||||
: v.substring(0,7)),
|
|
||||||
onchange: () => {
|
onchange: () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
keyboard.input({text:timer.msg}).then(result => {
|
keyboard.input({text:timer.msg}).then(result => {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "alarm",
|
"id": "alarm",
|
||||||
"name": "Alarms & Timers",
|
"name": "Alarms & Timers",
|
||||||
"shortName": "Alarms",
|
"shortName": "Alarms",
|
||||||
"version": "0.40",
|
"version": "0.41",
|
||||||
"description": "Set alarms and timers on your Bangle",
|
"description": "Set alarms and timers on your Bangle",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"tags": "tool,alarm",
|
"tags": "tool,alarm",
|
||||||
|
|
Loading…
Reference in New Issue