diff --git a/apps/alarm/ChangeLog b/apps/alarm/ChangeLog index f1f8fb40e1..7d4d23f576 100644 --- a/apps/alarm/ChangeLog +++ b/apps/alarm/ChangeLog @@ -45,3 +45,4 @@ 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. 0.42: Fix date not getting saved in event edit menu when tapping Confirm +0.43: New settings: Show confirm, Show Overflow, Show Type. diff --git a/apps/alarm/README.md b/apps/alarm/README.md index 9da142dab0..43f72665ee 100644 --- a/apps/alarm/README.md +++ b/apps/alarm/README.md @@ -13,7 +13,7 @@ It uses the [`sched` library](https://github.com/espruino/BangleApps/blob/master - `Repeat` → Select when the alarm will fire. You can select a predefined option (_Once_, _Every Day_, _Workdays_ or _Weekends_ or you can configure the days freely) - `New Timer` → Configure a new timer (triggered based on amount of time elapsed in hours/minutes/seconds) - `New Event` → Configure a new event (triggered based on time and date) - - `Repeat` → Alarm can be be fired only once or repeated (every X number of _days_, _weeks_, _months_ or _years_) + - `Repeat` → Alarm can be fired only once or repeated (every X number of _days_, _weeks_, _months_ or _years_) - `Advanced` - `Scheduler settings` → Open the [Scheduler](https://github.com/espruino/BangleApps/tree/master/apps/sched) settings page, see its [README](https://github.com/espruino/BangleApps/blob/master/apps/sched/README.md) for details - `Enable All` → Enable _all_ disabled alarms & timers diff --git a/apps/alarm/app.js b/apps/alarm/app.js index d135f184e3..f8dcdbfed3 100644 --- a/apps/alarm/app.js +++ b/apps/alarm/app.js @@ -1,6 +1,11 @@ Bangle.loadWidgets(); Bangle.drawWidgets(); +const settings = Object.assign({ + showConfirm : true, + showAutoSnooze : true, + showHidden : true +}, require('Storage').readJSON('alarm.json',1)||{}); // 0 = Sunday (default), 1 = Monday const firstDayOfWeek = (require("Storage").readJSON("setting.json", true) || {}).firstDayOfWeek || 0; const WORKDAYS = 62; @@ -51,12 +56,14 @@ function getLabel(e) { } function trimLabel(label, maxLength) { + if(settings.showOverflow) return label; return (label.length > maxLength ? label.substring(0,maxLength-3) + "..." : label.substring(0,maxLength)); } -function formatAlarmMessage(msg) { +function formatAlarmProperty(msg) { + if(settings.showOverflow) return msg; if (msg == null) { return msg; } else if (msg.length > 7) { @@ -155,7 +162,7 @@ function showEditAlarmMenu(selectedAlarm, alarmIndex, withDate) { }, /*LANG*/"Message": { value: alarm.msg, - format: formatAlarmMessage, + format: formatAlarmProperty, onchange: () => { setTimeout(() => { keyboard.input({text:alarm.msg}).then(result => { @@ -166,6 +173,19 @@ function showEditAlarmMenu(selectedAlarm, alarmIndex, withDate) { }, 100); } }, + /*LANG*/"Group": { + value: alarm.group, + format: formatAlarmProperty, + onchange: () => { + setTimeout(() => { + keyboard.input({text:alarm.group}).then(result => { + alarm.group = result; + prepareAlarmForSave(alarm, alarmIndex, time, date, true); + setTimeout(showEditAlarmMenu, 10, alarm, alarmIndex, withDate); + }); + }, 100); + } + }, /*LANG*/"Enabled": { value: alarm.on, onchange: v => alarm.on = v @@ -197,6 +217,10 @@ function showEditAlarmMenu(selectedAlarm, alarmIndex, withDate) { }; if (!keyboard) delete menu[/*LANG*/"Message"]; + if (!keyboard || !settings.showGroup) delete menu[/*LANG*/"Group"]; + if (!settings.showConfirm) delete menu[/*LANG*/"Confirm"]; + if (!settings.showAutoSnooze) delete menu[/*LANG*/"Auto Snooze"]; + if (!settings.showHidden) delete menu[/*LANG*/"Hidden"]; if (!alarm.date) { delete menu[/*LANG*/"Day"]; delete menu[/*LANG*/"Month"]; @@ -387,7 +411,7 @@ function showEditTimerMenu(selectedTimer, timerIndex) { }, /*LANG*/"Message": { value: timer.msg, - format: formatAlarmMessage, + format: formatAlarmProperty, onchange: () => { setTimeout(() => { keyboard.input({text:timer.msg}).then(result => { @@ -420,6 +444,8 @@ function showEditTimerMenu(selectedTimer, timerIndex) { }; if (!keyboard) delete menu[/*LANG*/"Message"]; + if (!settings.showConfirm) delete menu[/*LANG*/"Confirm"]; + if (!settings.showHidden) delete menu[/*LANG*/"Hidden"]; if (!isNew) { menu[/*LANG*/"Delete"] = () => { E.showPrompt(getLabel(timer) + "\n" + /*LANG*/"Are you sure?", { title: /*LANG*/"Delete Timer" }).then((confirm) => { diff --git a/apps/alarm/metadata.json b/apps/alarm/metadata.json index 3c676c217e..bcd60a3760 100644 --- a/apps/alarm/metadata.json +++ b/apps/alarm/metadata.json @@ -2,7 +2,7 @@ "id": "alarm", "name": "Alarms & Timers", "shortName": "Alarms", - "version": "0.42", + "version": "0.43", "description": "Set alarms and timers on your Bangle", "icon": "app.png", "tags": "tool,alarm", @@ -11,7 +11,8 @@ "dependencies": { "scheduler":"type", "alarm":"widget" }, "storage": [ { "name": "alarm.app.js", "url": "app.js" }, - { "name": "alarm.img", "url": "app-icon.js", "evaluate": true } + { "name": "alarm.img", "url": "app-icon.js", "evaluate": true }, + { "name": "alarm.settings.js", "url":"settings.js" } ], "screenshots": [ { "url": "screenshot-1.png" }, @@ -25,5 +26,6 @@ { "url": "screenshot-9.png" }, { "url": "screenshot-10.png" }, { "url": "screenshot-11.png" } - ] + ], + "data":[ {"name":"alarm.settings.json"} ] } diff --git a/apps/alarm/settings.js b/apps/alarm/settings.js new file mode 100644 index 0000000000..765e5a5fa3 --- /dev/null +++ b/apps/alarm/settings.js @@ -0,0 +1,51 @@ +(function(back) { + let settings = Object.assign({ + showConfirm : true, + showAutoSnooze : true, + showHidden : true + }, require('Storage').readJSON('alarm.json',1)||{}); + + const save = () => require('Storage').write('alarm.json', settings); + const DATE_FORMATS = ['default', 'mmdd']; + const DATE_FORMATS_LABELS = [/*LANG*/'Default', /*LANG*/'MMDD']; + + const appMenu = { + '': {title: 'alarm'}, '< Back': back, + /*LANG*/'Menu Date Format': { + value: DATE_FORMATS.indexOf(settings.menuDateFormat || 'default'), + format: v => DATE_FORMATS_LABELS[v], + min: 0, + max: DATE_FORMATS.length - 1, + onchange : v => { + if(v > 0) { + settings.menuDateFormat=DATE_FORMATS[v]; + } else { + delete settings.menuDateFormat; + } + save(); + } + }, + /*LANG*/'Show Menu Auto Snooze': { + value : !!settings.showAutoSnooze, + onchange : v => { settings.showAutoSnooze=v; save();} + }, + /*LANG*/'Show Menu Confirm': { + value : !!settings.showConfirm, + onchange : v => { settings.showConfirm=v; save();} + }, + /*LANG*/'Show Menu Hidden': { + value : !!settings.showHidden, + onchange : v => { settings.showHidden=v; save();} + }, + /*LANG*/'Show Menu Group': { + value : !!settings.showGroup, + onchange : v => { settings.showGroup=v; save();} + }, + /*LANG*/'Show Text Overflow': { + value : !!settings.showOverflow, + onchange : v => { settings.showOverflow=v; save();} + }, + }; + + E.showMenu(appMenu); +}); diff --git a/apps/dragboard/ChangeLog b/apps/dragboard/ChangeLog index d147a623b0..68cd82cfa6 100644 --- a/apps/dragboard/ChangeLog +++ b/apps/dragboard/ChangeLog @@ -7,3 +7,4 @@ 0.07: Settings for display colors 0.08: Catch and discard swipe events on fw2v19 and up (as well as some cutting edge 2v18 ones), allowing compatability with the Back Swipe app. +0.09: Fix colors settings, where color was stored as string instead of the expected int. diff --git a/apps/dragboard/metadata.json b/apps/dragboard/metadata.json index 5c52d9389b..090c37a01c 100644 --- a/apps/dragboard/metadata.json +++ b/apps/dragboard/metadata.json @@ -1,6 +1,6 @@ { "id": "dragboard", "name": "Dragboard", - "version":"0.08", + "version":"0.09", "description": "A library for text input via swiping keyboard", "icon": "app.png", "type":"textinput", diff --git a/apps/dragboard/settings.js b/apps/dragboard/settings.js index a539148694..59a13c4435 100644 --- a/apps/dragboard/settings.js +++ b/apps/dragboard/settings.js @@ -21,7 +21,7 @@ value: settings[key] == color, onchange: () => { if (color >= 0) { - settings[key] = color; + settings[key] = parseInt(color); } else { delete settings[key]; } diff --git a/apps/draguboard/ChangeLog b/apps/draguboard/ChangeLog index bca1ca7c4b..3f36dc4a64 100644 --- a/apps/draguboard/ChangeLog +++ b/apps/draguboard/ChangeLog @@ -1,3 +1,4 @@ 0.01: New App based on dragboard, but with a U shaped drag area 0.02: Catch and discard swipe events on fw2v19 and up (as well as some cutting edge 2v18 ones), allowing compatability with the Back Swipe app. +0.03: Fix "Uncaught Error: Unhandled promise rejection: ReferenceError: "dragHandlerDB" is not defined" diff --git a/apps/draguboard/lib.js b/apps/draguboard/lib.js index 6c63668a99..57093de3f8 100644 --- a/apps/draguboard/lib.js +++ b/apps/draguboard/lib.js @@ -148,7 +148,7 @@ exports.input = function(options) { g.clearRect(Bangle.appRect); resolve(text); }, - drag: dragHandlerDB + drag: dragHandlerUB }); Bangle.prependListener&&Bangle.prependListener('swipe', catchSwipe); // Intercept swipes on fw2v19 and later. Should not break on older firmwares. diff --git a/apps/draguboard/metadata.json b/apps/draguboard/metadata.json index 620f39f71f..2f395f8a83 100644 --- a/apps/draguboard/metadata.json +++ b/apps/draguboard/metadata.json @@ -1,6 +1,6 @@ { "id": "draguboard", "name": "DragUboard", - "version":"0.02", + "version":"0.03", "description": "A library for text input via swiping U-shaped keyboard.", "icon": "app.png", "type":"textinput", diff --git a/apps/draguboard/settings.js b/apps/draguboard/settings.js index c94ebee70b..ff4ede637f 100644 --- a/apps/draguboard/settings.js +++ b/apps/draguboard/settings.js @@ -21,7 +21,7 @@ value: settings[key] == color, onchange: () => { if (color >= 0) { - settings[key] = color; + settings[key] = parseInt(color); } else { delete settings[key]; }