mirror of https://github.com/espruino/BangleApps
Merge branch 'master' of https://github.com/espruino/BangleApps
commit
a1f1eb4c7f
|
@ -4,3 +4,4 @@ package-lock.json
|
|||
.DS_Store
|
||||
*.js.bak
|
||||
appdates.csv
|
||||
.vscode
|
||||
|
|
23
apps.json
23
apps.json
|
@ -95,7 +95,7 @@
|
|||
{ "id": "gbridge",
|
||||
"name": "Gadgetbridge",
|
||||
"icon": "app.png",
|
||||
"version":"0.10",
|
||||
"version":"0.11",
|
||||
"description": "The default notification handler for Gadgetbridge notifications from Android",
|
||||
"tags": "tool,system,android,widget",
|
||||
"type":"widget",
|
||||
|
@ -168,7 +168,7 @@
|
|||
"name": "Image background clock",
|
||||
"shortName":"Image Clock",
|
||||
"icon": "app.png",
|
||||
"version":"0.06",
|
||||
"version":"0.07",
|
||||
"description": "A clock with an image as a background",
|
||||
"tags": "clock",
|
||||
"type" : "clock",
|
||||
|
@ -331,10 +331,11 @@
|
|||
{ "id": "gpsnav",
|
||||
"name": "GPS Navigation",
|
||||
"icon": "icon.png",
|
||||
"version":"0.01",
|
||||
"description": "Displays GPS Course and Speed, + Directions to waypoint and waypoint recording",
|
||||
"version":"0.03",
|
||||
"description": "Displays GPS Course and Speed, + Directions to waypoint and waypoint recording, now with waypoint editor",
|
||||
"tags": "tool,outdoors,gps",
|
||||
"readme": "README.md",
|
||||
"interface":"waypoints.html",
|
||||
"storage": [
|
||||
{"name":"gpsnav.app.js","url":"app.js"},
|
||||
{"name":"waypoints.json","url":"waypoints.json","evaluate":false},
|
||||
|
@ -1632,7 +1633,7 @@
|
|||
"id": "simpletimer",
|
||||
"name": "Timer",
|
||||
"icon": "app.png",
|
||||
"version": "0.02",
|
||||
"version": "0.03",
|
||||
"description": "Simple timer, useful when playing board games or cooking",
|
||||
"tags": "timer",
|
||||
"readme": "README.md",
|
||||
|
@ -1760,5 +1761,17 @@
|
|||
{ "name": "jbm8b.img", "url": "app-icon.js", "evaluate": true }
|
||||
],
|
||||
"version": "0.03"
|
||||
},
|
||||
{ "id": "widviz",
|
||||
"name": "Widget Visibility Widget",
|
||||
"shortName":"Viz Widget",
|
||||
"icon": "eye.png",
|
||||
"version":"0.02",
|
||||
"description": "Swipe left to hide top bar widgets, swipe right to redisplay.",
|
||||
"tags": "widget",
|
||||
"type": "widget",
|
||||
"storage": [
|
||||
{"name":"widviz.wid.js","url":"widget.js"}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -9,3 +9,4 @@
|
|||
0.08: Don't turn on LCD at start of every song
|
||||
0.09: Update Bluetooth connection state automatically
|
||||
0.10: Make widget play well with other Gadgetbridge widgets/apps
|
||||
0.11: Report battery status on connect and at regular intervals
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
};
|
||||
|
||||
function gbSend(message) {
|
||||
Bluetooth.println("");
|
||||
Bluetooth.println(JSON.stringify(message));
|
||||
}
|
||||
|
||||
|
@ -196,5 +197,11 @@
|
|||
|
||||
WIDGETS["gbridgew"] = { area: "tl", width: 24, draw: draw };
|
||||
|
||||
gbSend({ t: "status", bat: E.getBattery() });
|
||||
function sendBattery() {
|
||||
gbSend({ t: "status", bat: E.getBattery() });
|
||||
}
|
||||
|
||||
NRF.on("connect", () => setTimeout(sendBattery, 2000));
|
||||
setInterval(sendBattery, 10*60*1000);
|
||||
sendBattery();
|
||||
})();
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
0.01: New App!
|
||||
0.02: Add SCREENACCESS interface
|
||||
0.03: Add Waypoint Editor
|
||||
|
||||
|
|
|
@ -26,22 +26,19 @@ The app indicates that WP2 is now marked by adding the prefix @ to it's name. Th
|
|||
|
||||
### Waypoint JSON file
|
||||
|
||||
When the app is loaded from the app loader, a file named waypoints.json is loaded along with the javascript etc. The file has the following contents:
|
||||
When the app is loaded from the app loader, a file named `waypoints.json` is loaded along with the javascript etc. The file has the following contents:
|
||||
|
||||
~~~
|
||||
```
|
||||
[
|
||||
{
|
||||
"mark":0,
|
||||
"name":"NONE"
|
||||
},
|
||||
{
|
||||
"mark":1,
|
||||
"name":"No10",
|
||||
"lat":51.5032,
|
||||
"lon":-0.1269
|
||||
},
|
||||
{
|
||||
"mark":1,
|
||||
"name":"Stone",
|
||||
"lat":51.1788,
|
||||
"lon":-1.8260
|
||||
|
@ -52,15 +49,14 @@ When the app is loaded from the app loader, a file named waypoints.json is loade
|
|||
{ "name":"WP3" },
|
||||
{ "name":"WP4" }
|
||||
]
|
||||
~~~
|
||||
```
|
||||
|
||||
The file contains the initial NONE waypoint which is useful if you just want to display course and speed. The next two entries are waypoints to No 10 Downing Street and to Stone Henge - obtained from Google Maps. The last five entries are entries which can be *marked*.
|
||||
|
||||
You add and delete entries using the Web IDE to load and then save the file from and to watch storage. The app itself does not limit the number of entries although it does load the entire file into RAM which will obviously limit this.
|
||||
|
||||
I plan to release an accompanying watch app to edit waypoint files in the near future and a way to download your own waypoint file using the app loader.
|
||||
|
||||
|
||||
|
||||
### Waypoint Editor
|
||||
|
||||
Clicking on the download icon of gpsnav in the app loader invokes the waypoint editor. The editor downloads and displays the current `waypoints.json` file. Clicking the `Edit` button beside an entry causes the entry to be deleted from the list and displayed in the edit boxes. It can be restored - by clicking the `Add waypoint` button. A new markable entry is created by using the `Add name` button. The edited `waypoints.json` file is uploaded to the Bangle by clicking the `Upload` button.
|
||||
|
||||
*Please report bugs etc. by raising an issue [here](https://github.com/jeffmer/JeffsBangleAppsDev). *
|
|
@ -1,6 +1,7 @@
|
|||
const Yoff = 40;
|
||||
var pal2color = new Uint16Array([0x0000,0xffff,0x07ff,0xC618],0,2);
|
||||
var buf = Graphics.createArrayBuffer(240,50,2,{msb:true});
|
||||
var candraw = true;
|
||||
|
||||
function flip(b,y) {
|
||||
g.drawImage({width:240,height:50,bpp:2,buffer:b.buffer, palette:pal2color},0,y);
|
||||
|
@ -12,6 +13,7 @@ var wpindex=0;
|
|||
const labels = ["N","NE","E","SE","S","SW","W","NW"];
|
||||
|
||||
function drawCompass(course) {
|
||||
if (!candraw) return;
|
||||
buf.setColor(1);
|
||||
buf.setFont("Vector",16);
|
||||
var start = course-90;
|
||||
|
@ -143,7 +145,7 @@ function onGPS(fix) {
|
|||
speed = isNaN(fix.speed) ? speed : fix.speed;
|
||||
satellites = fix.satellites;
|
||||
}
|
||||
if (Bangle.isLCDOn()) {
|
||||
if (candraw) {
|
||||
if (fix!==undefined && fix.fix==1){
|
||||
dist = distance(fix,wp);
|
||||
if (isNaN(dist)) dist = 0;
|
||||
|
@ -156,28 +158,19 @@ function onGPS(fix) {
|
|||
|
||||
var intervalRef;
|
||||
|
||||
function clearTimers() {
|
||||
function stopdraw() {
|
||||
candraw=false;
|
||||
if(intervalRef) {clearInterval(intervalRef);}
|
||||
}
|
||||
|
||||
function startTimers() {
|
||||
candraw=true;
|
||||
intervalRefSec = setInterval(function() {
|
||||
newHeading(course,heading);
|
||||
if (course!=heading) drawCompass(heading);
|
||||
},200);
|
||||
}
|
||||
|
||||
Bangle.on('lcdPower',function(on) {
|
||||
if (on) {
|
||||
g.clear();
|
||||
Bangle.drawWidgets();
|
||||
startTimers();
|
||||
drawAll();
|
||||
}else {
|
||||
clearTimers();
|
||||
}
|
||||
});
|
||||
|
||||
function drawAll(){
|
||||
g.setColor(1,0.5,0.5);
|
||||
g.fillPoly([120,Yoff+50,110,Yoff+70,130,Yoff+70]);
|
||||
|
@ -186,6 +179,42 @@ function drawAll(){
|
|||
drawCompass(heading);
|
||||
}
|
||||
|
||||
function startdraw(){
|
||||
g.clear();
|
||||
Bangle.drawWidgets();
|
||||
startTimers();
|
||||
drawAll();
|
||||
}
|
||||
|
||||
function setButtons(){
|
||||
setWatch(nextwp.bind(null,-1), BTN1, {repeat:true,edge:"falling"});
|
||||
setWatch(doselect, BTN2, {repeat:true,edge:"falling"});
|
||||
setWatch(nextwp.bind(null,1), BTN3, {repeat:true,edge:"falling"});
|
||||
};
|
||||
|
||||
var SCREENACCESS = {
|
||||
withApp:true,
|
||||
request:function(){
|
||||
this.withApp=false;
|
||||
stopdraw();
|
||||
clearWatch();
|
||||
},
|
||||
release:function(){
|
||||
this.withApp=true;
|
||||
startdraw();
|
||||
setButtons();
|
||||
}
|
||||
}
|
||||
|
||||
Bangle.on('lcdPower',function(on) {
|
||||
if (!SCREENACCESS.withApp) return;
|
||||
if (on) {
|
||||
startdraw();
|
||||
} else {
|
||||
stopdraw();
|
||||
}
|
||||
});
|
||||
|
||||
var waypoints = require("Storage").readJSON("waypoints.json")||[{name:"NONE"}];
|
||||
wp=waypoints[0];
|
||||
|
||||
|
@ -199,8 +228,8 @@ function nextwp(inc){
|
|||
}
|
||||
|
||||
function doselect(){
|
||||
if (selected && waypoints[wpindex].mark===undefined && savedfix.fix) {
|
||||
waypoints[wpindex] ={mark:1, name:"@"+wp.name, lat:savedfix.lat, lon:savedfix.lon};
|
||||
if (selected && waypoints[wpindex].lat===undefined && savedfix.fix) {
|
||||
waypoints[wpindex] ={name:"@"+wp.name, lat:savedfix.lat, lon:savedfix.lon};
|
||||
wp = waypoints[wpindex];
|
||||
require("Storage").writeJSON("waypoints.json", waypoints);
|
||||
}
|
||||
|
@ -218,7 +247,4 @@ drawAll();
|
|||
startTimers();
|
||||
Bangle.on('GPS', onGPS);
|
||||
// Toggle selected
|
||||
setWatch(nextwp.bind(null,-1), BTN1, {repeat:true,edge:"falling"});
|
||||
setWatch(doselect, BTN2, {repeat:true,edge:"falling"});
|
||||
setWatch(nextwp.bind(null,1), BTN3, {repeat:true,edge:"falling"});
|
||||
|
||||
setButtons();
|
||||
|
|
|
@ -0,0 +1,170 @@
|
|||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="../../css/spectre.min.css">
|
||||
<link rel="stylesheet" href="../../css/spectre-icons.min.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h4>List of waypoints</h4>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Lat.</th>
|
||||
<th>Long.</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="waypoints">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<h4>Add a new waypoint</h4>
|
||||
<form id="add_waypoint_form">
|
||||
<div class="columns">
|
||||
<div class="column col-3 col-xs-8">
|
||||
<input class="form-input input-sm" type="text" id="add_waypoint_name" placeholder="Name">
|
||||
</div>
|
||||
<div class="column col-3 col-xs-8">
|
||||
<input class="form-input input-sm" value="0.0000" type="number" step="any" id="add_latitude" placeholder="Lat">
|
||||
</div>
|
||||
<div class="column col-3 col-xs-8">
|
||||
<input class="form-input input-sm" value="0.0000" type="number" step="any" id="add_longtitude" placeholder="Long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="columns">
|
||||
<div class="column col-3 col-xs-8">
|
||||
<button id="add_name_button" class="btn btn-primary btn-sm">Add Name Only</button>
|
||||
</div>
|
||||
<div class="column col-3 col-xs-8">
|
||||
<button id="add_waypoint_button" class="btn btn-primary btn-sm">Add Waypoint</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<br>
|
||||
<button id="Download" class="btn btn-error">Reload</button> <button id="Upload" class="btn btn-primary">Upload</button>
|
||||
|
||||
<script src="../../lib/interface.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
var waypoints = []
|
||||
|
||||
var $name = document.getElementById('add_waypoint_name')
|
||||
var $form = document.getElementById('add_waypoint_form')
|
||||
var $button = document.getElementById('add_waypoint_button')
|
||||
var $name_button = document.getElementById('add_name_button')
|
||||
var $latitude = document.getElementById('add_latitude')
|
||||
var $longtitude = document.getElementById('add_longtitude')
|
||||
var $list = document.getElementById('waypoints')
|
||||
|
||||
function compare(a, b){
|
||||
var x = a.name.toLowerCase();
|
||||
var y = b.name.toLowerCase();
|
||||
if (x=="none") {return -1};
|
||||
if (y=="none") {return 1};
|
||||
if (x < y) {return -1;}
|
||||
if (x > y) {return 1;}
|
||||
return 0;
|
||||
}
|
||||
|
||||
$button.addEventListener('click', event => {
|
||||
event.preventDefault()
|
||||
var name = $name.value.trim()
|
||||
if(!name) return;
|
||||
var lat = parseFloat($latitude.value).toPrecision(5);
|
||||
var lon = parseFloat($longtitude.value).toPrecision(5);
|
||||
|
||||
waypoints.push({
|
||||
name, lat,lon,
|
||||
});
|
||||
|
||||
waypoints.sort(compare);
|
||||
|
||||
renderWaypoints()
|
||||
$name.value = ''
|
||||
$latitude.value = (0).toPrecision(5);
|
||||
$longtitude.value = (0).toPrecision(5);
|
||||
});
|
||||
|
||||
$name_button.addEventListener('click', event => {
|
||||
event.preventDefault()
|
||||
var name = $name.value.trim()
|
||||
if(!name) return;
|
||||
|
||||
waypoints.push({
|
||||
name
|
||||
});
|
||||
waypoints.sort(compare);
|
||||
|
||||
renderWaypoints()
|
||||
$name.value = ''
|
||||
$latitude.value = 0.0000
|
||||
$longtitude.value = 0.0000
|
||||
});
|
||||
|
||||
|
||||
function removeWaypoint(index){
|
||||
$name.value = waypoints[index].name
|
||||
$latitude.value = waypoints[index].lat
|
||||
$longtitude.value = waypoints[index].lon
|
||||
waypoints = waypoints.filter((p,i) => i!==index)
|
||||
renderWaypoints()
|
||||
}
|
||||
|
||||
function renderWaypoints(){
|
||||
$list.innerHTML = ''
|
||||
waypoints.forEach((waypoint,index) => {
|
||||
var $waypoint = document.createElement('tr')
|
||||
if (index==0){
|
||||
$waypoint.innerHTML = `<td>${waypoint.name}</td>`
|
||||
} else if(waypoint.lat==undefined){
|
||||
$waypoint.innerHTML = `<td>${waypoint.name}</td><td>------</td><td>-----</td><td><button class="btn btn-action btn-primary" onclick="removeWaypoint(${index})"><i class="icon icon-edit"></i></button></td>`
|
||||
} else {
|
||||
$waypoint.innerHTML = `<td>${waypoint.name}</td><td>${waypoint.lat}</td><td>${waypoint.lon}</td><td><button class="btn btn-action btn-primary" onclick="removeWaypoint(${index})"><i class="icon icon-edit"></i></button></td>`
|
||||
}
|
||||
$list.appendChild($waypoint)
|
||||
})
|
||||
$name.focus()
|
||||
}
|
||||
|
||||
function downloadJSONfile(fileid, callback) {
|
||||
Puck.write(`\x10(function() {
|
||||
var pts = require("Storage").readJSON("${fileid}")||[{name:"NONE"}];
|
||||
Bluetooth.print(JSON.stringify(pts));
|
||||
})()\n`,contents=>{
|
||||
var storedpts = JSON.parse(contents);
|
||||
callback(storedpts);
|
||||
});
|
||||
}
|
||||
|
||||
function uploadFile(fileid, contents) {
|
||||
Puck.write(`\x10(function() {
|
||||
require("Storage").write("${fileid}",'${contents}');
|
||||
Bluetooth.print("OK");
|
||||
})()\n`,ret=>{
|
||||
console.log("uploadFile",ret);
|
||||
});
|
||||
}
|
||||
|
||||
function gotStored(pts){
|
||||
waypoints = pts;
|
||||
renderWaypoints();
|
||||
}
|
||||
|
||||
function onInit() {
|
||||
downloadJSONfile("waypoints.json", gotStored);
|
||||
}
|
||||
|
||||
document.getElementById("Download").addEventListener("click", function() {
|
||||
downloadJSONfile("waypoints.json", gotStored);
|
||||
});
|
||||
|
||||
document.getElementById("Upload").addEventListener("click", function() {
|
||||
var data = JSON.stringify(waypoints);
|
||||
uploadFile("waypoints.json",data);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,16 +1,13 @@
|
|||
[
|
||||
{
|
||||
"mark":0,
|
||||
"name":"NONE"
|
||||
},
|
||||
{
|
||||
"mark":1,
|
||||
"name":"No10",
|
||||
"lat":51.5032,
|
||||
"lon":-0.1269
|
||||
},
|
||||
{
|
||||
"mark":1,
|
||||
"name":"Stone",
|
||||
"lat":51.1788,
|
||||
"lon":-1.8260
|
||||
|
|
|
@ -4,4 +4,5 @@
|
|||
0.04: Fix hour alignment for single digits
|
||||
Scaling for background images <240px wide
|
||||
0.05: Fix memory/interval leak when LCD turns on
|
||||
0.06: Support 12 hour time
|
||||
0.06: Support 12 hour time
|
||||
0.07: Don't cut off wide date formats
|
|
@ -7,7 +7,7 @@ var is12Hour = (require("Storage").readJSON("setting.json",1)||{})["12hour"];
|
|||
var inf = require("Storage").readJSON("imgclock.face.json");
|
||||
var img = require("Storage").read("imgclock.face.img");
|
||||
var IX = inf.x, IY = inf.y, IBPP = inf.bpp;
|
||||
var IW = 110, IH = 45, OY = 24;
|
||||
var IW = 174, IH = 45, OY = 24;
|
||||
var bgwidth = img.charCodeAt(0);
|
||||
var bgoptions;
|
||||
if (bgwidth<240)
|
||||
|
@ -40,7 +40,7 @@ function draw() {
|
|||
new Uint8Array(cg.buffer).set(bgimg);
|
||||
// draw time
|
||||
cg.setColor(inf.col);
|
||||
var x = 40;
|
||||
var x = 74 + 32 * inf.align;
|
||||
cg.setFont("7x11Numeric7Seg",3);
|
||||
cg.setFontAlign(1,-1);
|
||||
cg.drawString(hours, x, 0);
|
||||
|
@ -54,8 +54,14 @@ function draw() {
|
|||
cg.drawString(("0"+t.getSeconds()).substr(-2), x, 20);
|
||||
cg.setFont("6x8",1);
|
||||
cg.drawString(meridian, x+2, 0);
|
||||
cg.setFontAlign(0,-1);
|
||||
cg.drawString(locale.date(t),IW/2,IH-8);
|
||||
let date = locale.date(t);
|
||||
if (cg.stringWidth(date) < IW-64) {
|
||||
cg.setFontAlign(0, -1);
|
||||
cg.drawString(date,IW/2+32*inf.align,IH-8);
|
||||
} else {
|
||||
cg.setFontAlign(inf.align, -1);
|
||||
cg.drawString(date,IW*(inf.align+1)/2,IH-8);
|
||||
}
|
||||
// draw to screen
|
||||
g.drawImage(cgimg,IX,IY+OY);
|
||||
}
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
|
||||
<script>
|
||||
var faces = [
|
||||
{ img:"122240.png", bpp : 8, x:120, y:20, col:"#FFFFFF", name:"Cityscape", attrib:"getwallpapers.com", attribLink:"http://getwallpapers.com/collection/8-bit-wallpaper", description:"" },
|
||||
{ img:"122271.png", bpp : 8, x:10, y:125, col:"#FFFFFF", name:"Sunset", attrib:"getwallpapers.com", attribLink:"http://getwallpapers.com/collection/8-bit-wallpaper", description:"" },
|
||||
{ img:"thisisfine.png", bpp : 8, x:85, y:5, col:"#000000", name:"This is fine.", attrib:"Gunshow #648", attribLink:"https://knowyourmeme.com/memes/this-is-fine", description:"" },
|
||||
{ img:"122240.png", bpp : 8, x:56, y:20, align: 1, col:"#FFFFFF", name:"Cityscape", attrib:"getwallpapers.com", attribLink:"http://getwallpapers.com/collection/8-bit-wallpaper", description:"" },
|
||||
{ img:"122271.png", bpp : 8, x:10, y:125, align: -1, col:"#FFFFFF", name:"Sunset", attrib:"getwallpapers.com", attribLink:"http://getwallpapers.com/collection/8-bit-wallpaper", description:"" },
|
||||
{ img:"thisisfine.png", bpp : 8, x:53, y:5, align: 0, col:"#000000", name:"This is fine.", attrib:"Gunshow #648", attribLink:"https://knowyourmeme.com/memes/this-is-fine", description:"" },
|
||||
];
|
||||
|
||||
document.querySelector(".columns").innerHTML = faces.map((face,facenumber)=>`
|
||||
|
@ -68,10 +68,10 @@
|
|||
<div class="form-group">
|
||||
<label class="form-label" for="customlocation">Clock location</label>
|
||||
<select class="form-select" id="customlocation">
|
||||
<option value="16,16">Top Left</option>
|
||||
<option value="114,16">Top Right</option>
|
||||
<option value="16,131">Bottom Left</option>
|
||||
<option value="114,131">Bottom Right</option>
|
||||
<option value="16,16,-1">Top Left</option>
|
||||
<option value="50,16,1">Top Right</option>
|
||||
<option value="16,131,-1">Bottom Left</option>
|
||||
<option value="50,131,1">Bottom Right</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -97,6 +97,7 @@
|
|||
face = {
|
||||
x : pos[0],
|
||||
y : pos[1],
|
||||
align: pos[2],
|
||||
bpp : document.getElementById('cusom16bit').checked ? 16 : 8,
|
||||
col : col
|
||||
};
|
||||
|
@ -107,6 +108,7 @@
|
|||
bpp : face.bpp,
|
||||
x : face.x,
|
||||
y : face.y,
|
||||
align : face.align,
|
||||
col : face.col
|
||||
};
|
||||
var imgMode = faceInfo.bpp==16 ? "rgb565" : "web";
|
||||
|
|
|
@ -81,7 +81,7 @@ var locales = {
|
|||
temperature: "°F",
|
||||
ampm: { 0: "am", 1: "pm" },
|
||||
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
|
||||
datePattern: { 0: "", 1: "%m/%d/%y" },
|
||||
datePattern: { 0: "%b %d, %Y", 1: "%m/%d/%y" },
|
||||
abmonth: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
|
||||
month: "January,February,March,April,May,June,July,August,September,October,November,December",
|
||||
abday: "Sun,Mon,Tue,Wed,Thu,Fri,Sat",
|
||||
|
@ -145,10 +145,10 @@ var locales = {
|
|||
"fr_FR": {
|
||||
lang: "fr_FR",
|
||||
decimal_point: ",",
|
||||
thousands_sep: ".",
|
||||
thousands_sep: " ",
|
||||
currency_symbol: "\x80",
|
||||
int_curr_symbol: "EUR",
|
||||
speed: "kmh",
|
||||
speed: "km/h",
|
||||
distance: { 0: "m", 1: "km" },
|
||||
temperature: "°C",
|
||||
ampm: { 0: "", 1: "" },
|
||||
|
@ -422,7 +422,7 @@ var locales = {
|
|||
temperature: "°C",
|
||||
ampm: { 0: "am", 1: "pm" },
|
||||
timePattern: { 0: "%HH:%MM:%SS ", 1: "%HH:%MM" },
|
||||
datePattern: { 0: "", 1: "%d/%m/%y" },
|
||||
datePattern: { 0: "%d %b %Y", 1: "%d/%m/%y" },
|
||||
abmonth: "Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez",
|
||||
month: "Janeiro,Fevereiro,Março,Abril,Maio,Junho,Julho,Agosto,Setembro,Outubro,Novembro,Dezembro",
|
||||
abday: "Dom,Seg,Ter,Qua,Qui,Sex,Sab",
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
0.01: Initial version
|
||||
0.02: Reset with gesture
|
||||
0.03: BTN2 to open launcher
|
||||
|
|
|
@ -111,6 +111,7 @@ function reset(value) {
|
|||
state = value === 0 ? "unset" : "set";
|
||||
}
|
||||
|
||||
setWatch(Bangle.showLauncher, BTN2, { repeat: false, edge: "falling" });
|
||||
function addWatch() {
|
||||
clearWatch();
|
||||
setWatch(changeState, BTN1, {
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
0.01: New Widget
|
||||
0.02: swipe left,right update
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
|
@ -0,0 +1,34 @@
|
|||
(() => {
|
||||
|
||||
var saved = null;
|
||||
|
||||
function hide(){
|
||||
if (!Bangle.isLCDOn() || saved) return;
|
||||
saved = [];
|
||||
for (var wd of WIDGETS) {
|
||||
saved.push(wd.draw);
|
||||
wd.draw=()=>{};
|
||||
}
|
||||
g.setColor(0,0,0);
|
||||
g.fillRect(0,0,239,23);
|
||||
}
|
||||
|
||||
function reveal(){
|
||||
if (!Bangle.isLCDOn() || !saved) return;
|
||||
for (var wd of WIDGETS) wd.draw = saved.shift();
|
||||
Bangle.drawWidgets();
|
||||
saved=null;
|
||||
}
|
||||
|
||||
function draw(){
|
||||
var img = E.toArrayBuffer(atob("GBgBAAAAAAAAAAAAAAAAAH4AAf+AB4HgDgBwHDw4OH4cMOcMYMMGYMMGMOcMOH4cHDw4DgBwB4HgAf+AAH4AAAAAAAAAAAAAAAAA"));
|
||||
g.setColor(0x07ff);
|
||||
g.drawImage(img,this.x,this.y);
|
||||
}
|
||||
|
||||
WIDGETS["viz"] ={area:"tl", width:24,draw:draw};
|
||||
|
||||
Bangle.on('swipe',(dir)=>{
|
||||
if (dir<0) hide(); else reveal();
|
||||
});
|
||||
})();
|
|
@ -1,5 +1,9 @@
|
|||
if (typeof btoa==="undefined")
|
||||
function btoa(d) { return Buffer.from(d).toString('base64'); }
|
||||
if (typeof btoa==="undefined") {
|
||||
// Don't define btoa as a function here because Apple's
|
||||
// iOS browser defines the function even though it's in
|
||||
// an IF statement that is never executed!
|
||||
btoa = function(d) { return BufferA.from(d).toString('base64'); }
|
||||
}
|
||||
|
||||
// Converts a string into most efficient way to send to Espruino (either json, base64, or compressed base64)
|
||||
function toJS(txt) {
|
||||
|
|
|
@ -24,8 +24,8 @@ httpGet("appdates.csv").then(csv=>{
|
|||
document.querySelector(".sort-nav").classList.remove("hidden");
|
||||
csv.split("\n").forEach(line=>{
|
||||
var l = line.split(",");
|
||||
appSortInfo[l[0]] = {
|
||||
created : Date.parse(l[1]),
|
||||
appSortInfo[l[0]] = {
|
||||
created : Date.parse(l[1]),
|
||||
modified : Date.parse(l[2])
|
||||
};
|
||||
});
|
||||
|
@ -196,7 +196,8 @@ function showTab(tabname) {
|
|||
|
||||
// =========================================== Library
|
||||
|
||||
var chips = Array.from(document.querySelectorAll('.filter-nav .chip')).map(chip => chip.attributes.filterid.value);
|
||||
// Can't use chip.attributes.filterid.value here because Safari/Apple's WebView doesn't handle it
|
||||
var chips = Array.from(document.querySelectorAll('.filter-nav .chip')).map(chip => chip.getAttribute("filterid"));
|
||||
var hash = window.location.hash ? window.location.hash.slice(1) : '';
|
||||
|
||||
var activeFilter = !!~chips.indexOf(hash) ? hash : '';
|
||||
|
|
Loading…
Reference in New Issue