Gitter migration: Point people to app.gitter.im (rollout pt. 1)
[gitter.git] / public / js / router-embed-chat.js
blob87bba544cd61452988a1257494f464e0313099c9
1 'use strict';
3 var onready = require('./utils/onready');
4 var context = require('gitter-web-client-context');
5 var chatCollection = require('./collections/instances/chats');
6 var EmbedLayout = require('./views/layouts/chat-embed');
7 var Backbone = require('backbone');
8 var Router = require('./routes/router');
9 var roomRoutes = require('./routes/room-routes');
10 var notificationRoutes = require('./routes/notification-routes');
12 /* Set the timezone cookie */
13 require('./components/timezone-cookie');
15 require('./components/statsc');
16 require('./views/widgets/preload');
17 require('./components/dozy');
18 require('./template/helpers/all');
19 require('./components/bug-reporting');
20 require('./components/ping');
22 // Preload widgets
23 require('./views/widgets/avatar');
25 onready(function() {
26   var appView = new EmbedLayout({
27     el: 'body',
28     model: context.troupe(),
29     template: false,
30     chatCollection: chatCollection
31   });
32   appView.render();
34   new Router({
35     dialogRegion: appView.dialogRegion,
36     routes: [
37       notificationRoutes(),
38       roomRoutes({
39         rosterCollection: null,
40         // TODO: remove these two options:
41         // https://github.com/troupe/gitter-webapp/issues/2211
42         rooms: null,
43         groups: null
44       })
45     ]
46   });
48   Backbone.history.start();
49 });