-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
109 lines (94 loc) · 3.68 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
109
<!DOCTYPE html>
<html>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" />
<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script src="js/typed.js" type="text/javascript"></script>
<style>
.btn {
margin: 8px;
}
p {
margin: 5px;
}
div {
border-radius: 25px;
}
</style>
<head>
<meta charset="UTF-8">
<title>1090 Logger</title>
</head>
<script>
window.onload = function() {
console.log( "window.onload called" );
adsb=require("./js/adsbproxy");
player=require("./js/replayraw")
bootstrap_alert = function() {}
bootstrap_alert.info = function(message) {
$('#alert_placeholder').html('<div class="alert alert-success"><a class="close" data-dismiss="alert" aria-label="close">×</a><span>'+message+'</span></div>')
}
bootstrap_alert.warning = function(message) {
$('#alert_placeholder').html('<div class="alert alert-warning"><a class="close" data-dismiss="alert" aria-label="close">×</a><span>'+message+'</span></div>')
}
$('#stopbtn').on('click', function() {
bootstrap_alert.warning('<strong>Stop!</strong> recorder or player');
adsb.closeAll();
player.closeAll();
});
$('#breplay').on('click', function() {
if (player.filename.length>0)
{
bootstrap_alert.info('Replaying file '+ player.filename);
player.replayFile();
}
else
{
bootstrap_alert.warning('Please select a file first');
}
});
$('input[type="file"]').change(function(e){
adsb.closeAll();
player.filename = e.target.files[0].name;
player.startServer();
bootstrap_alert.warning('Server started and the file "' + player.filename + '" is ready for replay.');
});
};
function bconnectFunction()
{
bootstrap_alert.info('<strong>Recording!</strong> ADSB hexdump to text log file.');
adsb.connectToADSBServer();
}
</script>
<body>
<div class="panel panel-default">
<div class="panel-body">
<div class="jumbotron">
<h1 id="applicationname">1090 Logger</h1>
<p id="consoletxt">Node
<script>
document.write(process.versions.node)
</script>, Chrome
<script>
document.write(process.versions.chrome)
</script>, and Electron
<script>
document.write(process.versions.electron)
</script>.</p>
<p>
<a class="btn btn-primary btn-lg" href="#" role="button" id="bconnect" onclick="bconnectFunction()">Connect</a>
<a class="btn btn-primary btn-lg" type="button" id="stopbtn" data-role="bstop">Stop</a>
<div class="panel-body">
<a class="btn btn-success btn-lg btn-file" type="button" id="breplay">Replay</a>
<input type="file">
</div>
</p>
<div id="alert_placeholder"></div>
</div>
</div>
</div>
</body>
</html>