Merge branch 'espruino:master' into master

master
awkirk71 2022-07-06 16:10:05 +01:00 committed by GitHub
commit ae8e2dd006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 57 additions and 34 deletions

View File

@ -1,2 +1,2 @@
0.01: New App!...
0.02: First update with ChangeLog Added
0.01: First version
0.02: Enchanced contrast of icon image

View File

@ -1,2 +0,0 @@
0.01: First version
0.02: Enchanced contrast of icon image

View File

@ -53,4 +53,6 @@
0.38: Add telegram foss handling
0.39: Set default color for message icons according to theme
0.40: Use default Bangle formatter for booleans
0.41: Add notification icons in the widget
0.41: Add notification icons in the widget
0.42: Fix messages ignoring "Vibrate: Off" setting
0.43: Add new Icons (Airbnb, warnwetter)

View File

@ -112,6 +112,7 @@ exports.getMessageImage = function(msg) {
*/
if (msg.img) return atob(msg.img);
var s = (msg.src||"").toLowerCase();
if (s=="airbnb") return atob("GBgBAAAAAAAAAAAAADwAAH4AAGYAAMMAAIEAAYGAAYGAAzzAA2bABmZgBmZgDGYwDDwwCDwQCBgQDDwwB+fgA8PAAAAAAAAAAAAA");
if (s=="alarm" || s =="alarmclockreceiver") return atob("GBjBAP////8AAAAAAAACAEAHAOAefng5/5wTgcgHAOAOGHAMGDAYGBgYGBgYGBgYGBgYDhgYBxgMATAOAHAHAOADgcAB/4AAfgAAAAAAAAA=");
if (s=="bibel") return atob("GBgBAAAAA//wD//4D//4H//4H/f4H/f4H+P4H4D4H4D4H/f4H/f4H/f4H/f4H/f4H//4H//4H//4GAAAEAAAEAAACAAAB//4AAAA");
if (s=="calendar") return atob("GBiBAAAAAAAAAAAAAA//8B//+BgAGBgAGBgAGB//+B//+B//+B9m2B//+B//+Btm2B//+B//+Btm+B//+B//+A//8AAAAAAAAAAAAA==");
@ -138,6 +139,7 @@ exports.getMessageImage = function(msg) {
if (s=="to do") return atob("GBgBAAAAAAAAAAAwAAB4AAD8AAH+AAP/DAf/Hg//Px/+f7/8///4///wf//gP//AH/+AD/8AB/4AA/wAAfgAAPAAAGAAAAAAAAAA");
if (s=="twitch") return atob("GBgBH//+P//+P//+eAAGeAAGeAAGeDGGeDOGeDOGeDOGeDOGeDOGeDOGeAAOeAAOeAAcf4/4f5/wf7/gf//Af/+AA/AAA+AAAcAA");
if (s=="twitter") return atob("GhYBAABgAAB+JgA/8cAf/ngH/5+B/8P8f+D///h///4f//+D///g///wD//8B//+AP//gD//wAP/8AB/+AB/+AH//AAf/AAAYAAA");
if (s=="warnapp") return atob("GBgBAAAAAAAAAAAAAH4AAP8AA//AA//AD//gP//gf//4f//+/+P+/8H//8n//4n/fxh/fzg+Pj88Dn44AA4AAAwAAAwAAAgAAAAA");
if (s=="whatsapp") return atob("GBiBAAB+AAP/wAf/4A//8B//+D///H9//n5//nw//vw///x///5///4///8e//+EP3/APn/wPn/+/j///H//+H//8H//4H//wMB+AA==");
if (s=="wordfeud") return atob("GBgCWqqqqqqlf//////9v//////+v/////++v/////++v8///Lu+v8///L++v8///P/+v8v//P/+v9v//P/+v+fx/P/+v+Pk+P/+v/PN+f/+v/POuv/+v/Ofdv/+v/NvM//+v/I/Y//+v/k/k//+v/i/w//+v/7/6//+v//////+v//////+f//////9Wqqqqqql");
if (s=="youtube") return atob("GBgBAAAAAAAAAAAAAAAAAf8AH//4P//4P//8P//8P5/8P4/8f4P8f4P8P4/8P5/8P//8P//8P//4H//4Af8AAAAAAAAAAAAAAAAA");
@ -149,6 +151,7 @@ exports.getMessageImage = function(msg) {
exports.getMessageImageCol = function(msg,def) {
return {
// generic colors, using B2-safe colors
"airbnb": "#f00",
"alarm": "#fff",
"mail": "#ff0",
"music": "#f0f",

View File

@ -1,7 +1,7 @@
{
"id": "messages",
"name": "Messages",
"version": "0.41",
"version": "0.43",
"description": "App to display notifications from iOS and Gadgetbridge/Android",
"icon": "app.png",
"type": "app",

View File

@ -62,7 +62,9 @@ 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 || ":");
var pattern = (require('Storage').readJSON("messages.settings.json", true) || {}).vibrate;
if (pattern === undefined) { pattern = ":"; } // pattern may be "", so we can't use || ":" here
require("buzz").pattern(pattern);
},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

@ -1 +1,2 @@
0.01: New App!
0.02: Remove one line of code that didn't do anything other than in some instances hinder the function of the app.

View File

@ -6,9 +6,9 @@ Making the music controls accessible this way lets one start a music stream on t
It is suggested to use Messages Music along side the app Quick Launch.
Messages Music v0.01 has been verified to work with Messages v0.31 on Bangle.js 2 fw2v13.
Messages Music v0.02 has been verified to work with Messages v0.41 on Bangle.js 2 fw2v14.
Music Messages should work with forks of the original Messages app. At least as long as functions pushMessage() in the library and showMusicMessage() in app.js hasn't been changed too much.
Messages Music should work with forks of the original Messages app. At least as long as functions pushMessage() in the library and showMusicMessage() in app.js hasn't been changed too much.
Messages app is created by Gordon Williams with contributions from [Jeroen Peters](https://github.com/jeroenpeters1986).

View File

@ -1,7 +1,6 @@
let showMusic = () => {
Bangle.CLOCK = 1; // To pass condition in messages library
require('messages').pushMessage({"t":"add","artist":" ","album":" ","track":" ","dur":0,"c":-1,"n":-1,"id":"music","title":"Music","state":"play","new":true});
Bangle.CLOCK = undefined;
};
var settings = require('Storage').readJSON('messages.settings.json', true) || {}; //read settings if they exist else set to empty dict

View File

@ -1,7 +1,7 @@
{
"id": "messagesmusic",
"name":"Messages Music",
"version":"0.01",
"version":"0.02",
"description": "Uses Messages library to push a music message which in turn displays Messages app music controls",
"icon":"app.png",
"type": "app",

View File

@ -1,12 +1,12 @@
# Open Weather Map weather provider
# OpenWeatherMap weather provider
This updates [Weather](https://banglejs.com/apps/#weather) with data from the Open Weather Map API
This updates [Weather](https://banglejs.com/apps/#weather) with data from the OpenWeatherMap API
## Usage
Just install and configure the app. This needs an internet-enabled Gadgetbridge version.
Install [My Location](https://banglejs.com/apps/#mylocation) to change the location for the weather requests.
Install one of the text input libraries to modify the API key in the settings
Install one of the text input libraries to set the API key in the app settings or use the web interface.
## Creator

View File

@ -2,14 +2,28 @@
<head>
<link rel="stylesheet" href="../../css/spectre.min.css">
</head>
<body>
<h3>Set OWM API key</h3>
<p><input id="apikey" style="width:90%;"></input></p>
<p><button id="upload" class="btn btn-primary">Set</button></p>
<body>
<h3>Set OpenWeatherMap (OWM) API key</h3>
<p><input id="apikey" onkeyup="checkInput()" style="width:90%; margin: 3px"></input><button id="upload" class="btn btn-primary">Save key</button></p>
<h4>Where to get your personal API key?</h4>
<p>Go to <a href="https://home.openweathermap.org/users/sign_up">https://home.openweathermap.org/users/sign_up</a> and sign up for a free account.<br>
After registration you can login and optain your personal API key.</p>
<script src="../../core/lib/interface.js"></script>
<script>
function checkInput() {
if(document.getElementById("apikey").value==="") {
document.getElementById('upload').disabled = true;
} else {
document.getElementById('upload').disabled = false;
}
}
checkInput();
var settings = {};
function onInit(){
console.log("Loading settings from BangleJs...");
@ -20,6 +34,7 @@
console.log("Got settings", settings);
document.getElementById("apikey").value = settings.apikey;
console.log("Loaded apikey from BangleJs.");
checkInput();
}
});
} catch(ex) {

View File

@ -1,8 +1,8 @@
{ "id": "owmweather",
"name": "Open Weather Map weather provider",
"name": "OpenWeatherMap weather provider",
"shortName":"OWM Weather",
"version":"0.01",
"description": "Pulls weather from OWM API",
"description": "Pulls weather from OpenWeatherMap (OWM) API",
"icon": "app.png",
"type": "bootloader",
"tags": "boot,tool,weather",

View File

@ -1,2 +1,6 @@
...
0.06: First update with ChangeLog Added
0.01: [MAJOR] Added sonic clock app
0.02: [PATCH] Fixed text alignment issue; Increased acceleration required to activate twist;
0.03: [MINOR] Added settings menu to control twist threshold and LCD Activity
0.04: [PATCH] Call `Bangle.setUI` when exiting settings menu, settings tap moved to top
0.05: [PATCH] Firmware 2v11 - use `wakeOnTwist` rather than manual `setLCDPower`; Reset sonic on `fullReset`
0.06: Use default Bangle formatter for booleans

View File

@ -1,6 +0,0 @@
0.01: [MAJOR] Added sonic clock app
0.02: [PATCH] Fixed text alignment issue; Increased acceleration required to activate twist;
0.03: [MINOR] Added settings menu to control twist threshold and LCD Activity
0.04: [PATCH] Call `Bangle.setUI` when exiting settings menu, settings tap moved to top
0.05: [PATCH] Firmware 2v11 - use `wakeOnTwist` rather than manual `setLCDPower`; Reset sonic on `fullReset`
0.06: Use default Bangle formatter for booleans

2
apps/teatimer/ChangeLog Normal file
View File

@ -0,0 +1,2 @@
0.01: New App!
0.02: Fix issue setting colors after showMessage

View File

@ -67,9 +67,9 @@ function startTimer() {
- hint for help in state start
*/
function showCounter(withHint) {
//g.clear();
g.reset(); // workaround for E.showMessage bg color in 2v14 and earlier
E.showMessage("", appTitle());
g.setFontAlign(0,0); // center font
g.reset().setFontAlign(0,0); // center font
// draw the current counter value
g.setBgColor(-1).setColor(0,0,1); // blue
g.setFont("Vector",20); // vector font, 20px
@ -123,9 +123,9 @@ function countUp() {
outOfTime();
return;
}
g.clear();
g.reset(); // workaround for E.showMessage bg color in 2v14 and earlier
E.showMessage("", appTitle());
g.setFontAlign(0,0); // center font
g.reset().setFontAlign(0,0); // center font
g.setBgColor(-1).setColor(0,0,1); // blue
g.setFont("Vector",20); // vector font, 20px
g.drawString("Timer: " + timeFormated(counterStart),80,55);

View File

@ -1,7 +1,7 @@
{
"id": "teatimer",
"name": "Tea Timer",
"version": "0.01",
"version": "0.02",
"description": "A simple timer. You can easyly set up the time.",
"icon": "teatimer.png",
"type": "app",

View File

@ -123,7 +123,10 @@ apps.forEach((app,appIdx) => {
if (!app.version) ERROR(`App ${app.id} has no version`, {file:metadataFile});
else {
if (!fs.existsSync(appDir+"ChangeLog")) {
if (app.version != "0.01")
var invalidChangeLog = fs.readdirSync(appDir).find(f => f.toLowerCase().startsWith("changelog") && f!="ChangeLog");
if (invalidChangeLog)
ERROR(`App ${app.id} has wrongly named ChangeLog (${invalidChangeLog})`, {file:appDirRelative+invalidChangeLog});
else if (app.version != "0.01")
WARN(`App ${app.id} has no ChangeLog`, {file:metadataFile});
} else {
var changeLog = fs.readFileSync(appDir+"ChangeLog").toString();