rename gotoAnything to router

This commit is contained in:
Nils Schneider 2015-03-25 19:45:21 +01:00
commit 265cb2e5eb
7 changed files with 39 additions and 39 deletions

View file

@ -1,15 +1,15 @@
define(function () {
return function (config, el, gotoAnything, d) {
return function (config, el, router, d) {
var h2 = document.createElement("h2")
a1 = document.createElement("a")
a1.href = "#"
a1.onclick = gotoAnything.node(d.source.node)
a1.onclick = router.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.onclick = router.node(d.target.node)
a2.textContent = d.target.node.nodeinfo.hostname
h2.appendChild(a2)
el.appendChild(h2)

View file

@ -1,5 +1,5 @@
define(["infobox/link", "infobox/node"], function (Link, Node) {
return function (config, sidebar, gotoAnything) {
return function (config, sidebar, router) {
var self = this
el = undefined
@ -22,7 +22,7 @@ define(["infobox/link", "infobox/node"], function (Link, Node) {
var closeButton = document.createElement("button")
closeButton.classList.add("close")
closeButton.onclick = gotoAnything.reset
closeButton.onclick = router.reset
el.appendChild(closeButton)
}
@ -30,12 +30,12 @@ define(["infobox/link", "infobox/node"], function (Link, Node) {
self.gotoNode = function (d) {
create()
new Node(config, el, gotoAnything, d)
new Node(config, el, router, d)
}
self.gotoLink = function (d) {
create()
new Link(config, el, gotoAnything, d)
new Link(config, el, router, d)
}
return self

View file

@ -1,5 +1,5 @@
define(function () {
return function(config, el, gotoAnything, d) {
return function(config, el, router, d) {
var h2 = document.createElement("h2")
h2.textContent = d.nodeinfo.hostname
var span = document.createElement("span")
@ -62,7 +62,7 @@ define(function () {
a1.classList.add("hostname")
a1.textContent = d.node.nodeinfo.hostname
a1.href = "#"
a1.onclick = gotoAnything.node(d.node)
a1.onclick = router.node(d.node)
td1.appendChild(a1)
if (d.link.vpn)
@ -81,7 +81,7 @@ define(function () {
var a2 = document.createElement("a")
a2.href = "#"
a2.textContent = showTq(d.link)
a2.onclick = gotoAnything.link(d.link)
a2.onclick = router.link(d.link)
td2.appendChild(a2)
tr.appendChild(td2)
@ -89,7 +89,7 @@ define(function () {
var a3 = document.createElement("a")
a3.href = "#"
a3.textContent = showDistance(d.link)
a3.onclick = gotoAnything.link(d.link)
a3.onclick = router.link(d.link)
td3.appendChild(a3)
td3.setAttribute("data-sort", d.link.distance !== undefined ? -d.link.distance : 1)
tr.appendChild(td3)