From 8f7b1e15ce4991f1b38d6d8ecb230f2c5b16d850 Mon Sep 17 00:00:00 2001 From: Milan Paessler Date: Mon, 4 Jul 2016 12:45:19 +0200 Subject: [PATCH] Revert "Router pics (#37)" This reverts commit 8435885e5c226836780b90d29e8478af228d98b2. --- helper.js | 7 +---- lib/infobox/node.js | 71 ++------------------------------------------- scss/_sidebar.scss | 40 ------------------------- scss/main.scss | 38 ------------------------ 4 files changed, 4 insertions(+), 152 deletions(-) diff --git a/helper.js b/helper.js index 5343980..a3aba8b 100644 --- a/helper.js +++ b/helper.js @@ -130,12 +130,7 @@ function attributeEntry(el, label, value) { var tr = document.createElement("tr") var th = document.createElement("th") - if (typeof label === "string") - th.textContent = label - - else - th.appendChild(label) - + th.textContent = label tr.appendChild(th) var td = document.createElement("td") diff --git a/lib/infobox/node.js b/lib/infobox/node.js index b5f0110..3b7dd6e 100644 --- a/lib/infobox/node.js +++ b/lib/infobox/node.js @@ -293,40 +293,6 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"], return au.enabled ? "aktiviert (" + au.branch + ")" : "deaktiviert" } - function showNodeImg(o, model) { - if (!model) - return undefined - - var content, caption - var modelhash = model.split("").reduce(function(a, b) { - a = ((a << 5) - a) + b.charCodeAt(0) - return a & a - }, 0) - - if (o.thumbnail) { - content = document.createElement("img") - content.id = "routerpicture" - 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") - document.getElementById("routerpicdiv").outerHTML = "Knotenname" - } - } - - if (o.caption) { - caption = o.caption.replace("{MODELHASH}", modelhash) - - if (!content) - content = document.createTextNode(caption) - } - - var p = document.createElement("p") - p.appendChild(content) - - return content -} - function showStatImg(o, d) { var subst = {} subst["{NODE_ID}"] = d.nodeinfo.node_id ? d.nodeinfo.node_id : "unknown" @@ -335,44 +301,13 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"], } return function(config, el, router, d) { - var top = document.createElement("div") - top.id = "routerpicdiv" - try { - if (config.hwImg) - config.hwImg.forEach(function(hwImg) { - try { - top.appendChild(showNodeImg(hwImg, d.nodeinfo.hardware.model)) - } - catch (err) { - console.log(err.message) - } - }) - - else - { - var localpic = [] // create fallback-config-data - localpic.push({ - thumbnail: "./nodes/{MODELHASH}.svg", - caption: "Knoten {MODELHASH}" - }) - localpic.forEach(function(localpic) { - try { - top.appendChild(showNodeImg(localpic, d.nodeinfo.hardware.model)) - } - catch (err) { - console.log(err.message) - } - }) - } - } - catch (err) { - console.log(err.message) - } + var h2 = document.createElement("h2") + h2.textContent = d.nodeinfo.hostname + el.appendChild(h2) var attributes = document.createElement("table") attributes.classList.add("attributes") - attributeEntry(attributes, top, d.nodeinfo.hostname) attributeEntry(attributes, "Status", showStatus(d)) attributeEntry(attributes, "Gateway", d.flags.gateway ? "ja" : null) attributeEntry(attributes, "Koordinaten", showGeoURI(d)) diff --git a/scss/_sidebar.scss b/scss/_sidebar.scss index 062d689..e69de29 100644 --- a/scss/_sidebar.scss +++ b/scss/_sidebar.scss @@ -1,40 +0,0 @@ -.nodeheader { - width: 90%; - position: relative; - z-index: 2; -} - -.nodeheader img { - width: 30%; - max-height: 180px; - margin: auto; - text-align: center; - max-width: 128px; - display: block; - z-index: 2; -} -.nodeheader img .none{ - display: none; -} - -.nodeheader span { - background-color: silver; - background-color: hsla(0, 0%, 100%, 0.5); - position: absolute; - bottom: 0; - width: 100%; - line-height: 1.5em; - text-align: center; - color: black; - font-weight: bold; - font-size: large; - z-index: 2; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.limit { - min-height: 1px; - max-height: 1px; -} diff --git a/scss/main.scss b/scss/main.scss index de63995..e290144 100644 --- a/scss/main.scss +++ b/scss/main.scss @@ -101,11 +101,6 @@ table th.sort-up:after { content: '\f104'; } -table.attributes { - top: 1px; - display: block; -} - table.attributes th { text-align: left; font-weight: bold; @@ -121,44 +116,11 @@ table.attributes td { line-height: 1.41em; } -table.attributes tr:first-child { - max-height: 128px; - max-width: 128px; - min-width: 128px; - min-height: 128px; - /*height: 128px;*/ - /*background-color: green;*/ -} - -table.attributes tr:first-child td{ - font-weight: bold; - /*background-color: red;*/ - font-size: large; - vertical-align:bottom; -} - -table.attributes tr:first-child th{ - font-weight: bold; - /*background-color: red;*/ - font-size: large; - vertical-align:bottom; -} - -.nodenamesidebar { - position: relative; - font-weight: bold; - /*background-color: red;*/ - font-size: large; - vertical-align:bottom; - bottom: 0px; -} - .sidebar { .infobox, .container { @include shadow(2); background: rgba(255, 255, 255, 0.97); border-radius: 2px; - padding-bottom: 30px; } .container.hidden {