refactor Infobox (own module)
This commit is contained in:
parent
648a8336d7
commit
5fb3cf5d20
6 changed files with 312 additions and 313 deletions
26
lib/infobox/link.js
Normal file
26
lib/infobox/link.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
define(function () {
|
||||
return function (config, el, gotoAnything, d) {
|
||||
var h2 = document.createElement("h2")
|
||||
a1 = document.createElement("a")
|
||||
a1.href = "#"
|
||||
a1.onclick = gotoAnything.node(d.source.node)
|
||||
a1.textContent = d.source.node.nodeinfo.hostname
|
||||
h2.appendChild(a1)
|
||||
h2.appendChild(document.createTextNode(" – "))
|
||||
a2 = document.createElement("a")
|
||||
a2.href = "#"
|
||||
a2.onclick = gotoAnything.node(d.target.node)
|
||||
a2.textContent = d.target.node.nodeinfo.hostname
|
||||
h2.appendChild(a2)
|
||||
el.appendChild(h2)
|
||||
|
||||
var attributes = document.createElement("table")
|
||||
attributes.classList.add("attributes")
|
||||
|
||||
attributeEntry(attributes, "TQ", showTq(d))
|
||||
attributeEntry(attributes, "Entfernung", showDistance(d))
|
||||
attributeEntry(attributes, "VPN", d.vpn ? "ja" : "nein")
|
||||
|
||||
el.appendChild(attributes)
|
||||
}
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue