sonarr-repo-only/NzbDrone.Backbone/app.js

47 lines
902 B
JavaScript
Raw Normal View History

2013-01-18 22:05:38 +00:00
NzbDrone = new Backbone.Marionette.Application();
2013-01-18 22:05:52 +00:00
NzbDrone.Controller = {
AddSeries: function () {
var view = new NzbDrone.AddSeriesView();
NzbDrone.mainRegion.show(view);
},
AddNewSeries: function () {
alert("AddNewSeries");
},
AddExistingSeries: function () {
alert("AddExistingSeries");
}
};
2013-01-18 22:05:38 +00:00
NzbDrone.MyRouter = Backbone.Marionette.AppRouter.extend({
2013-01-18 22:05:52 +00:00
controller: NzbDrone.Controller,
2013-01-18 22:05:38 +00:00
// "someMethod" must exist at controller.someMethod
appRoutes: {
"add": "AddSeries",
"add/new": "AddNewSeries",
"add/existing": "AddExistingSeries",
}
});
NzbDrone.addInitializer(function (options) {
2013-01-18 22:05:52 +00:00
console.log("starting application");
NzbDrone.addRegions({
mainRegion: "#main-region",
});
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
});