Skip to content
Snippets Groups Projects
Commit 0c5a7ce6 authored by Gervaise Henry's avatar Gervaise Henry :cowboy:
Browse files

Use thumbnail lookup json file

parent f221c7ce
Branches
Tags
2 merge requests!92Develop,!91Donor.thumbnails
This diff is collapsed.
......@@ -843,6 +843,7 @@
]
}
function tableData(repo, fitered) {
var thumbnails = {{ index .Site.Data.repository.thumbnails }}
let table = document.getElementById("samplesTable")
while (table.rows.length > 1) {
table.deleteRow(-1);
......@@ -857,19 +858,32 @@
var row_ag = newRow.insertCell(4)
var row_et = newRow.insertCell(5)
var thm_pr = document.createElement("img")
var thm_pr_file
var thm_bl = document.createElement("img")
var thm_bl_file
if (repo[i]["Disease Status"] == "Donor") {
var dis_status = "D"
} else {
var dis_status = repo[i]["Disease Status"]
}
thm_pr.src = "https://s3.us-east-2.amazonaws.com/biorepo.images.thumbnails/Pr/" + dis_status + ("000"+repo[i]["Study ID"]).slice(-3) + ".00.Pr.jpg"
for (j = 0; j < thumbnails.length; j++) {
if (thumbnails[j].patient == dis_status + ("000"+repo[i]["Study ID"]).slice(-3)) {
thm_pr_file = thumbnails[j].Pr
thm_pr.src = "https://s3.us-east-2.amazonaws.com/biorepo.images.thumbnails/jpg/Pr/" + thm_pr_file
thm_bl_file = thumbnails[j].Bl
thm_bl.src = "https://s3.us-east-2.amazonaws.com/biorepo.images.thumbnails/jpg/Bl/" + thm_bl_file
break
}
}
//thm_pr.src = "https://s3.us-east-2.amazonaws.com/biorepo.images.thumbnails/Pr/" + dis_status + ("000"+repo[i]["Study ID"]).slice(-3) + ".00.Pr.jpg"
thm_pr.height = "75"
row_he_pr.appendChild(thm_pr)
thm_pr.onerror=function(){
this.remove()
}
var thm_bl = document.createElement("img")
thm_bl.src = "https://s3.us-east-2.amazonaws.com/biorepo.images.thumbnails/Bl/" + dis_status + ("000"+repo[i]["Study ID"]).slice(-3) + ".00.Bl.jpg"
//thm_bl.src = "https://s3.us-east-2.amazonaws.com/biorepo.images.thumbnails/Bl/" + dis_status + ("000"+repo[i]["Study ID"]).slice(-3) + ".00.Bl.jpg"
thm_bl.height = "75"
row_he_bl.appendChild(thm_bl)
thm_bl.onerror=function(){
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment