From: Robert Kaiser Date: Fri, 20 Oct 2017 20:40:28 +0000 (+0200) Subject: add links for GPX downloads X-Git-Tag: production~32 X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=846a4dacf7230152237b1d42944196694695b5da;p=lantea.git add links for GPX downloads --- 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); } }