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