2013-06-25 07:43:16 +03:00
|
|
|
'use strict';
|
2013-03-29 21:37:10 +03:00
|
|
|
require.config({
|
2013-02-14 05:28:56 +03:00
|
|
|
paths: {
|
2013-06-19 04:02:23 +03:00
|
|
|
'backbone' : 'JsLibraries/backbone',
|
2013-07-14 05:40:47 +03:00
|
|
|
'moment' : 'JsLibraries/moment',
|
2013-07-17 09:23:44 +03:00
|
|
|
'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',
|
2013-08-21 04:07:48 +03:00
|
|
|
'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',
|
2013-06-25 10:21:10 +03:00
|
|
|
'jquery.knob' : 'JsLibraries/jquery.knob',
|
2013-08-08 10:27:49 +03:00
|
|
|
'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
|
|
|
},
|
2013-01-22 08:40:26 +03:00
|
|
|
|
2013-02-14 05:28:56 +03:00
|
|
|
shim: {
|
2013-06-15 02:18:37 +03:00
|
|
|
|
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
|
|
|
]
|
|
|
|
},
|
|
|
|
|
2013-06-15 02:18:37 +03:00
|
|
|
bootstrap: {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps:
|
|
|
|
[
|
2013-10-09 04:43:41 +03:00
|
|
|
'jquery'
|
|
|
|
],
|
|
|
|
init: function ($) {
|
|
|
|
$('body').tooltip({
|
|
|
|
selector: '[title]'
|
|
|
|
});
|
|
|
|
}
|
2013-06-15 02:18:37 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
backstrech: {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps:
|
|
|
|
[
|
2013-10-09 04:43:41 +03:00
|
|
|
'jquery'
|
2013-06-21 03:06:56 +03:00
|
|
|
]
|
2013-02-14 05:28:56 +03:00
|
|
|
},
|
2013-06-15 02:18:37 +03:00
|
|
|
|
2013-06-25 07:43:16 +03:00
|
|
|
underscore: {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps :
|
|
|
|
[
|
2013-10-09 04:43:41 +03:00
|
|
|
'jquery'
|
2013-06-21 03:06:56 +03:00
|
|
|
],
|
2013-06-15 08:28:35 +03:00
|
|
|
exports: '_'
|
2013-06-15 02:18:37 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
backbone: {
|
2013-10-11 04:29:18 +03:00
|
|
|
deps:
|
2013-06-21 03:06:56 +03:00
|
|
|
[
|
2013-10-11 04:29:18 +03:00
|
|
|
'jquery',
|
2013-06-21 03:06:56 +03:00
|
|
|
'underscore',
|
2013-10-11 04:29:18 +03:00
|
|
|
'Mixins/jquery.ajax',
|
|
|
|
'jQuery/ToTheTop'
|
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
],
|
2013-10-11 04:29:18 +03:00
|
|
|
|
2013-09-20 10:31:02 +03:00
|
|
|
exports: 'Backbone'
|
2013-06-15 08:28:35 +03:00
|
|
|
},
|
|
|
|
|
2013-11-17 09:18:47 +03:00
|
|
|
|
2013-08-21 04:07:48 +03:00
|
|
|
|
2013-02-14 05:28:56 +03:00
|
|
|
marionette: {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps:
|
|
|
|
[
|
|
|
|
'backbone',
|
2013-06-21 08:35:56 +03:00
|
|
|
'Handlebars/backbone.marionette.templates',
|
2013-07-24 09:26:10 +03:00
|
|
|
'Mixins/AsNamedView'
|
2013-06-21 03:06:56 +03:00
|
|
|
],
|
|
|
|
|
2013-06-15 02:18:37 +03:00
|
|
|
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);
|
2013-06-21 03:06:56 +03:00
|
|
|
|
2013-06-15 02:18:37 +03:00
|
|
|
}
|
2013-02-14 05:28:56 +03:00
|
|
|
},
|
2013-06-15 02:18:37 +03:00
|
|
|
|
2013-06-25 10:31:01 +03:00
|
|
|
'jquery.knob': {
|
2013-06-25 10:21:10 +03:00
|
|
|
deps:
|
|
|
|
[
|
2013-10-09 04:43:41 +03:00
|
|
|
'jquery'
|
2013-06-25 10:21:10 +03:00
|
|
|
]
|
|
|
|
},
|
2013-06-21 03:06:56 +03:00
|
|
|
|
2013-08-08 10:27:49 +03:00
|
|
|
'jquery.dotdotdot': {
|
|
|
|
deps:
|
|
|
|
[
|
2013-10-09 04:43:41 +03:00
|
|
|
'jquery'
|
2013-08-08 10:27:49 +03:00
|
|
|
]
|
|
|
|
},
|
|
|
|
|
2013-06-15 02:18:37 +03:00
|
|
|
'backbone.pageable': {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps:
|
|
|
|
[
|
|
|
|
'backbone'
|
|
|
|
]
|
2013-06-15 02:18:37 +03:00
|
|
|
},
|
2013-11-17 09:18:47 +03:00
|
|
|
'backbone.deepmodel': {
|
|
|
|
deps:
|
|
|
|
[
|
|
|
|
'backbone',
|
|
|
|
'underscore'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
'backbone.validation': {
|
|
|
|
deps :
|
|
|
|
[
|
|
|
|
'backbone'
|
|
|
|
],
|
|
|
|
exports: 'Backbone.Validation'
|
|
|
|
},
|
|
|
|
'backbone.modelbinder':{
|
|
|
|
deps :
|
|
|
|
[
|
|
|
|
'backbone'
|
|
|
|
]
|
|
|
|
},
|
2013-06-15 02:18:37 +03:00
|
|
|
|
|
|
|
backgrid : {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps:
|
|
|
|
[
|
|
|
|
'backbone'
|
|
|
|
],
|
2013-06-21 08:35:56 +03:00
|
|
|
|
|
|
|
exports: 'Backgrid',
|
|
|
|
|
2013-06-15 02:18:37 +03:00
|
|
|
init: function () {
|
2013-06-25 02:41:59 +03:00
|
|
|
require(
|
|
|
|
[
|
|
|
|
'Shared/Grid/HeaderCell'
|
|
|
|
], function () {
|
|
|
|
|
2013-11-11 07:09:11 +03:00
|
|
|
window.Backgrid.Column.prototype.defaults = {
|
2013-06-25 02:41:59 +03:00
|
|
|
name : undefined,
|
|
|
|
label : undefined,
|
|
|
|
sortable : true,
|
|
|
|
editable : false,
|
|
|
|
renderable: true,
|
|
|
|
formatter : undefined,
|
|
|
|
cell : undefined,
|
|
|
|
headerCell: 'NzbDrone'
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
2013-06-15 02:18:37 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
'backgrid.paginator': {
|
2013-06-25 02:41:59 +03:00
|
|
|
|
|
|
|
exports: 'Backgrid.Extension.Paginator',
|
|
|
|
|
2013-10-05 06:47:20 +03:00
|
|
|
deps:
|
|
|
|
[
|
|
|
|
'backgrid'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
'backgrid.selectall': {
|
|
|
|
|
|
|
|
exports: 'Backgrid.Extension.SelectAll',
|
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
deps:
|
|
|
|
[
|
|
|
|
'backgrid'
|
|
|
|
]
|
2013-02-14 05:28:56 +03:00
|
|
|
}
|
2013-01-28 21:06:54 +03:00
|
|
|
}
|
2013-01-26 23:05:08 +03:00
|
|
|
});
|
2013-01-22 08:40:26 +03:00
|
|
|
|
2013-10-09 04:43:41 +03:00
|
|
|
require.config({
|
|
|
|
urlArgs: 'v=' + window.NzbDrone.ServerStatus.version
|
|
|
|
});
|
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
define(
|
|
|
|
[
|
2013-10-11 04:29:18 +03:00
|
|
|
'jquery',
|
2013-10-09 04:43:41 +03:00
|
|
|
'backbone',
|
2013-06-21 03:06:56 +03:00
|
|
|
'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',
|
2013-11-14 06:38:30 +03:00
|
|
|
'Instrumentation/StringFormat',
|
|
|
|
'LifeCycle'
|
2013-10-11 04:29:18 +03:00
|
|
|
], function ($, Backbone, Marionette, RouteBinder, SignalRBroadcaster, NavbarView, AppLayout, SeriesController, Router, ModalController) {
|
2013-01-22 08:40:26 +03:00
|
|
|
|
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();
|
2013-08-22 03:56:25 +03:00
|
|
|
|
2013-06-25 02:41:59 +03:00
|
|
|
app.addInitializer(function () {
|
2013-06-21 03:06:56 +03:00
|
|
|
console.log('starting application');
|
|
|
|
});
|
2013-02-14 05:28:56 +03:00
|
|
|
|
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');
|
2013-06-21 03:06:56 +03:00
|
|
|
});
|
2013-03-29 21:37:10 +03:00
|
|
|
|
2013-06-25 02:41:59 +03:00
|
|
|
app.start();
|
2013-06-21 03:06:56 +03:00
|
|
|
});
|