2013-02-15 02:40:29 +00:00
|
|
|
|
require(['app','Shared/NotificationView', 'AddSeries/AddSeriesLayout','Series/SeriesCollectionView'], function () {
|
2013-02-14 02:28:56 +00:00
|
|
|
|
|
|
|
|
|
NzbDrone.Controller = Backbone.Marionette.Controller.extend({
|
|
|
|
|
|
|
|
|
|
addSeries: function (action, query) {
|
|
|
|
|
NzbDrone.mainRegion.show(new NzbDrone.AddSeries.AddSeriesLayout(this, action, query));
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
series: function (action, query) {
|
2013-02-15 02:40:29 +00:00
|
|
|
|
NzbDrone.mainRegion.show(new NzbDrone.Series.SeriesCollectionView(this, action, query));
|
2013-02-14 02:28:56 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
notFound: function () {
|
|
|
|
|
alert('route not found');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
NzbDrone.Router = Backbone.Marionette.AppRouter.extend({
|
|
|
|
|
|
|
|
|
|
controller: new NzbDrone.Controller(),
|
|
|
|
|
appRoutes: {
|
2013-02-15 02:40:29 +00:00
|
|
|
|
'': 'series',
|
2013-02-14 02:28:56 +00:00
|
|
|
|
'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();
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|