2013-01-23 01:23:27 +00:00
|
|
|
|
/// <reference path="JsLibraries/jquery.js" />
|
2013-01-22 23:58:08 +00:00
|
|
|
|
/// <reference path="JsLibraries/underscore.js" />
|
2013-01-25 17:54:45 +00:00
|
|
|
|
/// <reference path="JsLibraries/sugar.js" />
|
2013-01-22 23:58:08 +00:00
|
|
|
|
/// <reference path="JsLibraries/backbone.js" />
|
2013-01-25 19:04:37 +00:00
|
|
|
|
/// <reference path="JsLibraries/handlebars.js" />
|
2013-01-23 05:48:22 +00:00
|
|
|
|
/// <reference path="JsLibraries/backbone.modelbinder.js" />
|
2013-01-25 17:54:45 +00:00
|
|
|
|
/// <reference path="JsLibraries/backbone.mutators.js" />
|
|
|
|
|
/// <reference path="JsLibraries/backbone.shortcuts.js" />
|
2013-01-22 23:58:08 +00:00
|
|
|
|
/// <reference path="JsLibraries/backbone.marionette.js" />
|
|
|
|
|
/// <reference path="JsLibraries/backbone.marionette.extend.js" />
|
2013-01-23 05:48:22 +00:00
|
|
|
|
/// <reference path="JsLibraries/backbone.modelbinder.js" />
|
2013-01-22 23:58:08 +00:00
|
|
|
|
/// <reference path="JsLibraries/bootstrap.js" />
|
2013-01-23 01:23:27 +00:00
|
|
|
|
/// <reference path="errorHandler.js" />
|
2013-01-22 23:58:08 +00:00
|
|
|
|
|
2013-01-23 00:34:00 +00:00
|
|
|
|
if (typeof console == "undefined") {
|
|
|
|
|
window.console = { log: function () { } };
|
|
|
|
|
}
|
2013-01-22 23:58:08 +00:00
|
|
|
|
|
|
|
|
|
NzbDrone = new Backbone.Marionette.Application();
|
|
|
|
|
NzbDrone.AddSeries = NzbDrone.module("AddSeries");
|
2013-01-26 20:05:08 +00:00
|
|
|
|
NzbDrone.Shared = NzbDrone.module("Shared");
|
2013-01-22 05:40:26 +00:00
|
|
|
|
|
2013-01-25 19:04:37 +00:00
|
|
|
|
_.templateSettings = {
|
|
|
|
|
interpolate: /\{\{([\s\S]+?)\}\}/g
|
|
|
|
|
};
|
|
|
|
|
|
2013-01-23 05:48:22 +00:00
|
|
|
|
NzbDrone.ModelBinder = new Backbone.ModelBinder();
|
2013-01-23 05:03:57 +00:00
|
|
|
|
|
|
|
|
|
|
2013-01-22 05:40:26 +00:00
|
|
|
|
NzbDrone.Constants = {
|
2013-01-23 05:03:57 +00:00
|
|
|
|
ApiRoot: '/api/'
|
2013-01-22 05:40:26 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
NzbDrone.Events = {
|
|
|
|
|
DisplayInMainRegion: "DisplayInMainRegion",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NzbDrone.Routes = {
|
|
|
|
|
Series: {
|
|
|
|
|
Add: 'series/add',
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
2013-01-26 20:05:08 +00:00
|
|
|
|
NzbDrone.Controller = Backbone.Marionette.Controller.extend({
|
2013-01-22 05:40:26 +00:00
|
|
|
|
|
2013-01-26 20:05:08 +00:00
|
|
|
|
addSeries: function () {
|
|
|
|
|
NzbDrone.mainRegion.show(new NzbDrone.AddSeries.AddSeriesLayout());
|
|
|
|
|
},
|
2013-01-22 05:40:26 +00:00
|
|
|
|
|
|
|
|
|
|
2013-01-26 20:05:08 +00:00
|
|
|
|
notFound: function () {
|
|
|
|
|
alert('route not found');
|
|
|
|
|
},
|
|
|
|
|
});
|
2013-01-22 05:40:26 +00:00
|
|
|
|
|
|
|
|
|
|
2013-01-25 00:02:53 +00:00
|
|
|
|
NzbDrone.Router = Backbone.Marionette.AppRouter.extend({
|
2013-01-22 05:40:26 +00:00
|
|
|
|
|
|
|
|
|
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",
|
|
|
|
|
});
|
|
|
|
|
|
2013-01-25 00:02:53 +00:00
|
|
|
|
NzbDrone.Router = new NzbDrone.Router();
|
2013-01-22 05:40:26 +00:00
|
|
|
|
Backbone.history.start();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|