2013-06-26 01:00:56 +00:00
|
|
|
|
'use strict';
|
2013-06-21 01:43:58 +00:00
|
|
|
|
require(
|
|
|
|
|
[
|
2013-06-21 05:19:41 +00:00
|
|
|
|
'app',
|
2013-06-21 01:43:58 +00:00
|
|
|
|
'marionette',
|
2013-06-21 05:19:41 +00:00
|
|
|
|
'Controller',
|
2013-06-21 06:01:00 +00:00
|
|
|
|
'jQuery/RouteBinder'
|
2013-06-21 05:19:41 +00:00
|
|
|
|
], function (App, Marionette, Controller, RouterBinder) {
|
2013-06-21 01:43:58 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
var Router = Marionette.AppRouter.extend({
|
2013-06-21 01:43:58 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
controller: new Controller(),
|
2013-06-21 01:43:58 +00:00
|
|
|
|
appRoutes : {
|
2013-06-26 01:00:56 +00: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',
|
|
|
|
|
'rss' : 'rss',
|
2013-07-28 20:20:26 +00:00
|
|
|
|
'system' : 'system',
|
2013-06-26 01:00:56 +00:00
|
|
|
|
':whatever' : 'notFound'
|
2013-06-21 01:43:58 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
2013-06-21 05:19:41 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
App.addInitializer(function () {
|
2013-06-21 05:19:41 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
App.Router = new Router();
|
2013-06-21 05:19:41 +00:00
|
|
|
|
Backbone.history.start({ pushState: true });
|
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
RouterBinder.bind(App.Router);
|
2013-06-21 05:19:41 +00:00
|
|
|
|
});
|
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
return App.Router;
|
2013-06-21 05:19:41 +00:00
|
|
|
|
|
2013-06-21 01:43:58 +00:00
|
|
|
|
});
|
|
|
|
|
|