forked from HamzaTanjiCherkaoui/campus
-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
87 lines (69 loc) · 2.09 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>
<head>
<link href="client/assets/css/nw.css" rel="stylesheet" />
</head>
<body>
<header class="window-toolbar">
<ul>
<li><a href='#' title='Minimize' id='windowControlMinimize'></a></li>
<li><a href='#' title='Maximize' id='windowControlMaximize'></a></li>
<li><a href='#' title='Close' id='windowControlClose' ></a></li>
</ul>
</header>
<div class="wrap">
<div id="loader" class="loading">
<h1>Loading...</h1>
</div>
<iframe id="myFrame" frameborder="0" height="100%" width="100%"></iframe>
</div>
<script type="text/javascript" src="server/app.js"></script>
<script src="client/bower_components/jquery/dist/jquery.js"></script>
<script>
(function($) {
var nw = require('nw.gui');
var win = nw.Window.get();
win.isMaximized = false;
// Min
document.getElementById('windowControlMinimize').onclick = function()
{
win.minimize();
};
// Close
document.getElementById('windowControlClose').onclick = function()
{
win.close();
};
// Max
document.getElementById('windowControlMaximize').onclick = function()
{
if (win.isMaximized)
win.unmaximize();
else
win.maximize();
};
win.on('maximize', function(){
win.isMaximized = true;
});
win.on('unmaximize', function(){
win.isMaximized = false;
});
var loader = $('#loader'),
myFrame = $('#myFrame').hide(),
url = 'http://127.0.0.1:9000';
var load = function () {
$.ajax({
url: url,
success: function(data){
loader.hide();
myFrame.show();
myFrame.attr('src', url);
},
error:load
});
};
load();
})(jQuery);
</script>
</body>
</html>