10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-26 14:23:42 +01:00
QUESTDB_website/content/pages/index.html

47 lines
1.6 KiB
HTML
Raw Normal View History

2019-08-21 20:04:29 +02:00
<!DOCTYPE html>
<html>
2019-08-22 10:34:07 +02:00
<head>
<title>Welcome</title>
<meta name="save_as" content="index.html"></meta>
<meta name="date" content="2019-08-29 09:00"></meta>
</head>
<body>
<script src="{static}/scripts/data.js" type="text/javascript"></script>
<script src="{static}/scripts/getFullDataPath.js" type="text/javascript"></script>
2019-08-22 15:23:52 +02:00
<script src="https://cdn.rawgit.com/larsgw/citation.js/archive/citation.js/citation-0.4.0-9.js" type="text/javascript"></script>
2019-08-21 20:04:29 +02:00
<script>
2019-08-22 10:34:07 +02:00
function update_file(filename) {
2019-08-28 11:59:18 +02:00
file=filename+'.dat'
2019-08-22 10:34:07 +02:00
lnk_file.setAttribute('href',getFullDataPath(file));
lnk_file=document.getElementById('lnk_file');
2019-08-28 11:59:18 +02:00
data.load(file,onApplyData);
}
2019-08-28 11:59:18 +02:00
function onApplyData(dat) {
lnk_doi=document.getElementById('lnk_doi');
2019-08-28 11:59:18 +02:00
doiurl=dat.doi.url;
2019-08-22 15:23:52 +02:00
lnk_doi.setAttribute('href',doiurl);
const Cite = require('citation-js');
2019-08-28 11:59:18 +02:00
let publi = new Cite(dat.doi.string)
2019-08-22 15:23:52 +02:00
lnk_doi.innerHTML=publi.format('citation');
}
2019-08-21 20:04:29 +02:00
</script>
<script>
2019-08-22 10:34:07 +02:00
window.onload=function() {
var inp = document.getElementById("inp_filename");
inp.addEventListener("keydown", function (e) {
if (e.keyCode === 13) { //checks whether the pressed key is "Enter"
update_file(inp.value);
}
}
);
2019-08-21 20:04:29 +02:00
}
</script>
2019-08-22 10:34:07 +02:00
<label>Write a data file name without extension<br/>
<input type="text" id='inp_filename'></input>
</label><br/>
<a target="_blank" id='lnk_doi'>Go to paper</a>
<a target="_blank" id='lnk_file'>Go to file</a>
</body>
</html>