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

Add support for Supporting info (SI)

This commit is contained in:
Mickaël Véril 2020-01-08 11:02:15 +01:00
parent 68eac5baf5
commit f60e0ffa91
2 changed files with 28 additions and 7 deletions

View File

@ -119,8 +119,12 @@ draft: false
var op = $("<option/>", {
value: JSON.stringify(val)
})
if ($(this).attr("name") == "DOI" && sets.has(val.toString())) {
$(op).text(sets.get(val.toString()))
if ($(this).attr("name") == "DOI" && sets.has(val.string)) {
str=sets.get(val.string)
if(val.IsSupporting){
str+=" (SI)"
}
$(op).text(str)
}
else {
$(op).text(val.toString())
@ -177,8 +181,12 @@ draft: false
if (trueTypeOf(el) == DOI.name) {
var publi = doiCache.get(el.string, true)
const sets = await getSets()
if (sets.has(el.toString())) {
$(td).append(sets.get(el.toString()))
if (sets.has(el.string)) {
var str=sets.get(el.string)
if(el.IsSupporting){
str+=" (SI)"
}
$(td).append(str)
}
$("<a/>", {
href: el.url,

View File

@ -100,11 +100,24 @@ class state {
};
}
class DOI {
constructor(doistring) {
constructor(doistring,IsSupporting=false) {
this.string = doistring
this.IsSupporting = IsSupporting
};
static fromString(str){
const vals=str.split(",")
if (vals.length>1) {
return new DOI(vals[0].toString())
}
else{
return new DOI(str[0].toString(),(true ? str[1]=== true.toString() : false))
}
}
toString() {
return this.string;
var str=this.string;
if (this.IsSupporting) {
str+=" "+"(SI)"
}
};
get url() {
return new URL(this.string, 'https://doi.org').toString()
@ -222,7 +235,7 @@ class dataFileBase {
dat.method = method.fromString(value)
break;
case "doi":
dat.DOI = new DOI(value);
dat.DOI = DOI.fromString(value);
break;
default:
}