1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-07-03 00:47:10 +02:00
Files
Sonarr/src/UI/app.js

235 lines
6.0 KiB
JavaScript
Raw Normal View History

2013-06-24 21:43:16 -07:00
'use strict';
require.config({
paths: {
2013-06-18 18:02:23 -07:00
'backbone' : 'JsLibraries/backbone',
2013-07-13 19:40:47 -07:00
'moment' : 'JsLibraries/moment',
'filesize' : 'JsLibraries/filesize',
2013-06-18 18:02:23 -07:00
'handlebars' : 'JsLibraries/handlebars.runtime',
2013-06-26 17:29:48 -07:00
'handlebars.helpers' : 'JsLibraries/handlebars.helpers',
2013-06-18 18:02:23 -07:00
'bootstrap' : 'JsLibraries/bootstrap',
'backbone.deepmodel' : 'JsLibraries/backbone.deep.model',
'backbone.pageable' : 'JsLibraries/backbone.pageable',
'backbone.validation' : 'JsLibraries/backbone.validation',
2013-06-18 18:02:23 -07:00
'backbone.modelbinder': 'JsLibraries/backbone.modelbinder',
'backgrid' : 'JsLibraries/backbone.backgrid',
'backgrid.paginator' : 'JsLibraries/backbone.backgrid.paginator',
2013-10-08 18:43:41 -07:00
'backgrid.selectall' : 'JsLibraries/backbone.backgrid.selectall',
2013-06-18 18:02:23 -07:00
'fullcalendar' : 'JsLibraries/fullcalendar',
'backstrech' : 'JsLibraries/jquery.backstretch',
2013-06-24 22:14:12 -07:00
'underscore' : 'JsLibraries/lodash.underscore',
2013-06-18 18:02:23 -07:00
'marionette' : 'JsLibraries/backbone.marionette',
'signalR' : 'JsLibraries/jquery.signalR',
'jquery.knob' : 'JsLibraries/jquery.knob',
'jquery.dotdotdot' : 'JsLibraries/jquery.dotdotdot',
2013-11-10 19:11:42 -08:00
'jquery' : 'jQuery/jquery.shim',
2013-10-08 18:43:41 -07:00
'libs' : 'JsLibraries/',
'api': 'Require/require.api'
2013-01-26 12:05:08 -08:00
},
shim: {
2013-11-10 13:33:44 -08:00
jquery :{
exports: '$'
},
2013-06-24 21:43:16 -07:00
signalR: {
deps:
[
2013-10-08 18:43:41 -07:00
'jquery'
2013-06-24 21:43:16 -07:00
]
},
bootstrap: {
deps:
[
2013-10-08 18:43:41 -07:00
'jquery'
],
init: function ($) {
$('body').tooltip({
selector: '[title]'
});
}
},
backstrech: {
deps:
[
2013-10-08 18:43:41 -07:00
'jquery'
]
},
2013-06-24 21:43:16 -07:00
underscore: {
deps :
[
2013-10-08 18:43:41 -07:00
'jquery'
],
2013-06-14 22:28:35 -07:00
exports: '_'
},
backbone: {
deps:
[
'jquery',
'underscore',
'Mixins/jquery.ajax',
'jQuery/ToTheTop'
],
2013-09-20 00:31:02 -07:00
exports: 'Backbone'
2013-06-14 22:28:35 -07:00
},
marionette: {
deps:
[
'backbone',
2013-06-20 22:35:56 -07:00
'Handlebars/backbone.marionette.templates',
'Mixins/AsNamedView'
],
exports: 'Marionette',
2013-06-24 21:43:16 -07:00
init : function (Backbone, TemplateMixin, AsNamedView) {
2013-11-10 20:09:11 -08:00
TemplateMixin.call(window.Marionette.TemplateCache);
AsNamedView.call(window.Marionette.ItemView.prototype);
}
},
'jquery.knob': {
deps:
[
2013-10-08 18:43:41 -07:00
'jquery'
]
},
'jquery.dotdotdot': {
deps:
[
2013-10-08 18:43:41 -07:00
'jquery'
]
},
'backbone.pageable': {
deps:
[
'backbone'
]
},
'backbone.deepmodel': {
deps:
[
'backbone',
'underscore'
]
},
'backbone.validation': {
deps :
[
'backbone'
],
exports: 'Backbone.Validation'
},
'backbone.modelbinder':{
deps :
[
'backbone'
]
},
backgrid : {
deps:
[
'backbone'
],
2013-06-20 22:35:56 -07:00
exports: 'Backgrid',
init: function () {
require(
[
'Shared/Grid/HeaderCell'
], function () {
2013-11-10 20:09:11 -08:00
window.Backgrid.Column.prototype.defaults = {
name : undefined,
label : undefined,
sortable : true,
editable : false,
renderable: true,
formatter : undefined,
cell : undefined,
headerCell: 'NzbDrone'
};
});
}
},
'backgrid.paginator': {
exports: 'Backgrid.Extension.Paginator',
deps:
[
'backgrid'
]
},
'backgrid.selectall': {
exports: 'Backgrid.Extension.SelectAll',
deps:
[
'backgrid'
]
}
2013-01-28 10:06:54 -08:00
}
2013-01-26 12:05:08 -08:00
});
2013-10-08 18:43:41 -07:00
require.config({
urlArgs: 'v=' + window.NzbDrone.ServerStatus.version
});
define(
[
'jquery',
2013-10-08 18:43:41 -07:00
'backbone',
'marionette',
2013-10-08 18:43:41 -07:00
'jQuery/RouteBinder',
2013-09-10 23:33:47 -07:00
'Shared/SignalRBroadcaster',
2013-10-08 18:43:41 -07:00
'Navbar/NavbarView',
'AppLayout',
'Series/SeriesController',
'Router',
'Shared/Modal/Controller',
'Instrumentation/StringFormat',
'LifeCycle'
], function ($, Backbone, Marionette, RouteBinder, SignalRBroadcaster, NavbarView, AppLayout, SeriesController, Router, ModalController) {
2013-10-08 18:43:41 -07:00
new SeriesController();
new ModalController();
new Router();
2013-05-11 16:39:32 -07:00
2013-10-08 18:43:41 -07:00
var app = new Marionette.Application();
app.addInitializer(function () {
console.log('starting application');
});
2013-10-08 18:43:41 -07:00
app.addInitializer(SignalRBroadcaster.appInitializer, {
app: app
});
2013-09-10 23:33:47 -07:00
2013-10-08 18:43:41 -07:00
app.addInitializer(function () {
Backbone.history.start({ pushState: true });
RouteBinder.bind();
AppLayout.navbarRegion.show(new NavbarView());
$('body').addClass('started');
});
app.start();
});