1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-31 07:52:37 +01:00
Sonarr/UI/app.js

259 lines
6.1 KiB
JavaScript
Raw Normal View History

"use strict";
require.config({
2013-06-21 03:43:58 +02:00
urlArgs: 'v=' + window.ServerStatus.version,
paths: {
2013-06-19 03:02:23 +02:00
'backbone' : 'JsLibraries/backbone',
'sugar' : 'JsLibraries/sugar',
2013-06-19 03:02:23 +02:00
'handlebars' : 'JsLibraries/handlebars.runtime',
'bootstrap' : 'JsLibraries/bootstrap',
'bootstrap.slider' : 'JsLibraries/bootstrap.slider',
'backbone.mutators' : 'JsLibraries/backbone.mutators',
'backbone.deepmodel' : 'JsLibraries/backbone.deep.model',
'backbone.pageable' : 'JsLibraries/backbone.pageable',
'backbone.modelbinder': 'JsLibraries/backbone.modelbinder',
'backgrid' : 'JsLibraries/backbone.backgrid',
'backgrid.paginator' : 'JsLibraries/backbone.backgrid.paginator',
'fullcalendar' : 'JsLibraries/fullcalendar',
'backstrech' : 'JsLibraries/jquery.backstretch',
'$' : 'JsLibraries/jquery',
'underscore' : 'JsLibraries/underscore',
'marionette' : 'JsLibraries/backbone.marionette',
'signalR' : 'JsLibraries/jquery.signalR',
'libs' : 'JsLibraries/'
2013-06-21 03:43:58 +02:00
2013-01-26 21:05:08 +01:00
},
shim: {
$: {
exports: '$',
init : function () {
window.Constants = {
ApiRoot: '/api'
};
}
},
bootstrap: {
deps:
[
'$'
]
},
'bootstrap.slider': {
deps:
[
'$'
]
},
backstrech: {
deps:
[
'$'
]
},
'underscore': {
deps :
[
'$'
],
2013-06-15 07:28:35 +02:00
exports: '_'
},
backbone: {
deps :
[
'underscore',
'$'
],
2013-06-15 07:28:35 +02:00
exports: 'Backbone'
},
2013-06-15 07:28:35 +02:00
'backbone.deepmodel': {
deps:
[
'mixins/underscore.mixin.deepExtend'
]
},
marionette: {
deps:
[
'backbone',
'handlebars',
'mixins/backbone.marionette.templates',
'mixins/AsNamedView',
'Handlebars/Helpers/DateTime'
],
exports: 'Marionette',
init : function (Backbone, Handlebars, TemplateMixin, AsNamedView, DateTimeHelpers) {
2013-06-15 07:28:35 +02:00
TemplateMixin.call(Marionette.TemplateCache);
2013-06-19 03:02:23 +02:00
AsNamedView.call(Marionette.ItemView.prototype);
DateTimeHelpers.register(Handlebars);
}
},
signalR: {
deps:
[
'$'
]
2013-06-14 02:41:46 +02:00
},
'backbone.pageable': {
deps:
[
'backbone'
]
},
backgrid : {
deps:
[
'backbone'
],
init: function () {
Backgrid.Column.prototype.defaults = {
name : undefined,
label : undefined,
sortable : true,
editable : false,
renderable: true,
formatter : undefined,
cell : undefined,
headerCell: 'nzbDrone'
};
}
},
'backgrid.paginator': {
deps:
[
'backgrid'
]
}
2013-01-28 19:06:54 +01:00
}
2013-01-26 21:05:08 +01:00
});
define(
[
'marionette',
'shared/modal/region',
2013-06-21 03:43:58 +02:00
'router',
'Instrumentation/StringFormat',
'Instrumentation/ErrorHandler'
2013-06-21 03:43:58 +02:00
], function (Marionette, ModalRegion, Router, RouteBinder) {
require(
[
'libs/backbone.mutators'
]);
2013-06-15 07:28:35 +02:00
window.NzbDrone = new Marionette.Application();
window.NzbDrone.Config = {};
window.NzbDrone.Form = {};
2013-05-12 01:39:32 +02:00
window.NzbDrone.Series = {
Index : {
Table : {},
List : {},
Posters: {}
2013-05-12 01:39:32 +02:00
},
Edit : {},
Delete : {},
Details: {}
};
2013-05-12 01:39:32 +02:00
window.NzbDrone.AddSeries = {
New : {},
Existing : {},
RootFolders: {}
};
2013-05-12 01:39:32 +02:00
window.NzbDrone.Episode = {
Search : {},
Summary : {},
Activity: {}
};
window.NzbDrone.Quality = {};
2013-05-12 01:39:32 +02:00
window.NzbDrone.Commands = {};
2013-05-12 01:39:32 +02:00
window.NzbDrone.Shared = {
Toolbar : {},
Messenger : {},
FormatHelpers: {},
Grid : {}
};
window.NzbDrone.Cells = {};
window.NzbDrone.Calendar = {};
2013-05-12 01:39:32 +02:00
window.NzbDrone.Missing = {};
window.NzbDrone.History = {};
window.NzbDrone.Logs = {};
window.NzbDrone.Release = {};
window.NzbDrone.Mixins = {};
2013-03-04 01:09:43 +01:00
window.NzbDrone.Events = {
SeriesAdded: 'seriesAdded'
};
2013-02-16 01:49:25 +01:00
window.NzbDrone.Commands = {
SaveSettings: 'saveSettings'
};
2013-04-25 06:27:49 +02:00
window.NzbDrone.Constants = {
ApiRoot: '/api'
};
window.NzbDrone.addInitializer(function () {
console.log('starting application');
});
NzbDrone.addRegions({
mainRegion : '#main-region',
notificationRegion: '#notification-region',
modalRegion : ModalRegion,
footerRegion : '#footer-region'
});
window.NzbDrone.start();
2013-06-21 03:43:58 +02:00
NzbDrone.Router = new Router();
Backbone.history.start({ pushState: true });
RouteBinder.bind(NzbDrone.Router);
//NzbDrone.footerRegion.show(new FooterView());
window.require(
[
'Routing'
]);
return NzbDrone;
});