///
///
///
///
///
///
///
///
///
///
///
///
///
if (typeof console === undefined) {
window.console = { log: function () { } };
}
NzbDrone = new Backbone.Marionette.Application();
NzbDrone.Series = NzbDrone.module('Series');
NzbDrone.AddSeries = NzbDrone.module('AddSeries');
NzbDrone.Quality = NzbDrone.module('Quality');
NzbDrone.Shared = NzbDrone.module('Shared');
/*
_.templateSettings = {
interpolate: /\{\{([\s\S]+?)\}\}/g
};
*/
NzbDrone.ModelBinder = new Backbone.ModelBinder();
NzbDrone.Constants = {
ApiRoot: '/api'
};
NzbDrone.Events = {
DisplayInMainRegion: 'DisplayInMainRegion'
};
NzbDrone.Controller = Backbone.Marionette.Controller.extend({
addSeries: function (action, query) {
NzbDrone.mainRegion.show(new NzbDrone.AddSeries.AddSeriesLayout(this, action, query));
},
notFound: function () {
alert('route not found');
}
});
NzbDrone.Router = Backbone.Marionette.AppRouter.extend({
controller: new NzbDrone.Controller(),
// "someMethod" must exist at controller.someMethod
appRoutes: {
'series/add': 'addSeries',
'series/add/:action(/:query)': 'addSeries',
':whatever': 'notFound'
}
});
NzbDrone.addInitializer(function (options) {
console.log('starting application');
NzbDrone.addRegions({
mainRegion: '#main-region',
notificationRegion: '#notification-region'
});
NzbDrone.Router = new NzbDrone.Router();
Backbone.history.start();
});