function getPubliSubDir(DOI) {
return DOI.split(".").join("/")
}
async function createPubliUI(publi,sets=new Map(),toolTips=false,abstract=false) {
const art = $(" ").addClass("publi")
art.className = "publi"
if (sets.has(publi.DOI) && sets.get(publi.DOI)!==null) {
$("").append($("
").text(sets.get(publi.DOI))).appendTo(art)
}
$(" ", {
href: publi.URL,
target: "_blank"
}).html($(" ").text(publi.title)).appendTo(art)
const authors = publi.author
const ulauthors = $("").addClass("authors-list").appendTo(art)
for (const author of authors) {
const liauth = $(" ").addClass("author-item")
const spanAuth = $(" ").text(String.raw`${author.given} ${author.family}`).appendTo(liauth)
var notifycontent = $("
").addClass("author-info")
$(" ").text(String.raw`${author.given} ${author.family}`).appendTo(notifycontent)
ulaff = $("").addClass("affiliation-list").appendTo(notifycontent)
for (const a of author.affiliation) {
$(" ").text(a.name).appendTo(ulaff)
}
if (author["authenticated-orcid"]) {
const html = String.raw``
notifycontent.append(html)
}
if (toolTips) {
tippy(spanAuth[0], {
content: notifycontent[0],
theme: 'light',
interactive: true,
});
}
ulauthors.append(liauth)
}
journaldiv = $("
").appendTo(art)
if ("container-title-short" in publi) {
var title_short = $(" ").text(publi["container-title-short"])
journaldiv.append(title_short)
if (toolTips) {
tippy(title_short[0], {
content: publi["container-title"],
theme: 'light',
});
}
}
else {
$(" ").text(publi["container-title"]).appendTo(journaldiv)
}
var date = pubUtils.getIssuedDate(publi)
journaldiv.append(" ")
$(" ").text(date.getFullYear().toString()).appendTo(journaldiv)
journaldiv.append(" ")
$(" ").text(publi.volume).appendTo(journaldiv)
if (publi.issue) {
$(" ").addClass("issue").text(publi.issue).appendTo(journaldiv)
journaldiv.append(", ")
$(" ").text(publi.page).appendTo(journaldiv)
}
$(" ", {
href: publi.URL,
target: "_blank"
}).text(String.raw`DOI: ${publi.DOI}`).appendTo(art)
$("
").append("Published on ").append($(" ", {
datetime: JSON.stringify(date)
}).text(date.toLocaleDateString("en-us", {
day: "numeric",
month: "short",
year: "numeric"
}))).appendTo(art)
if (abstract) {
const dir = "/data/publis/"+getPubliSubDir(publi.DOI)
var ab = $("",{id: "abstract",}).addClass("well").addClass("abstract")
var abfig =$("").addClass("picture")
abfig.appendTo(ab)
$(" ",{src:dir+"/picture.jpeg"}).appendTo(abfig)
var htmltxt =await getTextFromFileUrlAsync(dir+"/abstract.html")
abtxt=$("").html(htmltxt)
abtxt.appendTo(ab)
art.append(ab)
}
return art
}