mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-08-26 06:01:49 +02:00
rename journalpar to journaldiv to reflet element type and add journal full name as tooltip
This commit is contained in:
parent
521e085290
commit
d76d9217da
@ -14,34 +14,34 @@ draft: false
|
|||||||
{{< getDataFilesName >}}
|
{{< getDataFilesName >}}
|
||||||
<script>
|
<script>
|
||||||
window.onload = async function () {
|
window.onload = async function () {
|
||||||
var div=document.getElementById("papers_div")
|
var div = document.getElementById("papers_div")
|
||||||
const Cite = require("citation-js")
|
const Cite = require("citation-js")
|
||||||
const dois =uniq(Object.values(await loadAllData()).flat().map(d => d.DOI.string))
|
const dois = uniq(Object.values(await loadAllData()).flat().map(d => d.DOI.string))
|
||||||
const publiscite = await Cite.async(dois)
|
const publiscite = await Cite.async(dois)
|
||||||
const publis=publiscite.format('data', {format: 'object'})
|
const publis = publiscite.format('data', { format: 'object' })
|
||||||
for (const publi of publis){
|
for (const publi of publis) {
|
||||||
const art=$("<article/>").addClass("paper")
|
const art = $("<article/>").addClass("paper")
|
||||||
art.className="paper"
|
art.className = "paper"
|
||||||
$("<a/>",{
|
$("<a/>", {
|
||||||
href:publi.URL,
|
href: publi.URL,
|
||||||
target:"_blank"
|
target: "_blank"
|
||||||
}).html($("<h1/>").text(publi.title)).appendTo(art)
|
}).html($("<h1/>").text(publi.title)).appendTo(art)
|
||||||
const authors=publi.author
|
const authors = publi.author
|
||||||
const ulauthors=$("<ul/>").addClass("authors-list").appendTo(art)
|
const ulauthors = $("<ul/>").addClass("authors-list").appendTo(art)
|
||||||
for(const author of authors){
|
for (const author of authors) {
|
||||||
const liauth=$("<li/>").addClass("author-item")
|
const liauth = $("<li/>").addClass("author-item")
|
||||||
const spanAuth=$("<span/>").text(String.raw`${author.given} ${author.family}`).appendTo(liauth)
|
const spanAuth = $("<span/>").text(String.raw`${author.given} ${author.family}`).appendTo(liauth)
|
||||||
if(author.sequence==="first"){
|
if (author.sequence === "first") {
|
||||||
$(spanAuth).after($("<strong/>").text("*"))
|
$(spanAuth).after($("<strong/>").text("*"))
|
||||||
}
|
}
|
||||||
var notifycontent=$("<div/>").addClass("author-info")
|
var notifycontent = $("<div/>").addClass("author-info")
|
||||||
$("<h1/>").text(String.raw`${author.given} ${author.family}`).appendTo(notifycontent)
|
$("<h1/>").text(String.raw`${author.given} ${author.family}`).appendTo(notifycontent)
|
||||||
ulaff=$("<ul/>").addClass("affiliation-list").appendTo(notifycontent)
|
ulaff = $("<ul/>").addClass("affiliation-list").appendTo(notifycontent)
|
||||||
for(const a of author.affiliation){
|
for (const a of author.affiliation) {
|
||||||
$("<li/>").text(a.name).appendTo(ulaff)
|
$("<li/>").text(a.name).appendTo(ulaff)
|
||||||
}
|
}
|
||||||
if(author["authenticated-orcid"]){
|
if (author["authenticated-orcid"]) {
|
||||||
const html=String.raw`<div class="orcid-id"><a href="https://orcid.org" target="_blank"><img alt="ORCID logo" src="https://orcid.org/sites/default/files/images/orcid_16x16.png" width="16" height="16"/></a> <a href="${author.ORCID}" target="_blank">${author.ORCID} </a></div>`
|
const html = String.raw`<div class="orcid-id"><a href="https://orcid.org" target="_blank"><img alt="ORCID logo" src="https://orcid.org/sites/default/files/images/orcid_16x16.png" width="16" height="16"/></a> <a href="${author.ORCID}" target="_blank">${author.ORCID} </a></div>`
|
||||||
notifycontent.append(html)
|
notifycontent.append(html)
|
||||||
}
|
}
|
||||||
tippy(spanAuth[0], {
|
tippy(spanAuth[0], {
|
||||||
@ -51,26 +51,36 @@ draft: false
|
|||||||
});
|
});
|
||||||
ulauthors.append(liauth)
|
ulauthors.append(liauth)
|
||||||
}
|
}
|
||||||
journalpar=$("<div/>").appendTo(art)
|
journaldiv = $("<div/>").appendTo(art)
|
||||||
$("<span/>").text((("container-title-short" in publi) ? publi["container-title-short"] : publi["container-title"])).appendTo(journalpar)
|
if ("container-title-short" in publi) {
|
||||||
var datArr=publi.issued["date-parts"][0]
|
var title_short=$("<span/>").text(publi["container-title-short"])
|
||||||
var date=new Date(datArr[0],datArr[1]-1,datArr[2])
|
journaldiv.append(title_short)
|
||||||
$("<span/>").text(date.getFullYear().toString()).appendTo(journalpar)
|
tippy(title_short[0], {
|
||||||
journalpar.append(" ")
|
content: publi["container-title"],
|
||||||
$("<span/>").text(publi.volume).appendTo(journalpar)
|
theme: 'light',
|
||||||
$("<span/>").addClass("issue").text(publi.issue).appendTo(journalpar)
|
});
|
||||||
journalpar.append(", ")
|
}
|
||||||
$("<span/>").text(publi.page).appendTo(journalpar)
|
else {
|
||||||
$("<a/>",{
|
$("<span/>").text(publi["container-title"]).appendTo(journaldiv)
|
||||||
href:publi.URL,
|
}
|
||||||
target:"_blank"
|
var datArr = publi.issued["date-parts"][0]
|
||||||
|
var date = new Date(datArr[0], datArr[1] - 1, datArr[2])
|
||||||
|
$("<span/>").text(date.getFullYear().toString()).appendTo(journaldiv)
|
||||||
|
journaldiv.append(" ")
|
||||||
|
$("<span/>").text(publi.volume).appendTo(journaldiv)
|
||||||
|
$("<span/>").addClass("issue").text(publi.issue).appendTo(journaldiv)
|
||||||
|
journaldiv.append(", ")
|
||||||
|
$("<span/>").text(publi.page).appendTo(journaldiv)
|
||||||
|
$("<a/>", {
|
||||||
|
href: publi.URL,
|
||||||
|
target: "_blank"
|
||||||
}).text(String.raw`DOI: ${publi.DOI}`).appendTo(art)
|
}).text(String.raw`DOI: ${publi.DOI}`).appendTo(art)
|
||||||
$("<p/>").append("Published on ").append($("<time/>",{
|
$("<p/>").append("Published on ").append($("<time/>", {
|
||||||
datetime:JSON.stringify(date)
|
datetime: JSON.stringify(date)
|
||||||
}).text(date.toLocaleDateString("en-us",{
|
}).text(date.toLocaleDateString("en-us", {
|
||||||
day:"numeric",
|
day: "numeric",
|
||||||
month:"short",
|
month: "short",
|
||||||
year:"numeric"
|
year: "numeric"
|
||||||
}))).appendTo(art)
|
}))).appendTo(art)
|
||||||
$(art).appendTo("<li/>").appendTo("#papers_ul")
|
$(art).appendTo("<li/>").appendTo("#papers_ul")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user