Skip to content

Commit

Permalink
archotype issue located
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume-Levrier committed Sep 16, 2023
1 parent 6d49fd2 commit ba3becd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 9 additions & 2 deletions js/preload-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2932,18 +2932,25 @@ const archotype = (id) => {

if (resolver) {
node.style("cursor", d => d.domain ? "move" : "pointer")




node.on("click", (e, d) => (d.domain) ? 0 :
fetch(
`http://${resolver}/solr/netarchivebuilder/select?q=url:"${d.id}"`
`http://${resolver}/solr/netarchivebuilder/select?q=url:${JSON.stringify(d.id)}`
)
.then((r) => r.json())
.then((r) => {

console.log(`http://${resolver}/solr/netarchivebuilder/select?q=url:${JSON.stringify(d.id)}`)
console.log(r)

if (r.response.numFound > 0) {

var content = "";

const doc = r.response.docs[0]
const doc = r.response.docs[r.response.docs.length - 1]

for (const key in doc) {
content += `<div style="font-weight:bold">${key}</div><div>${doc[key]}</div><br>`
Expand Down
8 changes: 6 additions & 2 deletions js/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -776,18 +776,22 @@ const archotype = (id) => {

if (resolver) {
node.style("cursor", d => d.domain ? "move" : "pointer")

node.on("click", (e, d) => (d.domain) ? 0 :
fetch(
`http://${resolver}/solr/netarchivebuilder/select?q=url:"${d.id}"`
`http://${resolver}/solr/netarchivebuilder/select?q=url:${JSON.stringify(d.id)}`
)
.then((r) => r.json())
.then((r) => {

console.log(`http://${resolver}/solr/netarchivebuilder/select?q=url:${JSON.stringify(d.id)}`)
console.log(r)

if (r.response.numFound > 0) {

var content = "";

const doc = r.response.docs[0]
const doc = r.response.docs[r.response.docs.length - 1]

for (const key in doc) {
content += `<div style="font-weight:bold">${key}</div><div>${doc[key]}</div><br>`
Expand Down

0 comments on commit ba3becd

Please sign in to comment.