mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-11-04 05:03:53 +01:00
Better presentation on the web page
This commit is contained in:
parent
a37ea7a2cf
commit
f836086f07
@ -23,7 +23,7 @@
|
|||||||
}
|
}
|
||||||
async function applyData(dat) {
|
async function applyData(dat) {
|
||||||
const Cite = require('citation-js');
|
const Cite = require('citation-js');
|
||||||
// Start a async task to get publi
|
// Start an async task to get publi data
|
||||||
let publitask = Cite.async(dat.doi.string)
|
let publitask = Cite.async(dat.doi.string)
|
||||||
const LatexInline=['\\(','\\)']
|
const LatexInline=['\\(','\\)']
|
||||||
var par=document.getElementById("data_par")
|
var par=document.getElementById("data_par")
|
||||||
@ -39,15 +39,19 @@
|
|||||||
node.innerText= element[0]+': '+element[1];
|
node.innerText= element[0]+': '+element[1];
|
||||||
par.appendChild(node);
|
par.appendChild(node);
|
||||||
});
|
});
|
||||||
var node = document.createElement("h");
|
var exDiv= document.createElement("div");
|
||||||
node.innerText= "Excitations";
|
par.appendChild(exDiv);
|
||||||
par.appendChild(node);
|
var exTitle = document.createElement("h2");
|
||||||
|
exTitle.innerText= "Excitations";
|
||||||
|
exDiv.appendChild(exTitle);
|
||||||
|
var exPar= document.createElement("p");
|
||||||
|
exDiv.appendChild(exPar);
|
||||||
await dat.excitations.reduce(async (promise,el)=> {
|
await dat.excitations.reduce(async (promise,el)=> {
|
||||||
await promise;
|
await promise;
|
||||||
var node = document.createElement("div");
|
var node = document.createElement("div");
|
||||||
node.innerHTML= String.raw`${LatexInline[0]} ${el.start.toLaTeX()} \rightarrow ${el.end.toLaTeX()}${LatexInline[1]}, ${LatexInline[0]}${el.Eabs}\:\mathrm{eV}${LatexInline[1]}`;
|
node.innerHTML= String.raw`${LatexInline[0]} ${el.start.toLaTeX()} \rightarrow ${el.end.toLaTeX()}${LatexInline[1]}, ${LatexInline[0]}${el.Eabs}\:\mathrm{eV}${LatexInline[1]}`;
|
||||||
node.hidden=true
|
node.hidden=true
|
||||||
par.appendChild(node);
|
exPar.appendChild(node);
|
||||||
await MathJax.typesetPromise();
|
await MathJax.typesetPromise();
|
||||||
node.hidden=false;
|
node.hidden=false;
|
||||||
});
|
});
|
||||||
@ -78,6 +82,7 @@
|
|||||||
<label>Write a data file name without extension<br/>
|
<label>Write a data file name without extension<br/>
|
||||||
<input type="text" id='inp_filename' onkeydown="onKeyDown(event)"></input>
|
<input type="text" id='inp_filename' onkeydown="onKeyDown(event)"></input>
|
||||||
</label><br/>
|
</label><br/>
|
||||||
|
<h1>Data</h1>
|
||||||
<p id=data_par></p>
|
<p id=data_par></p>
|
||||||
<a target="_blank" id='lnk_file' type='text/plain'>Go to file</a>
|
<a target="_blank" id='lnk_file' type='text/plain'>Go to file</a>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
Reference in New Issue
Block a user