1 |
<html> |
2 |
<head> |
3 |
<title>Koha RFID</title> |
4 |
|
5 |
<script type="text/javascript" src="/jquery-1.3.2.js"></script> |
6 |
<script type="text/javascript" src="/meteor.js"></script> |
7 |
<script type="text/javascript"> |
8 |
|
9 |
// Set this to something unique to this client |
10 |
|
11 |
function process(data) { |
12 |
console.info('process', data); |
13 |
$('#test').append( data ); |
14 |
}; |
15 |
|
16 |
$(document).ready( function() { |
17 |
|
18 |
var channel = 'test'; |
19 |
|
20 |
Meteor.hostid = '409897502705'; |
21 |
|
22 |
// Our Meteor server is on the data. subdomain |
23 |
Meteor.host = 'data.' + location.hostname; |
24 |
Meteor.port = 4670; |
25 |
|
26 |
// Call the test() function when data arrives |
27 |
Meteor.registerEventCallback("process", process ); |
28 |
|
29 |
console.info('Meteor connect', channel, Meteor.status ); |
30 |
|
31 |
// Join the demo channel and get last five events, then stream |
32 |
Meteor.joinChannel( channel, 5 ); |
33 |
Meteor.mode = 'stream'; |
34 |
|
35 |
// Start streaming! |
36 |
Meteor.connect(); |
37 |
|
38 |
|
39 |
}); |
40 |
|
41 |
</script> |
42 |
</head> |
43 |
|
44 |
<body> |
45 |
|
46 |
<h1> |
47 |
Koha RFID data |
48 |
</h1> |
49 |
|
50 |
<div id="test"> |
51 |
Waiting for data... |
52 |
</div> |
53 |
|
54 |
</body> |
55 |
|
56 |
</html> |