diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..8fe2356 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Change Log + +## v2 + +### General changes: + +- License change from GPL 3 to AGPL 3 + +### Implemented enhancements: + +- Improved performance on Firefox +- Labels in graph view +- infobox: link to geouri with node's coordinates + +### Fixed bugs: + +- Links disappeared on graph on refresh diff --git a/README.md b/README.md index e33791f..0f51d04 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,9 @@ Meshviewer is a frontend for [ffmap-backend](https://github.com/ffnord/ffmap-backend). + +[Changelog](CHANGELOG.md) + # Screenshots ![](doc/mapview.png?raw=true) diff --git a/lib/infobox/node.js b/lib/infobox/node.js index 57502d9..759f132 100644 --- a/lib/infobox/node.js +++ b/lib/infobox/node.js @@ -1,4 +1,41 @@ -define(["moment", "tablesort", "tablesort.numeric"], function (moment, Tablesort) { +define(["moment", "numeral", "tablesort", "tablesort.numeric"], + function (moment, numeral, Tablesort) { + function showGeoURI(d) { + function showLatitude(d) { + var suffix = Math.sign(d) > -1 ? "' N" : "' S" + d = Math.abs(d) + var a = Math.floor(d) + var min = (d * 60) % 60 + a = (a < 10 ? "0" : "") + a + + return a + "° " + numeral(min).format("0.000") + suffix + } + + function showLongitude(d) { + var suffix = Math.sign(d) > -1 ? "' E" : "' W" + d = Math.abs(d) + var a = Math.floor(d) + var min = (d * 60) % 60 + a = (a < 100 ? "0" + (a < 10 ? "0" : "") : "") + a + + return a + "° " + numeral(min).format("0.000") + suffix + } + + if (!has_location(d)) + return undefined + + return function (el) { + var latitude = d.nodeinfo.location.latitude + var longitude = d.nodeinfo.location.longitude + var a = document.createElement("a") + a.textContent = showLatitude(latitude) + " " + + showLongitude(longitude) + + a.href = "geo:" + latitude + "," + longitude + el.appendChild(a) + } + } + function showFirmware(d) { var release = dictGet(d.nodeinfo, ["software", "firmware", "release"]) var base = dictGet(d.nodeinfo, ["software", "firmware", "base"]) @@ -109,7 +146,7 @@ define(["moment", "tablesort", "tablesort.numeric"], function (moment, Tablesort attributes.classList.add("attributes") attributeEntry(attributes, "Gateway", d.flags.gateway ? "ja" : null) - attributeEntry(attributes, "In der Karte", has_location(d) ? "ja" : "nein") + attributeEntry(attributes, "Koordinaten", showGeoURI(d)) if (config.showContact) attributeEntry(attributes, "Kontakt", dictGet(d.nodeinfo, ["owner", "contact"]))