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

  ViewVC Help
Powered by ViewVC 1.1.26