diff --git a/Lora-Map/Lora-Map.csproj b/Lora-Map/Lora-Map.csproj index 96a0d02..4d0008f 100644 --- a/Lora-Map/Lora-Map.csproj +++ b/Lora-Map/Lora-Map.csproj @@ -111,6 +111,18 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/Lora-Map/resources/admin/css/global.css b/Lora-Map/resources/admin/css/global.css index ec50778..811945a 100644 --- a/Lora-Map/resources/admin/css/global.css +++ b/Lora-Map/resources/admin/css/global.css @@ -28,4 +28,49 @@ #content { margin-left: 210px; + border-left: 1px solid black; +} +#content #nameeditor .title { + margin-bottom: 20px; + font-weight: bold; +} +#content #nameeditor #nametable { + margin-left: 15px; + border-collapse: collapse; +} +#content #nameeditor #nametable thead { + background-color: rgba(0,0,0,0.2); +} +#content #nameeditor #nametable thead th { + text-align: left; +} +#content #nameeditor #nametable thead .rowid { + width: 60px; +} +#content #nameeditor #nametable thead .rowicon { + width: 65px; +} +#content #nameeditor #nametable thead .rowedit { + width: 50px; +} +#content #nameeditor #nametable thead .rowname { + width: 250px; +} +#content #nameeditor #nametable tbody tr:nth-child(odd) { + background-color: rgba(20,0,250,0.1); +} +#content #nameeditor #nametable tbody tr:nth-child(even) { + background-color: rgba(250,59,0,0.1); +} +#content #nameeditor #nametable tbody tr:hover { + background-color: rgba(0,0,0,0.1) !important; +} +#content #nameeditor #nametable tfoot { + background-color: rgba(0,0,0,0.1); +} +#content #nameeditor .pointer { + cursor: pointer; +} +#content #nameeditor #nametable tbody input.name { + width: 55px; } \ No newline at end of file diff --git a/Lora-Map/resources/admin/js/menu.js b/Lora-Map/resources/admin/js/menu.js index bce5b59..1dbeccb 100644 --- a/Lora-Map/resources/admin/js/menu.js +++ b/Lora-Map/resources/admin/js/menu.js @@ -2,7 +2,7 @@ var parsenames = new XMLHttpRequest(); parsenames.onreadystatechange = function() { if(parsenames.readyState === 4 && parsenames.status === 200) { - NamesEditor.parseJson(parsenames.responseText); + NamesEditor.ParseJson(parsenames.responseText); } }; parsenames.open("GET", "http://{%REQUEST_URL_HOST%}:8080/admin/get_json_names", true); @@ -22,19 +22,77 @@ function menu_import() { } var NamesEditor = { - parseJson: function (jsontext) { + ParseJson: function (jsontext) { document.getElementById("content").innerHTML = ""; var namesconfig = JSON.parse(jsontext); - var html = "
Einträge
"; + var html = "
Namenseinträge in den Einstellungen
"; + html += ""; + html += ""; for (var id in namesconfig) { if (namesconfig.hasOwnProperty(id)) { var nameentry = namesconfig[id]; - html += "
" + - "" + id + "" + - ""+nameentry["name"]+""+ - "
"; + html += "" + + "" + + ""; + if (nameentry.hasOwnProperty("marker.svg")) { + html += ""; + } else if (nameentry.hasOwnProperty("icon")) { + html += ""; + } else { + html += ""; + } + html += "" + + ""; } } - document.getElementById("content").innerHTML = html; + html += ""; + html += "
IDNameIcon
" + id + "" + nameentry["name"] + "" + this.ParseIcon(nameentry["marker.svg"]) + "kein Icon
"; + document.getElementById("content").innerHTML = html + "
"; + }, + ParseIcon: function (markerobj) { + var url = "../icons/marker/Marker.svg"; + if (markerobj.hasOwnProperty("person")) { + url += "?icon=person&marker-bg=hidden"; + if (markerobj["person"].hasOwnProperty("org")) { + url += "&person-org=" + markerobj["person"]["org"]; + } + if(markerobj["person"].hasOwnProperty("funct")) { + url += "&person-funct=" + markerobj["person"]["funct"]; + } + if(markerobj["person"].hasOwnProperty("rang")) { + url += "&person-rang=" + markerobj["person"]["rang"]; + } + if(markerobj["person"].hasOwnProperty("text")) { + url += "&person-text=" + markerobj["person"]["text"]; + } + } + return ""; + }, + Add: function () { + var newrow = document.createElement("tr"); + newrow.innerHTML = ""; + newrow.innerHTML += ""; + newrow.innerHTML += "wähle Icon"; + newrow.innerHTML += " "; + document.getElementById("nametable").children[1].appendChild(newrow); + }, + Save: function () { + alert("Save"); + }, + Delete: function (el) { + var name = el.firstChild.innerHTML; + var answ = window.prompt("Wollen sie den Eintrag für \"" + name + "\" wirklich löschen?", ""); + if (answ !== null) { + el.parentNode.removeChild(el); + } + }, + Edit: function (el) { + alert("Edit " + el); + }, + Abort: function (el) { + el.parentNode.removeChild(el); + }, + SaveRow: function (el) { + alert("Save Row"); } }; \ No newline at end of file diff --git a/Lora-Map/resources/icons/general/add.png b/Lora-Map/resources/icons/general/add.png new file mode 100644 index 0000000..6332fef Binary files /dev/null and b/Lora-Map/resources/icons/general/add.png differ diff --git a/Lora-Map/resources/icons/general/edit.png b/Lora-Map/resources/icons/general/edit.png new file mode 100644 index 0000000..0bfecd5 Binary files /dev/null and b/Lora-Map/resources/icons/general/edit.png differ diff --git a/Lora-Map/resources/icons/general/remove.png b/Lora-Map/resources/icons/general/remove.png new file mode 100644 index 0000000..08f2493 Binary files /dev/null and b/Lora-Map/resources/icons/general/remove.png differ diff --git a/Lora-Map/resources/icons/general/save.png b/Lora-Map/resources/icons/general/save.png new file mode 100644 index 0000000..99d532e Binary files /dev/null and b/Lora-Map/resources/icons/general/save.png differ diff --git a/Lora-Map/resources/index.html b/Lora-Map/resources/index.html index 302a257..996915a 100644 --- a/Lora-Map/resources/index.html +++ b/Lora-Map/resources/index.html @@ -32,6 +32,7 @@