From 28eacf8a795124fc82b49bf9cdc1c0600977e553 Mon Sep 17 00:00:00 2001 From: Milan Pssler Date: Mon, 4 Jul 2016 11:54:07 +0200 Subject: [PATCH] router-pics: some indention and cosmetic fixes --- lib/infobox/node.js | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/lib/infobox/node.js b/lib/infobox/node.js index b5f0110..7f4c384 100644 --- a/lib/infobox/node.js +++ b/lib/infobox/node.js @@ -192,13 +192,11 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"], var bar = document.createElement("span") if (v >= 1) { - bar.style.width = ((v * 100) % 100) + "%" - bar.style.background = "rgba(255, 50, 50, 0.9)" - span.style.background = "rgba(255, 50, 50, 0.6)" - span.appendChild(bar) - } - else - { + bar.style.width = ((v * 100) % 100) + "%" + bar.style.background = "rgba(255, 50, 50, 0.9)" + span.style.background = "rgba(255, 50, 50, 0.6)" + span.appendChild(bar) + } else { bar.style.width = (v * 100) + "%" span.appendChild(bar) } @@ -309,7 +307,7 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"], content.classList.add("nodeImg") content.src = o.thumbnail.replace("{MODELHASH}", modelhash) content.onerror = function() { - console.log("Router-Bild nicht vorhanden !!! create an issue @ https://github.com/Moorviper/Freifunk-Router-Anleitungen/issues") + console.log("picture not found - if you have configured router pictures create an issue at https://github.com/Moorviper/meshviewer_hwpics/issues") document.getElementById("routerpicdiv").outerHTML = "Knotenname" } } @@ -325,7 +323,7 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"], p.appendChild(content) return content -} + } function showStatImg(o, d) { var subst = {} @@ -342,14 +340,11 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"], config.hwImg.forEach(function(hwImg) { try { top.appendChild(showNodeImg(hwImg, d.nodeinfo.hardware.model)) - } - catch (err) { + } catch (err) { console.log(err.message) } }) - - else - { + else { var localpic = [] // create fallback-config-data localpic.push({ thumbnail: "./nodes/{MODELHASH}.svg", @@ -358,14 +353,12 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"], localpic.forEach(function(localpic) { try { top.appendChild(showNodeImg(localpic, d.nodeinfo.hardware.model)) - } - catch (err) { + } catch (err) { console.log(err.message) } }) } - } - catch (err) { + } catch (err) { console.log(err.message) }