2013-06-26 03:00:56 +02:00
|
|
|
|
'use strict';
|
2013-06-21 03:43:58 +02:00
|
|
|
|
require(
|
|
|
|
|
[
|
2013-06-21 07:19:41 +02:00
|
|
|
|
'app',
|
2013-06-21 03:43:58 +02:00
|
|
|
|
'marionette',
|
2013-06-21 07:19:41 +02:00
|
|
|
|
'Controller',
|
2013-08-02 02:24:00 +02:00
|
|
|
|
'Series/SeriesCollection',
|
2013-08-02 03:02:55 +02:00
|
|
|
|
'Navbar/NavbarView',
|
2013-08-06 04:29:34 +02:00
|
|
|
|
'jQuery/RouteBinder',
|
|
|
|
|
'jquery'
|
|
|
|
|
], function (App, Marionette, Controller, SeriesCollection, NavbarView, RouterBinder, $) {
|
2013-06-21 03:43:58 +02:00
|
|
|
|
|
2013-06-25 01:41:59 +02:00
|
|
|
|
var Router = Marionette.AppRouter.extend({
|
2013-06-21 03:43:58 +02:00
|
|
|
|
|
2013-06-25 01:41:59 +02:00
|
|
|
|
controller: new Controller(),
|
2013-06-21 03:43:58 +02:00
|
|
|
|
appRoutes : {
|
2013-06-26 03:00:56 +02: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 01:13:14 +02:00
|
|
|
|
'logs/:action' : 'logs',
|
2013-06-26 03:00:56 +02:00
|
|
|
|
'rss' : 'rss',
|
2013-07-28 22:20:26 +02:00
|
|
|
|
'system' : 'system',
|
2013-08-05 11:09:41 +02:00
|
|
|
|
'seasonpass' : 'seasonPass',
|
2013-06-26 03:00:56 +02:00
|
|
|
|
':whatever' : 'notFound'
|
2013-06-21 03:43:58 +02:00
|
|
|
|
}
|
|
|
|
|
});
|
2013-06-21 07:19:41 +02:00
|
|
|
|
|
2013-06-25 01:41:59 +02:00
|
|
|
|
App.addInitializer(function () {
|
2013-06-21 07:19:41 +02:00
|
|
|
|
|
2013-06-25 01:41:59 +02:00
|
|
|
|
App.Router = new Router();
|
2013-06-21 07:19:41 +02:00
|
|
|
|
|
2013-08-06 04:29:34 +02:00
|
|
|
|
SeriesCollection.fetch().done(function () {
|
2013-08-02 02:24:00 +02:00
|
|
|
|
Backbone.history.start({ pushState: true });
|
|
|
|
|
RouterBinder.bind(App.Router);
|
2013-08-02 03:02:55 +02:00
|
|
|
|
App.navbarRegion.show(new NavbarView());
|
2013-08-06 04:29:34 +02:00
|
|
|
|
$('body').addClass('started');
|
2013-08-02 02:24:00 +02:00
|
|
|
|
})
|
2013-06-21 07:19:41 +02:00
|
|
|
|
});
|
|
|
|
|
|
2013-06-25 01:41:59 +02:00
|
|
|
|
return App.Router;
|
2013-06-21 07:19:41 +02:00
|
|
|
|
|
2013-06-21 03:43:58 +02:00
|
|
|
|
});
|
|
|
|
|
|