Created
August 4, 2011 22:41
-
-
Save JakubOboza/1126475 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Application = { | |
faye: null, | |
init: function(){ | |
Map.init(); | |
Application.init_faye(); | |
}, | |
init_faye: function(){ | |
Application.faye = new Faye.Client('http://localhost:9292/faye'); | |
Application.faye.subscribe('/markers_ip', Application.message_ip_handler); | |
Application.faye.subscribe('/markers_address', Application.message_address_handler); | |
}, | |
message_ip_handler: function(message){ | |
Map.draw_marker(message.lat, message.lng, message.ip); | |
}, | |
message_address_handler: function(message){ | |
Map.address_lookup(message.address); | |
} | |
}; | |
$(document).ready(function(){ | |
Application.init(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment