/[meteor]/trunk/public_html/koha.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/public_html/koha.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 72 - (show annotations)
Sat Mar 28 14:21:21 2009 UTC (15 years ago) by dpavlin
File MIME type: application/javascript
File size: 1025 byte(s)
load items in fixed boxes
1 // Set this to something unique to this client
2
3 var rfid_visible = {};
4
5 function process(data) {
6 var a = data.split('|');
7 console.info('process', a);
8 $('#test').html( a[1] );
9 if ( a[0] > 0 && ! rfid_visible[ a[0] ] ) {
10 $('#koha').append( '<div class="item" id="' + a[0] + '">Loading item '+a[0]+' from Koha</div>' )
11 $('#' + a[0]).load( '/koha/' + a[0] );
12 rfid_visible[ a[0] ]++;
13 } else if ( a[0] < 0 ) {
14 $('#koha').html( 'No RFID chips in range' );
15 rfid_visible = {};
16 }
17 };
18
19 $(document).ready( function() {
20
21 var channel = 'test';
22
23 Meteor.hostid = '409897502705';
24
25 // Our Meteor server is on the data. subdomain
26 Meteor.host = 'data.' + location.hostname;
27 Meteor.port = 4670;
28
29 // Call the test() function when data arrives
30 Meteor.registerEventCallback("process", process );
31
32 console.info('Meteor connect', channel, Meteor.status );
33
34 // Join the demo channel and get last five events, then stream
35 Meteor.joinChannel( channel, 5 );
36 Meteor.mode = 'stream';
37
38 // Start streaming!
39 Meteor.connect();
40
41
42 });

  ViewVC Help
Powered by ViewVC 1.1.26