10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-25 05:43:46 +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 = ['\\(', '\\)']
var al=$("#AllowList")
var ef=$("#exitationFilter")
for (const prop of Object.getOwnPropertyNames(excitationTypes)) {
if(!Object.getOwnPropertyNames(URL).includes(prop)){
$("<li/>").text(LatexInline[0]+excitationTypes[prop].LaTeX+LatexInline[1]).appendTo(al)
$('<label />', { 'for': 'cb_'+prop, text:LatexInline[0]+excitationTypes[prop].LaTeX+LatexInline[1]}).appendTo(ef);
$("<input/>",{type:"checkbox",id:"cb_"+prop,value:excitationTypes[prop].Value}).appendTo(ef)
}
for (const [name,value] of excitationTypes.All) {
$("<li/>").text(LatexInline[0]+value.LaTeX+LatexInline[1]).appendTo(al)
$('<label />', { 'for': 'cb_'+name, text:LatexInline[0]+value.LaTeX+LatexInline[1]}).appendTo(ef);
$("<input/>",{type:"checkbox",id:"cb_"+name,value:Number(value)}).appendTo(ef)
}
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(ef)
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 Singulet(){return new excitationType(16,"S")}
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{
constructor(value,laTeX){
this.Value=value;
this.LaTeX=laTeX
}
valueOf(){
return this.Value;
}
}
class code {
constructor(name, version) {