3 require('./utils/font-setup');
5 var appEvents = require('./utils/appevents');
6 var Backbone = require('backbone');
7 var itemCollections = require('./collections/instances/integrated-items');
8 var chatCollection = require('./collections/instances/chats');
9 var PeopleModal = require('./views/modals/people-modal');
10 var LoginView = require('./views/modals/login-view');
11 var onready = require('./utils/onready');
12 var ChatToolbarLayout = require('./views/layouts/chat-toolbar');
13 var urlParse = require('url-parse');
15 /* Set the timezone cookie */
16 require('./components/timezone-cookie');
18 require('./views/widgets/preload');
19 require('./components/dozy');
20 require('./template/helpers/all');
21 require('./components/bug-reporting');
24 require('./views/widgets/avatar');
25 require('./components/ping');
28 require('./components/link-handler').installLinkHandler();
30 appEvents.on('navigation', function(url) {
31 // No pushState here. Open links within the parent...
32 window.parent.location.href = url;
35 var appView = new ChatToolbarLayout({
38 chatCollection: chatCollection
42 var Router = Backbone.Router.extend({
49 hideModal: function() {
50 appView.dialogRegion.destroy();
54 appView.dialogRegion.show(
56 rosterCollection: itemCollections.roster
61 login: function(query) {
62 var options = query ? urlParse('?' + query, true).query : {};
63 appView.dialogRegion.show(new LoginView(options));
67 var router = new Router();
69 appEvents.on('loginClicked', function(route) {
70 router.navigate(route, { trigger: true });
73 // // Listen for changes to the room
74 // liveContext.syncRoom();
76 Backbone.history.stop();
77 Backbone.history.start();