waypoints fixes
- Do not register as type waypoint - show in launcher - Fixes for Bangle.js 1 - Fixes for not installed textinputmaster
parent
df78381823
commit
61804505d7
|
|
@ -8,7 +8,7 @@
|
|||
"tags": "tool,outdoors,gps",
|
||||
"supports": ["BANGLEJS","BANGLEJS2"],
|
||||
"readme": "README.md",
|
||||
"dependencies" : { "waypoints":"type" },
|
||||
"dependencies" : { "waypoints":"app" },
|
||||
"storage": [
|
||||
{"name":"gpsnav.app.js","url":"app.min.js","supports":["BANGLEJS"]},
|
||||
{"name":"gpsnav.app.js","url":"app_b2.js","supports":["BANGLEJS2"]},
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"tags": "tool,outdoors,gps",
|
||||
"supports": ["BANGLEJS2"],
|
||||
"readme": "README.md",
|
||||
"dependencies" : { "waypoints":"type" },
|
||||
"dependencies" : { "waypoints":"app" },
|
||||
"interface" : "interface.html",
|
||||
"storage": [
|
||||
{"name":"gpstrek.app.js","url":"app.js"},
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"tags": "tool,outdoors,gps",
|
||||
"supports": ["BANGLEJS"],
|
||||
"readme": "README.md",
|
||||
"dependencies" : { "waypoints":"type" },
|
||||
"dependencies" : { "waypoints":"app" },
|
||||
"storage": [
|
||||
{"name":"kitchen.app.js","url":"kitchen.app.js"},
|
||||
{"name":"stepo2.kit.js","url":"stepo2.kit.js"},
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"type": "app",
|
||||
"tags": "tool,outdoors",
|
||||
"supports": ["BANGLEJS","BANGLEJS2"],
|
||||
"dependencies" : { "waypoints":"type" },
|
||||
"dependencies" : { "waypoints":"app" },
|
||||
"readme": "README.md",
|
||||
"allow_emulator": true,
|
||||
"storage": [
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"type": "app",
|
||||
"tags": "tool,outdoors",
|
||||
"supports": ["BANGLEJS"],
|
||||
"dependencies" : { "waypoints":"type" },
|
||||
"dependencies" : { "waypoints":"app" },
|
||||
"readme": "README.md",
|
||||
"allow_emulator": true,
|
||||
"storage": [
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
"icon": "waypointer.png",
|
||||
"tags": "tool,outdoors,gps",
|
||||
"supports": ["BANGLEJS", "BANGLEJS2"],
|
||||
"dependencies" : { "waypoints":"type", "magnav" : "app" },
|
||||
"dependencies" : { "waypoints":"app", "magnav" : "app" },
|
||||
"readme": "README.md",
|
||||
"storage": [
|
||||
{"name":"waypointer.app.js","url":"app.js"},
|
||||
|
|
|
|||
|
|
@ -1,2 +1,4 @@
|
|||
0.01: New App!
|
||||
0.02: Merge waypoint_editor here, so waypoints can be edited on device, too.
|
||||
0.03: Do not register as type waypoint - show in launcher
|
||||
Fixes for Bangle.js 1 & not installed textinput
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
{ "id": "waypoints",
|
||||
"name": "Waypoints",
|
||||
"version":"0.02",
|
||||
"version":"0.03",
|
||||
"description": "Provides 'waypoints.json' used by various navigation apps, as well as a way to edit it from the App Loader or from the device",
|
||||
"icon": "app.png",
|
||||
"tags": "tool,outdoors,gps",
|
||||
"type": "waypoints",
|
||||
"supports" : ["BANGLEJS","BANGLEJS2"],
|
||||
"readme": "README.md",
|
||||
"interface": "interface.html",
|
||||
|
|
|
|||
|
|
@ -23,20 +23,27 @@ function writeWP() {
|
|||
}
|
||||
|
||||
function mainMenu() {
|
||||
let textInputInstalled = true;
|
||||
try {
|
||||
require("textinput")
|
||||
} catch(err) {
|
||||
textInputInstalled = false;
|
||||
}
|
||||
var menu = {
|
||||
"< Back" : Bangle.load
|
||||
"< Back" : () => load()
|
||||
};
|
||||
if (Object.keys(wp).length==0) {
|
||||
//Object.assign(menu, {"NO WPs":""});
|
||||
print("(no waypoints)");
|
||||
} else for (let id in wp) {
|
||||
for (let id in wp) {
|
||||
let i = id;
|
||||
menu[wp[id]["name"]]=()=>{ show(i); };
|
||||
}
|
||||
menu["Add"]=addCard;
|
||||
if (textInputInstalled) {
|
||||
menu["Add"]=addCard;
|
||||
}
|
||||
menu["Remove"]=removeCard;
|
||||
menu["Format"]=setFormat;
|
||||
menu["Mark GPS"]=markGps;
|
||||
if (textInputInstalled) {
|
||||
menu["Mark GPS"]=markGps;
|
||||
}
|
||||
g.clear();
|
||||
E.showMenu(menu);
|
||||
}
|
||||
|
|
@ -153,16 +160,14 @@ function lon(x) {
|
|||
}
|
||||
|
||||
function show(pin) {
|
||||
print(pin);
|
||||
var i = wp[pin];
|
||||
var l = i["name"] + "\n" + lat(i["lat"]) + "\n" + lon(i["lon"]);
|
||||
var la = new Layout ({
|
||||
type:"v", c: [
|
||||
{type:"txt", font:"10%", pad:1, fillx:1, filly:1, label: l},
|
||||
{type:"btn", font:"10%", pad:1, fillx:1, filly:1, label:"OK", cb:l=>{mainMenu();}}
|
||||
], lazy:true});
|
||||
g.clear();
|
||||
la.render();
|
||||
var l = lat(i["lat"]) + "\n" + lon(i["lon"]);
|
||||
E.showPrompt(l,{
|
||||
title:i["name"],
|
||||
buttons : {"Ok":true}
|
||||
}).then(function(v) {
|
||||
mainMenu();
|
||||
});
|
||||
}
|
||||
|
||||
function showNumpad(text, key_, callback) {
|
||||
|
|
@ -231,22 +236,17 @@ function removeCard() {
|
|||
wp.forEach((val, card) => {
|
||||
const name = wp[card].name;
|
||||
menu[name]=()=>{
|
||||
E.showMenu();
|
||||
var confirmRemove = new Layout (
|
||||
{type:"v", c: [
|
||||
{type:"txt", font:"15%", pad:1, fillx:1, filly:1, label:"Delete"},
|
||||
{type:"txt", font:"15%", pad:1, fillx:1, filly:1, label:name},
|
||||
{type:"h", c: [
|
||||
{type:"btn", font:"15%", pad:1, fillx:1, filly:1, label: "YES", cb:l=>{
|
||||
wp.splice(card, 1);
|
||||
writeWP();
|
||||
mainMenu();
|
||||
}},
|
||||
{type:"btn", font:"15%", pad:1, fillx:1, filly:1, label: " NO", cb:l=>{mainMenu();}}
|
||||
]}
|
||||
], lazy:true});
|
||||
g.clear();
|
||||
confirmRemove.render();
|
||||
E.showPrompt(name,{
|
||||
title:"Delete",
|
||||
}).then(function(v) {
|
||||
if (v) {
|
||||
wp.splice(card, 1);
|
||||
writeWP();
|
||||
mainMenu();
|
||||
} else {
|
||||
mainMenu();
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
@ -345,5 +345,4 @@ function addCard() {
|
|||
}
|
||||
|
||||
g.reset();
|
||||
Bangle.setUI();
|
||||
mainMenu();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
"supports": ["BANGLEJS","BANGLEJS2"],
|
||||
"screenshots": [{"url":"screenshot.png"},{"url":"screenshot-menu.png"},{"url":"screenshot-delete.png"}],
|
||||
"readme": "README.md",
|
||||
"dependencies" : { "waypoints":"type" },
|
||||
"dependencies" : { "waypoints":"app" },
|
||||
"storage": [
|
||||
{"name":"wpmoto.app.js","url":"app.js"},
|
||||
{"name":"wpmoto.img","url":"icon.js","evaluate":true}
|
||||
|
|
|
|||
Loading…
Reference in New Issue