-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex-viewzavr-remote.html
91 lines (71 loc) · 3.25 KB
/
index-viewzavr-remote.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
<!DOCTYPE html>
<html>
<script src="//viewlang.ru/viewzavr-apps/viewzavr-system-a/lib/viewlang/code/depends/jquery-2.1.4.js"></script>
<script src="//viewlang.ru/viewzavr-apps/viewzavr-system-a/lib/viewlang/code//depends/qmlweb/src/parser.js"></script>
<script src="//viewlang.ru/viewzavr-apps/viewzavr-system-a/lib/viewlang/code//depends/qmlweb/src/process.js"></script>
<script src="//viewlang.ru/viewzavr-apps/viewzavr-system-a/lib/viewlang/code//depends/qmlweb/src/import.js"></script>
<script src="//viewlang.ru/viewzavr-apps/viewzavr-system-a/lib/viewlang/code//depends/qmlweb/src/qtcore.js"></script>
<script src="//viewlang.ru/viewzavr-apps/viewzavr-system-a/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="//viewlang.ru/viewzavr-apps/viewzavr-system-a/lib/viewlang/code//threejs_driver/init.js"></script>
<script type="module">
///////////////////////////// qmlweb and viewlang (required for viewzavr-system-a implementation)
import * as Viewlang from "//viewlang.ru/viewzavr-apps/viewzavr-system-a/lib/viewlang/code/embed2/init.js"
window.qmlEngine = new QMLEngine( document.getElementById( "qmlSpace" ) );
Viewlang.setup_qmlweb( qmlEngine );
///////////////////////////// viewzavr
import * as Viewzavr from "//viewlang.ru/viewzavr-apps/viewzavr-system-a/lib/viewzavr-core/init.js";
var vz = Viewzavr.create();
// window.vz = vz;
//////////////////////////// player
import * as Player from "//viewlang.ru/viewzavr-apps/viewzavr-system-a/player/init.js";
var vzPlayer = Player.create( vz, qmlEngine );
window.vzPlayer = vzPlayer;
//////////////////////////// graphical api
import * as VisAPI from "//viewlang.ru/viewzavr-apps/viewzavr-system-a/graphical-api/init.js";
VisAPI.setup( vz );
//////////////////////////// library-one
import * as lib1 from "//viewlang.ru/viewzavr-apps/viewzavr-system-a/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("src");
// if (!userurl) userurl = vz.getDir( import.meta.url ) + "./app.js";
var userurl = vz.getDir( import.meta.url ) + "./app.js";
console.log("user script 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();
}
q.then( function() {
vzPlayer.loadFromHash();
vzPlayer.startSavingToHash();
});
</script>
</body>