-
Notifications
You must be signed in to change notification settings - Fork 170
/
webapp.html
64 lines (57 loc) · 1.97 KB
/
webapp.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html lang="en">
<head>
<title>NGL - webapp</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="css/font-awesome.min.css" />
<link rel="stylesheet" href="css/main.css" />
<link rel="subresource" href="css/light.css" />
<link rel="subresource" href="css/dark.css" />
</head>
<body>
<!-- NGL -->
<script src="../build/js/ngl.dev.js"></script>
<!-- UI -->
<script src="js/lib/signals.min.js"></script>
<script src="js/lib/tether.min.js"></script>
<script src="js/lib/colorpicker.min.js"></script>
<script src="js/ui/ui.js"></script>
<script src="js/ui/ui.extra.js"></script>
<script src="js/ui/ui.ngl.js"></script>
<script src="js/gui.js"></script>
<script>
NGL.cssDirectory = "css/"
NGL.documentationUrl = "../build/docs/"
NGL.examplesListUrl = "../build/scriptsList.json"
NGL.examplesScriptUrl = "./scripts/"
// Datasources
NGL.DatasourceRegistry.add("data", new NGL.StaticDatasource("../data/"))
var mdsrv = NGL.getQuery("mdsrv")
if (mdsrv) {
var mdsrvDatasource = new NGL.MdsrvDatasource(mdsrv)
NGL.DatasourceRegistry.add("file", mdsrvDatasource)
NGL.setListingDatasource(mdsrvDatasource)
NGL.setTrajectoryDatasource(mdsrvDatasource)
}
var stage
document.addEventListener("DOMContentLoaded", function () {
stage = new NGL.Stage()
NGL.StageWidget(stage)
var load = NGL.getQuery("load")
if (load) stage.loadFile(load, {defaultRepresentation: true})
var script = NGL.getQuery("script")
if (script) stage.loadScript("./scripts/" + script + ".js")
var struc = NGL.getQuery("struc")
var traj = NGL.getQuery("traj")
if (struc) {
stage.loadFile(struc, {
defaultRepresentation: true
}).then(function(o) {
if (traj) o.addTrajectory(traj)
})
}
})
</script>
</body>
</html>