Fixing apps that use buzz after recent buzz strength PR (these apps would have previously used a low strength buzz)

pull/1965/head^2
Gordon Williams 2022-06-14 09:04:15 +01:00
parent c237d5f342
commit 6c7525b8ea
4 changed files with 10 additions and 10 deletions

View File

@ -1,7 +1,7 @@
(function(back) {
function settings() {
let settings = require('Storage').readJSON("messages.settings.json", true) || {};
if (settings.vibrate===undefined) settings.vibrate=".";
if (settings.vibrate===undefined) settings.vibrate=":";
if (settings.repeat===undefined) settings.repeat=4;
if (settings.unreadTimeout===undefined) settings.unreadTimeout=60;
settings.unlockWatch=!!settings.unlockWatch;

View File

@ -34,7 +34,7 @@ draw:function(recall) {
Bangle.drawWidgets();
},buzz:function() {
if ((require('Storage').readJSON('setting.json',1)||{}).quiet) return; // never buzz during Quiet Mode
require("buzz").pattern((require('Storage').readJSON("messages.settings.json", true) || {}).vibrate || ".");
require("buzz").pattern((require('Storage').readJSON("messages.settings.json", true) || {}).vibrate || ":");
},touch:function(b,c) {
var w=WIDGETS["messages"];
if (!w||!w.width||c.x<w.x||c.x>w.x+w.width||c.y<w.y||c.y>w.y+w.iconwidth) return;

View File

@ -120,7 +120,7 @@ function showAlarm(alarm) {
Bangle.setLocked(false);
}
require("buzz").pattern(alarm.vibrate === undefined ? ".." : alarm.vibrate).then(() => {
require("buzz").pattern(alarm.vibrate === undefined ? "::" : alarm.vibrate).then(() => {
if (buzzCount--) {
setTimeout(buzz, settings.buzzIntervalMillis);
} else if (alarm.as) { // auto-snooze

View File

@ -5,7 +5,7 @@ var notes = require("Storage").readJSON("noteify.json", true) || [];
var alarms = require("sched").getAlarms();
msg = "";
function startNote(idx) {
function startNote(idx) {
idx == undefined ? note = "" : note = notes[idx].note;
require("textinput").input({text:note}).then(result => {
if (result != "") {
@ -23,20 +23,20 @@ function viewNote(idx) {
textY += e.dy;
g.setClipRect(0, 30, g.getWidth(), g.getHeight());
if (textY > 30) textY = 30;
if (textY < textBound) textY = textBound;
if (textY < textBound) textY = textBound;
g.clearRect(0, 30, g.getWidth(), g.getHeight()).setColor(g.theme.fg).setFont("6x8:2").setFontAlign(-1, -1).drawString(g.wrapString(notes[idx].note, g.getWidth()).join("\n"), 0, textY);
},back:()=>{
Bangle.setUI();
showEditMenu(idx);
}});
}
function showMainMenu() {
var mainMenu = {
"" : { "title" : "Noteify" },
"< Back" : function() { load(); },
"New note" : function() {
"New note" : function() {
E.showMenu();
startNote();
},
@ -187,7 +187,7 @@ function editAlarm(alarmIndex, alarm) {
as : false,
dow : 0b1111111,
last : 0,
vibrate : ".."
vibrate : "::"
};
if (msg != "") a["msg"] = msg;
if (!newAlarm) Object.assign(a, alarms[alarmIndex]);
@ -195,7 +195,7 @@ function editAlarm(alarmIndex, alarm) {
var t = decodeTime(a.t);
var alarmTitle = (a.msg == undefined) ? 'Alarm' : (a.msg.length > 12) ? a.msg.replace(/\n/g, " ").substring(0, 12)+"..." : msg.replace(/\n/g, " ").substring(0, 12)+"...";
const menu = {
'': { 'title': alarmTitle },
'< Back' : () => showAlarmMenu(),
@ -264,7 +264,7 @@ function editTimer(alarmIndex, alarm) {
var t = decodeTime(a.timer);
var timerTitle = (a.msg == undefined) ? 'Timer' : (a.msg.length > 12) ? a.msg.replace(/\n/g, " ").substring(0, 12)+"..." : msg.replace(/\n/g, " ").substring(0, 12)+"...";
const menu = {
'': { 'title': timerTitle },
'< Back' : () => showMainMenu(),