1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-01-19 10:54:05 +02:00
Sonarr/UI/Router.js

42 lines
1.3 KiB
JavaScript
Raw Normal View History

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