-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
108 lines (84 loc) · 3.17 KB
/
index.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html>
<link rel="manifest" href="./pwa/manifest.webmanifest">
<script src="./pwa/setup.js"></script>
<script src="./lib/viewlang/code/depends/jquery-2.1.4.js"></script>
<script src="./lib/viewlang/code//depends/qmlweb/src/parser.js"></script>
<script src="./lib/viewlang/code//depends/qmlweb/src/process.js"></script>
<script src="./lib/viewlang/code//depends/qmlweb/src/import.js"></script>
<script src="./lib/viewlang/code//depends/qmlweb/src/qtcore.js"></script>
<script src="./lib/viewlang/code//base.js"></script>
<head>
</head>
<body>
<div id="qmlSpace">
target space for qml...
</div>
<style>
#qmlSpace {
width: 100vw !important;
bottom: 0px !important;
z-index: 10000;
}
.viewlang-canvas {
width: 100%; height: 100%;
margin: 0; padding: 0; display: block; left: 0px; top: 0px; position: absolute;
}
body { margin: 0; }
</style>
<script src="./lib/viewlang/code//threejs_driver/init.js"></script>
<script type="module">
///////////////////////////// qmlweb and viewlang (required for viewzavr-system-a implementation)
import * as Viewlang from "./lib/viewlang/code/embed2/init.js"
window.qmlEngine = new QMLEngine( document.getElementById( "qmlSpace" ) );
Viewlang.setup_qmlweb( qmlEngine );
///////////////////////////// viewzavr
import * as Viewzavr from "./lib/viewzavr-core/init.js";
var vz = Viewzavr.create();
// window.vz = vz;
//////////////////////////// player
import * as Player from "./player/init.js";
var vzPlayer = Player.create( vz, qmlEngine );
window.vzPlayer = vzPlayer;
//////////////////////////// graphical api
import * as VisAPI from "./graphical-api/init.js";
VisAPI.setup( vz );
//////////////////////////// library-one
import * as lib1 from "./lib/library-one/init.js";
lib1.setup( vz, vzPlayer );
//////////////////////////// load user script
// use this logic if you want to load app files defined in parameter.
var userurl = getParameterByName("app");
// if (!userurl) userurl = vz.getDir( import.meta.url ) + "./app.js";
// var userurl = vz.getDir( import.meta.url ) + "./app.js";
console.log("user script app url=",userurl );
var q;
if (userurl) {
// тут у нас форматирование для загрузки через прокси
userurl = formatSrc( userurl );
console.log("reformatted:",userurl );
q = vzPlayer.loadApp( userurl );
}
else
{
// idea: load empty scene always and then load user scripts into it as a child?
console.log("lllloading empty scene..");
q = vzPlayer.loadEmptyScene();
}
///////////////////////////// load user scene
var jsonurl = getParameterByName("scene");
console.log("user scene url=",userurl );
if (jsonurl) {
vzPlayer.loadJson( jsonurl ).then( function() {
vzPlayer.loadFromHash();
vzPlayer.startSavingToHash();
} );
}
else {
q.then( function() {
vzPlayer.loadFromHash();
vzPlayer.startSavingToHash();
});
}
</script>
</body>