2013-01-23 04:23:27 +03:00
|
|
|
/// <reference path="JsLibraries/jquery.js" />
|
2013-01-23 02:58:08 +03:00
|
|
|
/// <reference path="JsLibraries/underscore.js" />
|
2013-01-25 20:54:45 +03:00
|
|
|
/// <reference path="JsLibraries/sugar.js" />
|
2013-01-23 02:58:08 +03:00
|
|
|
/// <reference path="JsLibraries/backbone.js" />
|
2013-01-25 22:04:37 +03:00
|
|
|
/// <reference path="JsLibraries/handlebars.js" />
|
2013-01-23 08:48:22 +03:00
|
|
|
/// <reference path="JsLibraries/backbone.modelbinder.js" />
|
2013-01-25 20:54:45 +03:00
|
|
|
/// <reference path="JsLibraries/backbone.mutators.js" />
|
|
|
|
/// <reference path="JsLibraries/backbone.shortcuts.js" />
|
2013-01-23 02:58:08 +03:00
|
|
|
/// <reference path="JsLibraries/backbone.marionette.js" />
|
|
|
|
/// <reference path="JsLibraries/backbone.marionette.extend.js" />
|
2013-01-27 05:14:42 +03:00
|
|
|
/// <reference path="JsLibraries/backbone.marionette.viewswapper.js" />
|
2013-01-23 08:48:22 +03:00
|
|
|
/// <reference path="JsLibraries/backbone.modelbinder.js" />
|
2013-01-23 02:58:08 +03:00
|
|
|
/// <reference path="JsLibraries/bootstrap.js" />
|
|
|
|
|
2013-01-30 09:52:31 +03:00
|
|
|
if (typeof console === undefined) {
|
2013-01-23 03:34:00 +03:00
|
|
|
window.console = { log: function () { } };
|
|
|
|
}
|
2013-01-23 02:58:08 +03:00
|
|
|
|
|
|
|
NzbDrone = new Backbone.Marionette.Application();
|
2013-01-30 09:52:31 +03:00
|
|
|
NzbDrone.Series = NzbDrone.module('Series');
|
|
|
|
NzbDrone.AddSeries = NzbDrone.module('AddSeries');
|
|
|
|
NzbDrone.Quality = NzbDrone.module('Quality');
|
|
|
|
NzbDrone.Shared = NzbDrone.module('Shared');
|
2013-01-22 08:40:26 +03:00
|
|
|
|
2013-01-27 05:14:42 +03:00
|
|
|
/*
|
2013-01-25 22:04:37 +03:00
|
|
|
_.templateSettings = {
|
|
|
|
interpolate: /\{\{([\s\S]+?)\}\}/g
|
|
|
|
};
|
2013-01-27 05:14:42 +03:00
|
|
|
*/
|
2013-01-25 22:04:37 +03:00
|
|
|
|
2013-01-23 08:48:22 +03:00
|
|
|
NzbDrone.ModelBinder = new Backbone.ModelBinder();
|
2013-01-23 08:03:57 +03:00
|
|
|
|
|
|
|
|
2013-01-22 08:40:26 +03:00
|
|
|
NzbDrone.Constants = {
|
2013-01-27 06:04:15 +03:00
|
|
|
ApiRoot: '/api'
|
2013-01-22 08:40:26 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
NzbDrone.Events = {
|
2013-01-30 09:52:31 +03:00
|
|
|
DisplayInMainRegion: 'DisplayInMainRegion'
|
2013-01-22 08:40:26 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-01-26 23:05:08 +03:00
|
|
|
NzbDrone.Controller = Backbone.Marionette.Controller.extend({
|
2013-01-22 08:40:26 +03:00
|
|
|
|
2013-01-29 05:00:35 +03:00
|
|
|
addSeries: function (action, query) {
|
|
|
|
NzbDrone.mainRegion.show(new NzbDrone.AddSeries.AddSeriesLayout(this, action, query));
|
2013-01-26 23:05:08 +03:00
|
|
|
},
|
2013-01-22 08:40:26 +03:00
|
|
|
|
|
|
|
|
2013-01-26 23:05:08 +03:00
|
|
|
notFound: function () {
|
|
|
|
alert('route not found');
|
2013-01-28 21:06:54 +03:00
|
|
|
}
|
2013-01-26 23:05:08 +03:00
|
|
|
});
|
2013-01-22 08:40:26 +03:00
|
|
|
|
|
|
|
|
2013-01-25 03:02:53 +03:00
|
|
|
NzbDrone.Router = Backbone.Marionette.AppRouter.extend({
|
2013-01-22 08:40:26 +03:00
|
|
|
|
|
|
|
controller: new NzbDrone.Controller(),
|
|
|
|
// "someMethod" must exist at controller.someMethod
|
|
|
|
appRoutes: {
|
2013-01-30 09:52:31 +03:00
|
|
|
'series/add': 'addSeries',
|
|
|
|
'series/add/:action(/:query)': 'addSeries',
|
|
|
|
':whatever': 'notFound'
|
2013-01-22 08:40:26 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
NzbDrone.addInitializer(function (options) {
|
|
|
|
|
2013-01-30 09:52:31 +03:00
|
|
|
console.log('starting application');
|
2013-01-22 08:40:26 +03:00
|
|
|
|
|
|
|
|
|
|
|
NzbDrone.addRegions({
|
2013-01-30 09:52:31 +03:00
|
|
|
mainRegion: '#main-region',
|
|
|
|
notificationRegion: '#notification-region'
|
2013-01-22 08:40:26 +03:00
|
|
|
});
|
|
|
|
|
2013-01-25 03:02:53 +03:00
|
|
|
NzbDrone.Router = new NzbDrone.Router();
|
2013-01-22 08:40:26 +03:00
|
|
|
Backbone.history.start();
|
|
|
|
|
|
|
|
|
|
|
|
});
|