You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
968 B
59 lines
968 B
NzbDrone = new Backbone.Marionette.Application();
|
|
|
|
NzbDrone.Constants = {
|
|
|
|
|
|
};
|
|
|
|
NzbDrone.Events = {
|
|
DisplayInMainRegion: "DisplayInMainRegion",
|
|
};
|
|
|
|
|
|
NzbDrone.Routes = {
|
|
Series: {
|
|
Add: 'series/add',
|
|
|
|
},
|
|
};
|
|
|
|
|
|
NzbDrone.Controller = Backbone.Marionette.Controller.extend({
|
|
|
|
addSeries: function () {
|
|
NzbDrone.mainRegion.show(new NzbDrone.AddSeriesView());
|
|
},
|
|
|
|
|
|
notFound: function () {
|
|
alert('route not found');
|
|
},
|
|
});
|
|
|
|
|
|
NzbDrone.MyRouter = Backbone.Marionette.AppRouter.extend({
|
|
|
|
controller: new NzbDrone.Controller(),
|
|
// "someMethod" must exist at controller.someMethod
|
|
appRoutes: {
|
|
"series/add": "addSeries",
|
|
":whatever": "notFound"
|
|
|
|
}
|
|
|
|
});
|
|
|
|
NzbDrone.addInitializer(function (options) {
|
|
|
|
console.log("starting application");
|
|
|
|
|
|
NzbDrone.addRegions({
|
|
mainRegion: "#main-region",
|
|
});
|
|
|
|
NzbDrone.Router = new NzbDrone.MyRouter();
|
|
Backbone.history.start();
|
|
|
|
|
|
}); |