From 25a7ecdd0789bf791dae0c5db0d8ea4771d35648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Thu, 13 Aug 2020 11:19:23 +0200 Subject: [PATCH 01/13] Upgrade tippy version --- layouts/partials/head_custom.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/layouts/partials/head_custom.html b/layouts/partials/head_custom.html index 45c2da90..7a467654 100644 --- a/layouts/partials/head_custom.html +++ b/layouts/partials/head_custom.html @@ -1,7 +1,8 @@ - - - + + + + + + {{< getDataFilesName >}}
-

Sets

+

Sets

-

Others

+

Others

\ No newline at end of file diff --git a/static/css/publi.css b/static/css/publi.css index 5ef68c6f..9bc7376c 100644 --- a/static/css/publi.css +++ b/static/css/publi.css @@ -1,7 +1,8 @@ -.publi h1 { - font-size: 22pt +.publiSet h1 { + font-size: 22PT; } -.publi h2 { + +.publi h1 { font-size: 20pt } diff --git a/static/data/publis/index.yaml b/static/data/publis/index.yaml index e671c6dc..c572bd26 100644 --- a/static/data/publis/index.yaml +++ b/static/data/publis/index.yaml @@ -1,7 +1,11 @@ sets: - 10.1021/acs.jctc.8b00406 : QUEST#1 - 10.1021/acs.jctc.8b01205 : QUEST#2 - 10.1021/acs.jctc.9b01216 : QUEST#3 - 10.1021/acs.jctc.0c00227 : QUEST#4 + QUEST#1: + - 10.1021/acs.jctc.8b00406 + QUEST#2: + - 10.1021/acs.jctc.8b01205 + QUEST#3: + - 10.1021/acs.jctc.9b01216 + QUEST#4: + - 10.1021/acs.jctc.0c00227 others: - 10.1021/acs.jpclett.0c00014 : \ No newline at end of file + - 10.1021/acs.jpclett.0c00014 diff --git a/static/js/PubliDB.js b/static/js/PubliDB.js new file mode 100644 index 00000000..4ab901e9 --- /dev/null +++ b/static/js/PubliDB.js @@ -0,0 +1,34 @@ +class publiDB { + static async loadAsync() { + var db = new publiDB + const text = await getTextFromFileUrlAsync("/data/publis/index.yaml") + const myYaml = jsyaml.load(text); + db.sets = ((myYaml.sets === null) ? new Map() : new Map(Object.entries(myYaml.sets))); + db.others = ((myYaml.others === null) ? new Map() : new Map(Object.entries(myYaml.others))); + return db + } + static get UnknowSetName() { + return "Unknow set" + } + findNameFromSet(set, supportUnknow = false) { + if (supportUnknow && JSON.stringify(set) === JSON.stringify([""])) { + return publiDB.UnknowSetName + } + for (let [setname, dois] of this.sets.entries()) { + if (JSON.stringify(set.sort()) === JSON.stringify(dois.sort())) { + return setname + } + } + return null + } + findSetNameFromDOI(doi, supportUnknow = false) { + for (let [setname, dois] of this.sets.entries()) { + if (dois.includes(doi)) + return setname + } + if (supportUnknow && doi === "") { + return UnknowSetName + } + return null + } +} \ No newline at end of file diff --git a/static/js/createPubliUI.js b/static/js/createPubliUI.js index f6e9ebc0..15f6d799 100644 --- a/static/js/createPubliUI.js +++ b/static/js/createPubliUI.js @@ -2,16 +2,13 @@ function getPubliSubDir(DOI) { return DOI.split(".").join("/") } -async function createPubliUI(publi,sets=new Map(),toolTips=false,abstract=false) { +async function createPubliUI(publi,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) + }).html($("

").text(publi.title)).appendTo(art) const authors = publi.author const ulauthors = $("