diff --git a/lib/about.js b/lib/about.js index 56fdbe3..045b3b9 100644 --- a/lib/about.js +++ b/lib/about.js @@ -3,42 +3,40 @@ define(function () { return function () { this.render = function (d) { - var s = "

Über Meshviewer

"; + d.innerHTML = "

Über Meshviewer

" + - s += "

Mit Doppelklick und Shift+Doppelklick kann man in der Karte "; - s += "auch zoomen.

"; + "

Mit Doppelklick und Shift+Doppelklick kann man in der Karte " + + "auch zoomen.

" + - s += "

AGPL 3

"; + "

AGPL 3

" + - s += "

Copyright (C) Milan Pässler

"; - s += "

Copyright (C) Nils Schneider

"; + "

Copyright (C) Milan Pässler

" + + "

Copyright (C) Nils Schneider

" + - s += "

This program is free software: you can redistribute it and/or "; - s += "modify it under the terms of the GNU Affero General Public "; - s += "License as published by the Free Software Foundation, either "; - s += "version 3 of the License, or (at your option) any later version.

"; + "

This program is free software: you can redistribute it and/or " + + "modify it under the terms of the GNU Affero General Public " + + "License as published by the Free Software Foundation, either " + + "version 3 of the License, or (at your option) any later version.

" + - s += "

This program is distributed in the hope that it will be useful, "; - s += "but WITHOUT ANY WARRANTY; without even the implied warranty of "; - s += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the "; - s += "GNU Affero General Public License for more details.

"; + "

This program is distributed in the hope that it will be useful, " + + "but WITHOUT ANY WARRANTY; without even the implied warranty of " + + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " + + "GNU Affero General Public License for more details.

" + - s += "

You should have received a copy of the GNU Affero General "; - s += "Public License along with this program. If not, see "; - s += ""; - s += "https://www.gnu.org/licenses/.

"; + "

You should have received a copy of the GNU Affero General " + + "Public License along with this program. If not, see " + + "" + + "https://www.gnu.org/licenses/.

" + - s += "

The source code is available at "; - s += ""; - s += "https://github.com/ffrgb/meshviewer."; + "

The source code is available at " + + "" + + "https://github.com/ffrgb/meshviewer." + - s += "

Forked and based on "; - s += ""; - s += "https://github.com/ffnord/meshviewer and "; - s += ""; - s += "https://github.com/plumpudding/hopglass.

"; - - d.innerHTML = s; + "

Forked and based on " + + "" + + "https://github.com/ffnord/meshviewer and " + + "" + + "https://github.com/plumpudding/hopglass.

"; }; }; }); diff --git a/lib/infobox/location.js b/lib/infobox/location.js index b4445c0..720b849 100644 --- a/lib/infobox/location.js +++ b/lib/infobox/location.js @@ -33,22 +33,6 @@ define(["helper"], function (helper) { el.appendChild(createBox("uci", "Uci", editUci)); - var linkPlain = document.createElement("a"); - linkPlain.textContent = "plain"; - linkPlain.onclick = function () { - switch2plain(); - return false; - }; - linkPlain.href = "#"; - - var linkUci = document.createElement("a"); - linkUci.textContent = "uci"; - linkUci.onclick = function () { - switch2uci(); - return false; - }; - linkUci.href = "#"; - function createBox(name, title, inputElem) { var box = document.createElement("div"); var heading = document.createElement("h3"); diff --git a/lib/infobox/node.js b/lib/infobox/node.js index b214cf1..a039751 100644 --- a/lib/infobox/node.js +++ b/lib/infobox/node.js @@ -9,7 +9,7 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"] return function (el) { var a = document.createElement("a"); - a.textContent = Number(d.nodeinfo.location.latitude.toFixed(6)) + ", " + Number(d.nodeinfo.location.longitude.toFixed(6)); + a.textContent = Number(d.nodeinfo.location.latitude.toFixed(6)) + ", " + Number(d.nodeinfo.location.longitude.toFixed(6)); a.href = "geo:" + d.nodeinfo.location.latitude + "," + d.nodeinfo.location.longitude; el.appendChild(a); }; diff --git a/lib/legend.js b/lib/legend.js index 20c0e97..37c2b1b 100644 --- a/lib/legend.js +++ b/lib/legend.js @@ -6,35 +6,11 @@ define(function () { self.render = function (el) { var p = document.createElement("p"); - p.setAttribute("class", "legend"); + p.classList.add("legend"); + p.innerHTML = ' Neuer Knoten' + + ' Knoten ist online' + + ' Knoten ist offline'; el.appendChild(p); - - var spanNew = document.createElement("span"); - spanNew.setAttribute("class", "legend-new"); - var symbolNew = document.createElement("span"); - symbolNew.setAttribute("class", "symbol"); - var textNew = document.createTextNode(" Neuer Knoten"); - spanNew.appendChild(symbolNew); - spanNew.appendChild(textNew); - p.appendChild(spanNew); - - var spanOnline = document.createElement("span"); - spanOnline.setAttribute("class", "legend-online"); - var symbolOnline = document.createElement("span"); - symbolOnline.setAttribute("class", "symbol"); - var textOnline = document.createTextNode(" Knoten ist online"); - spanOnline.appendChild(symbolOnline); - spanOnline.appendChild(textOnline); - p.appendChild(spanOnline); - - var spanOffline = document.createElement("span"); - spanOffline.setAttribute("class", "legend-offline"); - var symbolOffline = document.createElement("span"); - symbolOffline.setAttribute("class", "symbol"); - var textOffline = document.createTextNode(" Knoten ist offline"); - spanOffline.appendChild(symbolOffline); - spanOffline.appendChild(textOffline); - p.appendChild(spanOffline); }; return self; diff --git a/lib/map.js b/lib/map.js index 7ece165..da162f4 100644 --- a/lib/map.js +++ b/lib/map.js @@ -333,14 +333,14 @@ define(["map/clientlayer", "map/labelslayer", if (cssMode) { cssMode.parentNode.removeChild(cssMode); document.querySelector("html").className = ''; - labelsLayer.updateColor(); + labelsLayer.updateLayer(); } if (e.layer.options.mode) { document.querySelector("head").innerHTML += ""; document.querySelector("html").classList.add(e.layer.options.mode); var cssInterval = setInterval(function () { if (typeof document.querySelector(".css-mode").sheet.cssRules != 'undefined') { - labelsLayer.updateColor(); + labelsLayer.updateLayer(); clearInterval(cssInterval); } }, 10); diff --git a/lib/map/labelslayer.js b/lib/map/labelslayer.js index 4af87b3..f6fa95f 100644 --- a/lib/map/labelslayer.js +++ b/lib/map/labelslayer.js @@ -84,12 +84,10 @@ define(["leaflet", "rbush"], }, setData: function (d) { this.data = d; - if (this._map) { - this.prepareLabels(); - } + this.updateLayer(); }, - updateColor: function() { - if(this._map) { + updateLayer: function () { + if (this._map) { this.prepareLabels(); } }, @@ -108,7 +106,7 @@ define(["leaflet", "rbush"], var labelsOffline = d.offline.map(prepareLabel("rgba(212, 62, 42, 0.9)", 9, 5, false, 16)); var labelsNew = d.new.map(prepareLabel("rgba(48, 99, 20, 0.9)", 11, 8, true, 0)); var labelsLost = d.lost.map(prepareLabel("rgba(212, 62, 42, 0.9)", 11, 8, true, 0)); - labelShadow = bodyStyle.backgroundColor.replace(/rgb/i, "rgba").replace(/\)/i,',0.7)'); + labelShadow = bodyStyle.backgroundColor.replace(/rgb/i, "rgba").replace(/\)/i, ',0.7)'); var labels = [] .concat(labelsNew)