1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-28 19:05:55 +00:00
Radarr/NzbDrone.Backbone/app.js

77 lines
1.7 KiB
JavaScript
Raw Normal View History

2013-01-18 22:05:38 +00:00
NzbDrone = new Backbone.Marionette.Application();
NzbDrone.Constants = {
};
NzbDrone.Events = {
DisplayInMainRegion: "DisplayInMainRegion",
};
NzbDrone.Routes = {
Series: {
Add: 'series/add',
AddNew: 'series/addnew',
AddExisting: 'series/addExisting',
AddExistingSingle: 'series/addExisting/single',
AddExistingMultiple: 'series/addExisting/multiple',
},
};
NzbDrone.Controller = Backbone.Marionette.Controller.extend({
2013-01-18 22:05:52 +00:00
AddSeries: function () {
NzbDrone.mainRegion.show(new NzbDrone.AddSeriesView());
2013-01-18 22:05:52 +00:00
},
AddNewSeries: function () {
NzbDrone.mainRegion.show(new NzbDrone.AddNewSeriesView());
2013-01-18 22:05:52 +00:00
},
2013-01-18 22:05:52 +00:00
AddExistingSeries: function () {
NzbDrone.mainRegion.show(new NzbDrone.AddExistingSeriesView());
},
AddExistingSeriesSingle: function () {
NzbDrone.mainRegion.show(new NzbDrone.AddExistingSeriesSingleView());
},
AddExistingSeriesMultiple: function () {
NzbDrone.mainRegion.show(new NzbDrone.AddExistingSeriesMultipleView());
},
});
2013-01-18 22:05:52 +00:00
2013-01-18 22:05:38 +00:00
NzbDrone.MyRouter = Backbone.Marionette.AppRouter.extend({
controller: new NzbDrone.Controller(),
2013-01-18 22:05:38 +00:00
// "someMethod" must exist at controller.someMethod
appRoutes: {
"series/add": "AddSeries",
"series/addnew": "AddNewSeries",
"series/addExisting": "AddExistingSeries",
"series/addExisting/single": "AddExistingSeriesSingle",
"series/addExisting/multiple": "AddExistingSeriesMultiple",
2013-01-18 22:05:38 +00:00
}
});
NzbDrone.addInitializer(function (options) {
2013-01-18 22:05:52 +00:00
console.log("starting application");
2013-01-18 22:05:52 +00:00
NzbDrone.addRegions({
mainRegion: "#main-region",
});
2013-01-18 22:05:52 +00:00
NzbDrone.Router = new NzbDrone.MyRouter();
2013-01-18 22:05:38 +00:00
Backbone.history.start();
2013-01-18 22:05:52 +00:00
2013-01-18 22:05:38 +00:00
});