10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-24 13:23:40 +01:00

Proposition of a new references page (#5)

* Fix broken link

* Fix bug in indexDB

* Proposition of a new references page

Co-authored-by: Mickaël Véril <mveril@irsamc.ups-tlse.fr>
This commit is contained in:
mveril 2020-12-07 11:11:09 +01:00 committed by GitHub
parent c0cc26d1f5
commit 563726c954
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 28 deletions

View File

@ -25,45 +25,64 @@ draft: false
const setsSec = $('#publis_sets')
var myDB = await indexDB.loadAsync()
const sets = myDB.sets
for (const [setName,publis] of sets) {
const uopublis = await PubliData.loadManyAsync(publis)
if (uopublis.length !== 0) {
var odois=[]
for (const [setName,dois] of sets) {
if (dois.length !== 0) {
odois = odois.concat(dois.slice(1))
const mySetSec = $('<section>').addClass('publiSet').attr("data-setName", setName).attr("id",setName).appendTo(setsSec)
$("<h1>").text(setName).appendTo(mySetSec)
const spublis = uopublis.sort((puba, pubb) => pubUtils.getIssuedDate(puba) - pubUtils.getIssuedDate(pubb))
for (const publi of spublis) {
const doi = dois[0]
if (doi!==null) {
publi = await PubliData.loadAsync(doi)
const art = await createPubliUI(publi, true, true)
$(art).appendTo(mySetSec)
$(art).appendTo(mySetSec)
}
}
}
odois = odois.concat(myDB.others)
var sodois = new Set(odois)
if (sodois.has(null)) {
sodois.delete(null)
}
odois=Array.from(sodois)
const uoopublis = await PubliData.loadManyAsync(odois)
const opublis = uoopublis.sort((puba, pubb) => pubUtils.getIssuedDate(puba) - pubUtils.getIssuedDate(pubb))
for (const publi of opublis) {
const art = await createPubliUI(publi, true, false)
$(art).appendTo("#publis_other")
}
const rdois = myDB.reviews
const uorpublis = await PubliData.loadManyAsync(rdois)
const rpublis = uorpublis.sort((puba, pubb) => pubUtils.getIssuedDate(puba) - pubUtils.getIssuedDate(pubb))
for (const publi of rpublis) {
art = await createPubliUI(publi, true, true)
$(art).appendTo("#publis_review")
}
processingIndicator.isActive = false
const hash=window.location.hash
if (hash.length>1 && hash.startsWith("#")) {
sec=document.getElementById(decodeURIComponent(hash.substring(1)))
if (sec) {
sec.scrollIntoView({
block: 'start',
behavior: 'smooth',
inline: 'nearest'
})
}
}
}
const odois = myDB.others
const uoopublis = await PubliData.loadManyAsync(odois)
const opublis = uoopublis.sort((puba, pubb) => pubUtils.getIssuedDate(puba) - pubUtils.getIssuedDate(pubb))
for (const publi of opublis) {
art = await createPubliUI(publi, true, true)
$(art).appendTo("#publis_others")
}
processingIndicator.isActive = false
const hash=window.location.hash
if (hash.length>1 && hash.startsWith("#")) {
sec=document.getElementById(decodeURIComponent(hash.substring(1)))
if (sec) {
sec.scrollIntoView({
block: 'start',
behavior: 'smooth',
inline: 'nearest'
})
}
}
}
</script>
<section class="publis-list" id="publis_sets">
<header>
<h1>The QUEST subsets</h2>
</header>
</section>
<section class="publis" id="publis_others">
<section class="publis-list" id="publis_other">
<header>
<h1>Other publications using QUEST</h2>
</header>
</section>
<section class="publis" id="publis_review">
<header>
<h1>Review articles about QUEST</h2>
</header>

View File

@ -14,5 +14,5 @@ sets:
- null
QUEST#5:
- null
others:
reviews:
- 10.1021/acs.jpclett.0c00014

View File

@ -10,6 +10,7 @@ class indexDB {
const myYaml = jsyaml.load(text);
db.sets = ((myYaml.sets === undefined) ? new Map() : new Map(Object.entries(myYaml.sets)));
db.others = ((myYaml.others === undefined) ? [] : Array.from(myYaml.others));
db.reviews = ((myYaml.reviews === undefined) ? [] : Array.from(myYaml.reviews));
window.indexDB=db
return db
}