blob: 9ee91b6fbd8873c7d6202973c7c235f1cd2e6a1c (
plain)
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
|
<html>
<head>
<title>rhimportd - Testclient</title>
<style type="text/css">
body {
background-color: #555;
}
div.data {
background-color: white;
border: 1px solid;
padding: 1em;
font-family: monospace;
}
</style>
<script src="jquery.min.js"></script>
<script type="text/javascript">
function Test() {
this.sock = new WebSocket("ws://localhost:4080/trusted/socket");
this.sock.onmessage = function (event) {
$('#rawmsg').text(event.data);
}
this.update = function() {
this.sock.send(JSON.stringify({ COMMAND: "new" }));
}
}
function init() {
test = new Test();
setInterval(test.update.bind(test), 1000);
// test.update();
}
</script>
</head>
<body onload="init()">
<h1>Radio Helsinki Rivendell Importer:</h1>
<div id="rawmsg" class="data"></div>
</body>
</html>
|