bigbluebutton-Github/labs/bbb-html5-client/public/js/router.coffee
Leonardo Crauss Daronco 519ac9ce0e First version of a single page html5 client app
Very simple by now, but with login working and switching to a (not yet implemented) session view.
2012-12-09 16:39:29 -02:00

31 lines
631 B
CoffeeScript

define [
'jquery',
'underscore',
'backbone',
'cs!views/app',
'cs!views/login',
'cs!views/session'
], ($, _, Backbone, AppView, LoginView, SessionView) ->
Router = Backbone.Router.extend
routes:
'session': 'showSession',
'login': 'showLogin',
'*actions': 'defaultAction'
initialize: ->
@appView = new AppView()
defaultAction: (actions) ->
console.log "router action:", actions
showLogin: () ->
loginView = new LoginView()
@appView.render(loginView)
showSession: () ->
sessionView = new SessionView()
@appView.render(sessionView)
Router