-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
87 lines (69 loc) · 2.13 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Eve7</title>
<script type="text/javascript" src="jsrootsys/scripts/JSRootCore.js"></script>
<script type="text/javascript" src="/currentdir/ViewManager.js"></script>
</head>
<style>
html { height: 100%; }
body { min-height: 100%; margin: 0; overflow: hidden }
#EveDiv {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
padding: 1
}
</style>
<body>
<div id="EveDiv">
loading scripts...
</div>
</body>
<script type='text/javascript'>
var DOCUMENT_READY;
var msgToWait = [];
var handleToWait;
var viewManager;
function InitCustomUI(handle) {
// from here you can use JSROOT.sap variable like
viewManager = new ViewManager();
sap.ui.getCore().loadLibrary("sap.tnt");
jQuery.sap.registerModulePath("eve", "/currentdir/");
handle.SetReceiver({
OnWebsocketOpened: function(handle) {
console.log('Connected');
},
OnWebsocketMsg: function(handle, msg) {
if (DOCUMENT_READY) {
sap.ui.getCore().byId("TopEveId").getController().OnWebsocketMsg(handle, msg);
}
else {
handleToWait = handle;
msgToWait.push(msg);
}
},
OnWebsocketClosed: function(handle) {
// when connection closed, close panel as well
if (window) window.close();
}
});
handle.Connect(); // only here connection is established
return JSROOT.AssertPrerequisites('openui5', function() {
new JSROOT.sap.ui.xmlview({
id: "TopEveId",
viewName: "eve.Main"
}).placeAt("EveDiv");
});
}
JSROOT.ConnectWebWindow({
prereq: "openui5;",
prereq_logdiv: "EveDiv",
callback: InitCustomUI
});
</script>
</html>