| 
									
										
										
										
											2009-09-21 11:32:36 +00:00
										 |  |  | // Update the local timeline from a Meteor server
 | 
					
						
							| 
									
										
										
										
											2009-07-10 09:57:38 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | var MeteorUpdater = function() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2009-09-23 11:08:12 -04:00
										 |  |  |      return { | 
					
						
							| 
									
										
										
										
											2009-07-10 09:57:38 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-23 11:08:12 -04:00
										 |  |  |           init: function(server, port, timeline) | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |                Meteor.callbacks["process"] = function(data) { | 
					
						
							| 
									
										
										
										
											2009-09-23 11:08:35 -04:00
										 |  |  |                     RealtimeUpdate.receive(JSON.parse(data)); | 
					
						
							| 
									
										
										
										
											2009-09-23 11:08:12 -04:00
										 |  |  |                }; | 
					
						
							| 
									
										
										
										
											2009-07-10 09:57:38 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-23 11:08:12 -04:00
										 |  |  |                Meteor.host = server; | 
					
						
							|  |  |  |                Meteor.port = port; | 
					
						
							|  |  |  |                Meteor.joinChannel(timeline, 0); | 
					
						
							|  |  |  |                Meteor.connect(); | 
					
						
							|  |  |  |           } | 
					
						
							|  |  |  |      } | 
					
						
							| 
									
										
										
										
											2009-07-10 09:57:38 -07:00
										 |  |  | }(); | 
					
						
							|  |  |  | 
 |