1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/UI/app.js

217 lines
5.3 KiB
JavaScript
Raw Normal View History

2013-06-25 07:43:16 +03:00
'use strict';
require.config({
2013-06-21 04:43:58 +03:00
urlArgs: 'v=' + window.ServerStatus.version,
paths: {
2013-06-19 04:02:23 +03:00
'backbone' : 'JsLibraries/backbone',
'sugar' : 'JsLibraries/sugar',
2013-07-14 05:40:47 +03:00
'moment' : 'JsLibraries/moment',
2013-06-19 04:02:23 +03:00
'handlebars' : 'JsLibraries/handlebars.runtime',
2013-06-27 03:29:48 +03:00
'handlebars.helpers' : 'JsLibraries/handlebars.helpers',
2013-06-19 04:02:23 +03:00
'bootstrap' : 'JsLibraries/bootstrap',
'backbone.mutators' : 'JsLibraries/backbone.mutators',
'backbone.mutators.deep.model': 'JsLibraries/backbone.mutators.deep.model',
2013-06-19 04:02:23 +03:00
'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',
2013-06-25 08:14:12 +03:00
'underscore' : 'JsLibraries/lodash.underscore',
2013-06-19 04:02:23 +03:00
'marionette' : 'JsLibraries/backbone.marionette',
'signalR' : 'JsLibraries/jquery.signalR',
'jquery.knob' : 'JsLibraries/jquery.knob',
2013-06-19 04:02:23 +03:00
'libs' : 'JsLibraries/'
2013-06-21 04:43:58 +03:00
2013-01-26 23:05:08 +03:00
},
shim: {
$: {
2013-06-25 08:47:56 +03:00
exports: '$',
init: function () {
require(
[
'jQuery/ToTheTop',
'Instrumentation/ErrorHandler'
2013-06-25 08:47:56 +03:00
]);
}
2013-06-25 08:47:56 +03:00
},
2013-06-25 07:43:16 +03:00
signalR: {
deps:
[
'$'
]
},
bootstrap: {
deps:
[
'$'
]
},
backstrech: {
deps:
[
'$'
]
},
2013-06-25 07:43:16 +03:00
underscore: {
deps :
[
'$'
],
2013-06-15 08:28:35 +03:00
exports: '_'
},
backbone: {
deps :
[
2013-06-21 08:35:56 +03:00
'mixins/backbone.ajax',
'underscore',
'$'
],
2013-06-21 08:35:56 +03:00
exports: 'Backbone',
init : function (AjaxMixin) {
AjaxMixin.apply(Backbone);
}
2013-06-15 08:28:35 +03:00
},
2013-06-15 08:28:35 +03:00
'backbone.deepmodel': {
deps:
[
'mixins/underscore.mixin.deepExtend'
]
},
marionette: {
deps:
[
'backbone',
2013-06-21 08:35:56 +03:00
'Handlebars/backbone.marionette.templates',
2013-06-25 07:43:16 +03:00
'mixins/AsNamedView'
],
exports: 'Marionette',
2013-06-25 07:43:16 +03:00
init : function (Backbone, TemplateMixin, AsNamedView) {
2013-06-15 08:28:35 +03:00
TemplateMixin.call(Marionette.TemplateCache);
2013-06-19 04:02:23 +03:00
AsNamedView.call(Marionette.ItemView.prototype);
}
},
'jquery.knob': {
deps:
[
'$'
]
},
'backbone.pageable': {
deps:
[
'backbone'
]
},
backgrid : {
deps:
[
'backbone'
],
2013-06-21 08:35:56 +03:00
exports: 'Backgrid',
init: function () {
require(
[
'Shared/Grid/HeaderCell'
], function () {
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'
]
}
2013-01-28 21:06:54 +03:00
}
2013-01-26 23:05:08 +03:00
});
define(
[
'marionette',
'shared/modal/region',
'Instrumentation/StringFormat',
2013-06-21 08:19:41 +03:00
], function (Marionette, ModalRegion) {
require(
[
'libs/backbone.mutators',
'libs/backbone.mutators.deep.model'
]);
2013-06-15 08:28:35 +03:00
var app = new Marionette.Application();
2013-05-12 02:39:32 +03:00
app.Events = {
SeriesAdded: 'seriesAdded'
};
2013-02-16 03:49:25 +03:00
app.Commands = {
SaveSettings: 'saveSettings'
};
2013-04-25 07:27:49 +03:00
app.addInitializer(function () {
console.log('starting application');
});
app.addRegions({
mainRegion : '#main-region',
modalRegion : ModalRegion,
footerRegion : '#footer-region'
});
app.start();
2013-06-21 04:43:58 +03:00
window.require(
[
'Router',
'jQuery/TooltipBinder'
]);
return app;
});