Skip to content

Instantly share code, notes, and snippets.

@flippyhead
Created January 14, 2011 07:03
Show Gist options
  • Save flippyhead/779300 to your computer and use it in GitHub Desktop.
Save flippyhead/779300 to your computer and use it in GitHub Desktop.
class RootView extends ApplicationView
constructor: ->
super
$(document).ready ()=>
# Logging
window.logger = $.log
window.logger.init('DEBUG', true)
# Helpers
window.flashView = new FlashView()
window.buttonView = new ButtonView()
# Session
window.session = new Session()
window.session.fetch
success: ()=>
window.controller = new ApplicationController()
Backbone.history.start()
this.socketStart()
this.socketListen()
socketStart: ->
this.socket = new io.Socket('localhost.com')
this.socket.connect()
socketListen: ->
this.socket.on 'message', (data)->
alert('xxx')
this.socket.on 'connect', ()-
logger.info 'SocketIO: connected.'
window.RootView = RootView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment