1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-18 23:48:35 +02:00
Sonarr/src/UI/app.js

235 lines
6.0 KiB
JavaScript
Raw Normal View History

2013-06-25 07:43:16 +03:00
'use strict';
require.config({
paths: {
2013-06-19 04:02:23 +03:00
'backbone' : 'JsLibraries/backbone',
2013-07-14 05:40:47 +03:00
'moment' : 'JsLibraries/moment',
'filesize' : 'JsLibraries/filesize',
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.deepmodel' : 'JsLibraries/backbone.deep.model',
'backbone.pageable' : 'JsLibraries/backbone.pageable',
'backbone.validation' : 'JsLibraries/backbone.validation',
2013-06-19 04:02:23 +03:00
'backbone.modelbinder': 'JsLibraries/backbone.modelbinder',
'backgrid' : 'JsLibraries/backbone.backgrid',
'backgrid.paginator' : 'JsLibraries/backbone.backgrid.paginator',
2013-10-09 04:43:41 +03:00
'backgrid.selectall' : 'JsLibraries/backbone.backgrid.selectall',
2013-06-19 04:02:23 +03:00
'fullcalendar' : 'JsLibraries/fullcalendar',
'backstrech' : 'JsLibraries/jquery.backstretch',
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',
'jquery.dotdotdot' : 'JsLibraries/jquery.dotdotdot',
2013-11-11 06:11:42 +03:00
'jquery' : 'jQuery/jquery.shim',
2013-10-09 04:43:41 +03:00
'libs' : 'JsLibraries/',
'api': 'Require/require.api'
2013-01-26 23:05:08 +03:00
},
shim: {
2013-11-11 00:33:44 +03:00
jquery :{
exports: '$'
},
2013-06-25 07:43:16 +03:00
signalR: {
deps:
[
2013-10-09 04:43:41 +03:00
'jquery'
2013-06-25 07:43:16 +03:00
]
},
bootstrap: {
deps:
[
2013-10-09 04:43:41 +03:00
'jquery'
],
init: function ($) {
$('body').tooltip({
selector: '[title]'
});
}
},
backstrech: {
deps:
[
2013-10-09 04:43:41 +03:00
'jquery'
]
},
2013-06-25 07:43:16 +03:00
underscore: {
deps :
[
2013-10-09 04:43:41 +03:00
'jquery'
],
2013-06-15 08:28:35 +03:00
exports: '_'
},
backbone: {
deps:
[
'jquery',
'underscore',
'Mixins/jquery.ajax',
'jQuery/ToTheTop'
],
2013-09-20 10:31:02 +03:00
exports: 'Backbone'
2013-06-15 08:28:35 +03:00
},
marionette: {
deps:
[
'backbone',
2013-06-21 08:35:56 +03:00
'Handlebars/backbone.marionette.templates',
'Mixins/AsNamedView'
],
exports: 'Marionette',
2013-06-25 07:43:16 +03:00
init : function (Backbone, TemplateMixin, AsNamedView) {
2013-11-11 07:09:11 +03:00
TemplateMixin.call(window.Marionette.TemplateCache);
AsNamedView.call(window.Marionette.ItemView.prototype);
}
},
'jquery.knob': {
deps:
[
2013-10-09 04:43:41 +03:00
'jquery'
]
},
'jquery.dotdotdot': {
deps:
[
2013-10-09 04:43:41 +03: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-21 08:35:56 +03:00
exports: 'Backgrid',
init: function () {
require(
[
'Shared/Grid/HeaderCell'
], function () {
2013-11-11 07:09:11 +03: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 21:06:54 +03:00
}
2013-01-26 23:05:08 +03:00
});
2013-10-09 04:43:41 +03:00
require.config({
urlArgs: 'v=' + window.NzbDrone.ServerStatus.version
});
define(
[
'jquery',
2013-10-09 04:43:41 +03:00
'backbone',
'marionette',
2013-10-09 04:43:41 +03:00
'jQuery/RouteBinder',
2013-09-11 09:33:47 +03:00
'Shared/SignalRBroadcaster',
2013-10-09 04:43:41 +03: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-09 04:43:41 +03:00
new SeriesController();
new ModalController();
new Router();
2013-05-12 02:39:32 +03:00
2013-10-09 04:43:41 +03:00
var app = new Marionette.Application();
app.addInitializer(function () {
console.log('starting application');
});
2013-10-09 04:43:41 +03:00
app.addInitializer(SignalRBroadcaster.appInitializer, {
app: app
});
2013-09-11 09:33:47 +03:00
2013-10-09 04:43:41 +03:00
app.addInitializer(function () {
Backbone.history.start({ pushState: true });
RouteBinder.bind();
AppLayout.navbarRegion.show(new NavbarView());
$('body').addClass('started');
});
app.start();
});