mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-12-25 13:53:48 +01:00
Use websiteFile
This commit is contained in:
parent
7ac3912c44
commit
039143d275
@ -9,6 +9,7 @@ draft: false
|
|||||||
<script src="/scripts/getTextFromFile.js" type="text/javascript"></script>
|
<script src="/scripts/getTextFromFile.js" type="text/javascript"></script>
|
||||||
<script src="/scripts/trueTypeOf.js" type="text/javascript"></script>
|
<script src="/scripts/trueTypeOf.js" type="text/javascript"></script>
|
||||||
<script src="/scripts/noNan.js"></script>
|
<script src="/scripts/noNan.js"></script>
|
||||||
|
<script src="/scripts/websiteFile.js"></script>
|
||||||
<script src="https://cdn.rawgit.com/larsgw/citation.js/archive/citation.js/citation-0.4.0-9.js" type="text/javascript"></script>
|
<script src="https://cdn.rawgit.com/larsgw/citation.js/archive/citation.js/citation-0.4.0-9.js" type="text/javascript"></script>
|
||||||
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
|
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
|
||||||
{{< getDataFilesName >}}
|
{{< getDataFilesName >}}
|
||||||
@ -67,8 +68,6 @@ draft: false
|
|||||||
reload()
|
reload()
|
||||||
}
|
}
|
||||||
async function update_file(file) {
|
async function update_file(file) {
|
||||||
var lnk_file=document.getElementById('lnk_file');
|
|
||||||
lnk_file.setAttribute('href',String.raw`view?dataFile=${file}`);
|
|
||||||
dat= await data.loadAsync(file);
|
dat= await data.loadAsync(file);
|
||||||
await applyData(dat);
|
await applyData(dat);
|
||||||
}
|
}
|
||||||
@ -78,7 +77,7 @@ draft: false
|
|||||||
par.innerHTML='';
|
par.innerHTML='';
|
||||||
var md=[];
|
var md=[];
|
||||||
var els=[];
|
var els=[];
|
||||||
var customRenderingProp=["excitations"]
|
var customRenderingProp=["excitations","sourceFile"]
|
||||||
for (const key of Object.keys(window.data)) {
|
for (const key of Object.keys(window.data)) {
|
||||||
if (window.data[key]!=null){
|
if (window.data[key]!=null){
|
||||||
md.push(key)
|
md.push(key)
|
||||||
@ -87,6 +86,7 @@ draft: false
|
|||||||
md.push([prop,window.data[key][prop]])
|
md.push([prop,window.data[key][prop]])
|
||||||
}
|
}
|
||||||
md.push(window.data[key].DOI)
|
md.push(window.data[key].DOI)
|
||||||
|
md.push(window.data[key].sourceFile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
div=document.getElementById("meta_div")
|
div=document.getElementById("meta_div")
|
||||||
@ -111,6 +111,12 @@ draft: false
|
|||||||
node.target='_blank'
|
node.target='_blank'
|
||||||
node.href=element.url
|
node.href=element.url
|
||||||
break
|
break
|
||||||
|
case "websiteFile":
|
||||||
|
node=document.createElement("a")
|
||||||
|
node.innerText="Go to file"
|
||||||
|
node.target='_blank'
|
||||||
|
node.href=element.viewerUrl
|
||||||
|
break
|
||||||
case "Array":
|
case "Array":
|
||||||
k=element[0]
|
k=element[0]
|
||||||
v=element[1]
|
v=element[1]
|
||||||
@ -210,5 +216,4 @@ draft: false
|
|||||||
<div id="abs_plot">
|
<div id="abs_plot">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</p>
|
</p>
|
||||||
<a target="_blank" id='lnk_file'>Go to file</a>
|
|
@ -108,9 +108,12 @@ class dataFileBase {
|
|||||||
this.method = null
|
this.method = null
|
||||||
this.excitations = []
|
this.excitations = []
|
||||||
this.DOI = null
|
this.DOI = null
|
||||||
|
this.sourceFile=null
|
||||||
}
|
}
|
||||||
static async loadAsync(file) {
|
static async loadAsync(file) {
|
||||||
return this.loadString(await getTextFromFileAsync(getFullDataPath(file)));
|
var dat = this.loadString(await getTextFromFileAsync(getFullDataPath(file)));
|
||||||
|
dat.sourceFile=new websiteFile(file)
|
||||||
|
return dat
|
||||||
}
|
}
|
||||||
static readmetaPair(key, value, dat) {
|
static readmetaPair(key, value, dat) {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
Loading…
Reference in New Issue
Block a user