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

View File

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

View File

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