10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-26 06:14:38 +01:00

Handle excitationType better (with LaTeX)

This commit is contained in:
Mickaël Véril 2019-12-16 13:49:41 +01:00
parent b0c7ca112d
commit 622cad5b02
2 changed files with 25 additions and 6 deletions

View File

@ -25,14 +25,15 @@ draft: false
const LatexInline = ['\\(', '\\)'] const LatexInline = ['\\(', '\\)']
var al=$("#AllowList") var al=$("#AllowList")
var ef=$("#exitationFilter") var ef=$("#exitationFilter")
for (const prop of Object.getOwnPropertyNames(excitationTypes)) { for (const [name,value] of excitationTypes.All) {
if(!Object.getOwnPropertyNames(URL).includes(prop)){ $("<li/>").text(LatexInline[0]+value.LaTeX+LatexInline[1]).appendTo(al)
$("<li/>").text(LatexInline[0]+excitationTypes[prop].LaTeX+LatexInline[1]).appendTo(al) $('<label />', { 'for': 'cb_'+name, text:LatexInline[0]+value.LaTeX+LatexInline[1]}).appendTo(ef);
$('<label />', { 'for': 'cb_'+prop, text:LatexInline[0]+excitationTypes[prop].LaTeX+LatexInline[1]}).appendTo(ef); $("<input/>",{type:"checkbox",id:"cb_"+name,value:Number(value)}).appendTo(ef)
$("<input/>",{type:"checkbox",id:"cb_"+prop,value:excitationTypes[prop].Value}).appendTo(ef)
}
} }
await MathJax.typesetPromise(); await MathJax.typesetPromise();
$("<li/>").text("Unsafe").appendTo(al)
$('<label/>', { 'for': 'cb_unsafe', text:"Unsafe"}).appendTo(ef);
$("<input/>",{type:"checkbox",id:"cb_unsafe",value:true})
delete(al) delete(al)
delete(ef) delete(ef)
window.doiCache = new DOICache() window.doiCache = new DOICache()

View File

@ -5,12 +5,30 @@ class excitationTypes {
static get nPis(){return new excitationType(8,String.raw`n \rightarrow \pi^\star`)} static get nPis(){return new excitationType(8,String.raw`n \rightarrow \pi^\star`)}
static get Singulet(){return new excitationType(16,"S")} static get Singulet(){return new excitationType(16,"S")}
static get Doublet(){return new excitationType(32,"D")} static get Doublet(){return new excitationType(32,"D")}
static get All(){
var lst=[]
for(const prop of Object.getOwnPropertyNames(excitationTypes)){
if (prop!="All") {
const value=excitationTypes[prop]
if (trueTypeOf(value)==excitationType.name) {
lst.push([prop,value])
}
}
}
return lst
}
static GetFlags(value){
return this.All().filter((x)=>{value & x[1]})
}
} }
class excitationType{ class excitationType{
constructor(value,laTeX){ constructor(value,laTeX){
this.Value=value; this.Value=value;
this.LaTeX=laTeX this.LaTeX=laTeX
} }
valueOf(){
return this.Value;
}
} }
class code { class code {
constructor(name, version) { constructor(name, version) {