app/assets/javascripts/_main.js.coffee
43b171a9
 this.App =
   UI:
1ec65f29
     setAutoHeight: ->
43b171a9
       height = $(window).height()
       $("#height-setter-1").css({height: height - 50})
       $("#height-setter-2").css({height: height - $('#tabbar').outerHeight() - $('#msg-writer').outerHeight() - 57})
ff94bdbf
 
   Com:
b27f285a
     connect: (callback) ->
       App._dispatcher = new WebSocketRails('www.xmpp.dev:3000/websocket')
       App._dispatcher.on_open = =>
         @_setupBackboneComponents()
         callback?()
ff94bdbf
 
     fetch: (options) ->
b27f285a
       _.defaults(options, {data: {} })
ff94bdbf
       App._dispatcher.trigger(options.event, options.data, options.success, options.error)
b27f285a
 
     getRoster: ->
       App.Com.fetch({
         event: 'app.roster.contacts'
         success: (data, contacts = data.contacts) ->
           _.each(contacts, (contact) ->
             newContact = new Xmpp.Models.Contact(contact)
             App.Collections.Contacts.add newContact
           )
       })
 
     _setupBackboneComponents: ->
       App.Collections.Contacts = new Xmpp.Collections.ContactsCollection()
 
   Collections:
     Contacts: null