Skip to content

Instantly share code, notes, and snippets.

@steve-ayerhart
Created January 22, 2012 18:49
Show Gist options
  • Save steve-ayerhart/1658175 to your computer and use it in GitHub Desktop.
Save steve-ayerhart/1658175 to your computer and use it in GitHub Desktop.
{BaseView} = require '../base'
class exports.LoginView extends BaseView
template: require 'templates/auth/login'
initialize: ->
super
app.debug 'LoginView', 'initialize'
@el = $('#auth')
@delegateEvents()
@render()
events:
'click #loginButton': 'startConnection'
startConnection: ->
app.debug 'LoginView', 'startConnection'
jid = @el.find('#loginjid').val()
pass = @el.find('#loginpw').val()
if jid.length > 0 and pass.length > 0
app.handlers.connection.connect jid, pass
render: ->
app.debug 'LoginView', 'render'
@el.html @template()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment