From 846a4dacf7230152237b1d42944196694695b5da Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Fri, 20 Oct 2017 22:40:28 +0200 Subject: [PATCH] add links for GPX downloads --- js/library.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/library.js b/js/library.js index 3d0c521..2130f02 100644 --- a/js/library.js +++ b/js/library.js @@ -24,8 +24,14 @@ function showLibrary() { else { for (var i = 0; i < aResult.length; i++) { var litem = document.createElement("li"); - litem.textContent = aResult[i]["time_created"] + " - " + aResult[i]["comment"] + - (aResult[i]["devicename"] ? " (" + aResult[i]["devicename"] + ")" : ""); + litem.textContent = aResult[i]["time_created"] + " - "; + var llink = document.createElement("a"); + llink.setAttribute("href", gBackendURL + "/track_gpx?id=" + aResult[i]["id"]); + llink.textContent = aResult[i]["comment"]; + litem.appendChild(llink); + if (aResult[i]["devicename"]) { + litem.appendChild(document.createTextNode(" (" + aResult[i]["devicename"] + ")")); + } tlist.appendChild(litem); } } -- 2.43.0