1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
var lobby, room
var SiteRouter = Router.extend({
el: "body",
routes: {
"/": 'login',
"/index": 'index',
"/login": 'login',
"/details/:id": 'details',
"/mail/:mailbox": 'mailbox',
"/mail/read/:id": 'message',
"/mail/compose": 'compose',
},
initialize: function(){
this.route()
},
index: function(){
app.view = new IndexView ()
},
login: function(){
app.view = new LoginView ()
},
details: function(id){
app.view = new DetailsView ()
app.view.load(id)
},
mailbox: function(box){
app.view = new Mailbox ()
app.view.load(box)
},
message: function(id){
app.view = new MessageView ()
app.view.load(id)
},
compose: function(){
app.view = new ComposeView ()
},
})
|