mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-23 02:05:27 +02:00
39 lines
1015 B
JavaScript
39 lines
1015 B
JavaScript
|
require(['app', 'AddSeries/AddSeriesLayout'], function () {
|
||
|
|
||
|
NzbDrone.Controller = Backbone.Marionette.Controller.extend({
|
||
|
|
||
|
addSeries: function (action, query) {
|
||
|
NzbDrone.mainRegion.show(new NzbDrone.AddSeries.AddSeriesLayout(this, action, query));
|
||
|
},
|
||
|
|
||
|
series: function (action, query) {
|
||
|
NzbDrone.mainRegion.show(new NzbDrone.Series.IndexLayout(this, action, query));
|
||
|
},
|
||
|
|
||
|
notFound: function () {
|
||
|
alert('route not found');
|
||
|
}
|
||
|
});
|
||
|
|
||
|
NzbDrone.Router = Backbone.Marionette.AppRouter.extend({
|
||
|
|
||
|
controller: new NzbDrone.Controller(),
|
||
|
appRoutes: {
|
||
|
'series': 'series',
|
||
|
'series/index': 'series',
|
||
|
'series/add': 'addSeries',
|
||
|
'series/add/:action(/:query)': 'addSeries',
|
||
|
':whatever': 'notFound'
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
NzbDrone.addInitializer(function () {
|
||
|
|
||
|
NzbDrone.Router = new NzbDrone.Router();
|
||
|
Backbone.history.start();
|
||
|
|
||
|
});
|
||
|
});
|
||
|
|