[] wp_editor: reindent, minor cleanups.

master
Pavel Machek 2023-11-03 21:56:10 +01:00
parent 73375ebe96
commit dbde4923c6
1 changed files with 42 additions and 45 deletions

View File

@ -31,7 +31,7 @@ function mainMenu() {
print("(no waypoints)");
} else for (let id in wp) {
let i = id;
menu[wp[id]["name"]]=()=>{ decode(i); };
menu[wp[id]["name"]]=()=>{ show(i); };
}
menu["Add"]=addCard;
menu["Remove"]=removeCard;
@ -134,7 +134,6 @@ function format(x) {
return "" + d + " " + mf + "'" + s + '"';
}
}
function lat(x) {
c = "N";
if (x<0) {
@ -143,7 +142,6 @@ function lat(x) {
}
return c+format(x);
}
function lon(x) {
c = "E";
if (x<0) {
@ -153,7 +151,7 @@ function lon(x) {
return c+format(x);
}
function decode(pin) {
function show(pin) {
print(pin);
var i = wp[pin];
var l = i["name"] + "\n" + lat(i["lat"]) + "\n" + lon(i["lon"]);
@ -346,7 +344,6 @@ function addCard() {
});
}
g.reset();
Bangle.setUI();
mainMenu();