handle node and link IDs with special characters
This commit is contained in:
parent
af3d22e4c2
commit
60d6f8921a
|
@ -9,10 +9,10 @@ define(function () {
|
|||
|
||||
if (d) {
|
||||
if ("node" in d)
|
||||
s += "n:" + d.node.nodeinfo.node_id
|
||||
s += "n:" + encodeURIComponent(d.node.nodeinfo.node_id)
|
||||
|
||||
if ("link" in d)
|
||||
s += "l:" + linkId(d.link)
|
||||
s += "l:" + encodeURIComponent(linkId(d.link))
|
||||
}
|
||||
|
||||
window.history.pushState(s, undefined, s)
|
||||
|
@ -51,19 +51,15 @@ define(function () {
|
|||
var args = s.slice(2).split(":")
|
||||
var id
|
||||
|
||||
if (args[0] === "n") {
|
||||
id = args[1]
|
||||
if (args[1] !== undefined) {
|
||||
id = decodeURIComponent(args[1])
|
||||
|
||||
if (id in objects.nodes) {
|
||||
if (args[0] === "n" && id in objects.nodes) {
|
||||
gotoNode(objects.nodes[id])
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
if (args[0] === "l") {
|
||||
id = args[1]
|
||||
|
||||
if (id in objects.links) {
|
||||
if (args[0] === "l" && id in objects.links) {
|
||||
gotoLink(objects.links[id])
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue