10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-25 13:53:48 +01:00

Fix JavaScript and html

This commit is contained in:
Mickaël Véril 2019-12-10 13:55:32 +01:00
parent e3ba075e0e
commit 5041eed3b2
2 changed files with 29 additions and 22 deletions

View File

@ -234,7 +234,7 @@ draft: false
$(sel_ref).append(op) $(sel_ref).append(op)
} }
} }
sel_ref.selectedIndex=0; $(sel_ref).prop("selectedIndex",0);
for (const d of window.filt) { for (const d of window.filt) {
var row = $("<tr/>") var row = $("<tr/>")
var rowd = [] var rowd = []
@ -297,7 +297,7 @@ draft: false
<li>Method</li> <li>Method</li>
<li>Publication</li> <li>Publication</li>
</ul> </ul>
<li>Select a reference from <strong>already selected data</strong> (by default the first is already selected)</li> <li>Select a reference from <strong>already selected data</strong> (by default first is selected -it's the <abbr title="Theoretical best estimate">TBE</abbr> if present- is already selected)</li>
<li>Now you can see the list of selected data and some statistics about these data</li> <li>Now you can see the list of selected data and some statistics about these data</li>
</ol> </ol>
</p> </p>

View File

@ -81,28 +81,29 @@ class excitationBase {
constructor(initial, final, type=null, T1=null) { constructor(initial, final, type=null, T1=null) {
this.initial = initial; this.initial = initial;
this.final = final this.final = final
this.type=0
if (type !== null) { if (type !== null) {
tys = type.split(";") const tys = type.split(";")
const arrow = String.raw('\rightarrow') const arrow = String.raw`\rightarrow`
for (ty in tys) { for (const ty of tys) {
if (ty.include(arrow)) { if (ty.includes(arrow)) {
initial, final = ty.split(arrow, 2) const [initialt, finalt] = ty.split(arrow, 2)
initials = initial.split(",") const initialts = initialt.split(",")
if (initials.length==2||initials.length==2){ if (initialts.length==2||initialts.length==2){
trty = trty| excitationType.Singulet this.type = this.type | excitationType.Singulet
} }
else{ else{
trty = trty | excitationType.Doublet this.type = this.type | excitationType.Doublet
} }
finals = final.split(",").map(x => x.strip()) const finalts = finalt.split(",").map(x => x.trim())
if (initials.include("n") && finals.include(String.raw('\pis'))) { if (initialts.includes("n") && finalts.includes(String.raw`\pis`)) {
trty = trty | excitationType.PiPis this.type = this.type | excitationType.PiPis
} else if (initials.include(String.raw('\pi')) in initials && finals.include(String.raw('\pis'))) { } else if (initialts.includes(String.raw`\pi`) in initialts && finals.includes(String.raw`\pis`)) {
trty = trty | excitationType.PiPis this.type = this.type | excitationType.PiPis
} else if (ty.include(String.raw('\Ryd'))) { } else if (ty.includes(String.raw`\Ryd`)) {
trty = trty | excitationType.RYDBERG this.type = this.type | excitationType.RYDBERG
} else if (ty.include(String.raw('\Val'))) { } else if (ty.includes(String.raw`\Val`)) {
trty = trty | excitationType.VALENCE this.type = this.type | excitationType.VALENCE
} }
} }
} }
@ -112,7 +113,7 @@ class excitationBase {
} }
class excitationValue extends excitationBase { class excitationValue extends excitationBase {
constructor(initial, final, type, value,corrected=null,oscilatorForces=null,T1=null) { constructor(initial, final, type, value,corrected=null,oscilatorForces=null,T1=null) {
super(initial, final, type, T1=null) super(initial, final, type, T1)
this.value = value this.value = value
this.corrected = corrected this.corrected = corrected
this.oscilatorForces = oscilatorForces this.oscilatorForces = oscilatorForces
@ -223,8 +224,14 @@ class dataFileBase {
var start = new state(parseInt(vals[0], 10), parseInt(vals[1], 10), vals[2]); var start = new state(parseInt(vals[0], 10), parseInt(vals[1], 10), vals[2]);
var end = new state(parseInt(vals[3], 10), parseInt(vals[4],10), vals[5]); var end = new state(parseInt(vals[3], 10), parseInt(vals[4],10), vals[5]);
var hasType=vals.length>=7 && parseFloat(vals[6],10)==NaN var hasType=vals.length>=7 && isNaN(vals[6])
var type=((vals.length>=7 && hasType) ? vals[6] : null) var type=((vals.length>=7 && hasType) ? vals[6] : null)
if(type) {
const m=type.match(/^{([^\\}]*)}$/)
if (m) {
type=m[1]
}
}
var val=((vals.length>=7+hasType) ? parseFloat(vals[6+hasType], 10): NaN) var val=((vals.length>=7+hasType) ? parseFloat(vals[6+hasType], 10): NaN)
var cor=((vals.length>=8+hasType) ? parseFloat(vals[7+hasType], 10): NaN) var cor=((vals.length>=8+hasType) ? parseFloat(vals[7+hasType], 10): NaN)
var oscilatorForces=((vals.length>=9+hasType) ? parseFloat(vals[8+hasType],10): NaN) var oscilatorForces=((vals.length>=9+hasType) ? parseFloat(vals[8+hasType],10): NaN)