2013-06-26 04:00:56 +03:00
|
|
|
'use strict';
|
2013-06-21 04:43:58 +03:00
|
|
|
require(
|
|
|
|
[
|
2013-06-21 08:19:41 +03:00
|
|
|
'app',
|
2013-06-21 04:43:58 +03:00
|
|
|
'marionette',
|
2013-06-21 08:19:41 +03:00
|
|
|
'Controller',
|
2013-08-02 03:24:00 +03:00
|
|
|
'Series/SeriesCollection',
|
2013-09-02 05:55:45 +03:00
|
|
|
'ProgressMessaging/ProgressMessageCollection',
|
2013-09-11 09:33:47 +03:00
|
|
|
'Commands/CommandMessengerCollectionView',
|
2013-08-02 04:02:55 +03:00
|
|
|
'Navbar/NavbarView',
|
2013-08-06 05:29:34 +03:00
|
|
|
'jQuery/RouteBinder',
|
|
|
|
'jquery'
|
2013-09-12 03:42:15 +03:00
|
|
|
], function (App, Marionette, Controller, SeriesCollection, ProgressMessageCollection, CommandMessengerCollectionView, NavbarView, RouterBinder, $) {
|
2013-06-21 04:43:58 +03:00
|
|
|
|
2013-06-25 02:41:59 +03:00
|
|
|
var Router = Marionette.AppRouter.extend({
|
2013-06-21 04:43:58 +03:00
|
|
|
|
2013-06-25 02:41:59 +03:00
|
|
|
controller: new Controller(),
|
2013-06-21 04:43:58 +03:00
|
|
|
appRoutes : {
|
2013-06-26 04:00:56 +03:00
|
|
|
'' : 'series',
|
|
|
|
'series' : 'series',
|
|
|
|
'addseries' : 'addSeries',
|
|
|
|
'addseries/:action(/:query)': 'addSeries',
|
|
|
|
'series/:query' : 'seriesDetails',
|
|
|
|
'calendar' : 'calendar',
|
|
|
|
'settings' : 'settings',
|
|
|
|
'settings/:action(/:query)' : 'settings',
|
|
|
|
'missing' : 'missing',
|
|
|
|
'history' : 'history',
|
|
|
|
'logs' : 'logs',
|
2013-07-29 02:13:14 +03:00
|
|
|
'logs/:action' : 'logs',
|
2013-06-26 04:00:56 +03:00
|
|
|
'rss' : 'rss',
|
2013-07-28 23:20:26 +03:00
|
|
|
'system' : 'system',
|
2013-08-05 12:09:41 +03:00
|
|
|
'seasonpass' : 'seasonPass',
|
2013-06-26 04:00:56 +03:00
|
|
|
':whatever' : 'notFound'
|
2013-06-21 04:43:58 +03:00
|
|
|
}
|
|
|
|
});
|
2013-06-21 08:19:41 +03:00
|
|
|
|
2013-06-25 02:41:59 +03:00
|
|
|
App.addInitializer(function () {
|
2013-06-21 08:19:41 +03:00
|
|
|
|
2013-06-25 02:41:59 +03:00
|
|
|
App.Router = new Router();
|
2013-06-21 08:19:41 +03:00
|
|
|
|
2013-08-06 05:29:34 +03:00
|
|
|
SeriesCollection.fetch().done(function () {
|
2013-09-11 09:33:47 +03:00
|
|
|
Backbone.history.start({ pushState: true });
|
|
|
|
RouterBinder.bind(App.Router);
|
|
|
|
App.navbarRegion.show(new NavbarView());
|
|
|
|
$('body').addClass('started');
|
|
|
|
});
|
2013-06-21 08:19:41 +03:00
|
|
|
});
|
|
|
|
|
2013-06-25 02:41:59 +03:00
|
|
|
return App.Router;
|
2013-06-21 08:19:41 +03:00
|
|
|
|
2013-06-21 04:43:58 +03:00
|
|
|
});
|
|
|
|
|