10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-11-03 20:53:59 +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,24 +25,38 @@ 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)
var sodois = new Set(odois)
if (sodois.has(null)) {
sodois.delete(null)
}
odois=Array.from(sodois)
const uoopublis = await PubliData.loadManyAsync(odois) const uoopublis = await PubliData.loadManyAsync(odois)
const opublis = uoopublis.sort((puba, pubb) => pubUtils.getIssuedDate(puba) - pubUtils.getIssuedDate(pubb)) const opublis = uoopublis.sort((puba, pubb) => pubUtils.getIssuedDate(puba) - pubUtils.getIssuedDate(pubb))
for (const publi of opublis) { 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 = await createPubliUI(publi, true, true)
$(art).appendTo("#publis_others") $(art).appendTo("#publis_review")
} }
processingIndicator.isActive = false processingIndicator.isActive = false
const hash=window.location.hash const hash=window.location.hash
@ -63,7 +77,12 @@ draft: false
<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
} }