2013-06-22 09:24:24 +03:00
|
|
|
'use strict';
|
2013-03-29 21:37:10 +03:00
|
|
|
require.config({
|
2013-02-14 05:28:56 +03:00
|
|
|
|
2013-06-21 04:43:58 +03:00
|
|
|
urlArgs: 'v=' + window.ServerStatus.version,
|
2013-06-21 03:06:56 +03:00
|
|
|
|
2013-02-14 05:28:56 +03:00
|
|
|
paths: {
|
2013-06-19 04:02:23 +03:00
|
|
|
'backbone' : 'JsLibraries/backbone',
|
2013-06-21 03:06:56 +03:00
|
|
|
'sugar' : 'JsLibraries/sugar',
|
2013-06-19 04:02:23 +03: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 04:43:58 +03:00
|
|
|
|
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-06-21 03:06:56 +03:00
|
|
|
exports: '$',
|
|
|
|
init : function () {
|
|
|
|
window.Constants = {
|
|
|
|
ApiRoot: '/api'
|
|
|
|
};
|
|
|
|
}
|
2013-06-15 02:18:37 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
bootstrap: {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps:
|
|
|
|
[
|
|
|
|
'$'
|
|
|
|
]
|
2013-06-15 02:18:37 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
'bootstrap.slider': {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps:
|
|
|
|
[
|
|
|
|
'$'
|
|
|
|
]
|
2013-06-15 02:18:37 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
backstrech: {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps:
|
|
|
|
[
|
|
|
|
'$'
|
|
|
|
]
|
2013-02-14 05:28:56 +03:00
|
|
|
},
|
2013-06-15 02:18:37 +03:00
|
|
|
|
|
|
|
'underscore': {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps :
|
|
|
|
[
|
|
|
|
'$'
|
|
|
|
],
|
2013-06-15 08:28:35 +03:00
|
|
|
exports: '_'
|
2013-06-15 02:18:37 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
backbone: {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps :
|
|
|
|
[
|
2013-06-21 08:35:56 +03:00
|
|
|
'mixins/backbone.ajax',
|
2013-06-21 03:06:56 +03:00
|
|
|
'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-21 03:06:56 +03:00
|
|
|
|
2013-06-15 08:28:35 +03:00
|
|
|
'backbone.deepmodel': {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps:
|
|
|
|
[
|
|
|
|
'mixins/underscore.mixin.deepExtend'
|
|
|
|
]
|
2013-02-14 05:28:56 +03:00
|
|
|
},
|
2013-06-15 02:18:37 +03:00
|
|
|
|
2013-02-14 05:28:56 +03:00
|
|
|
marionette: {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps:
|
|
|
|
[
|
|
|
|
'backbone',
|
|
|
|
'handlebars',
|
2013-06-21 08:35:56 +03:00
|
|
|
'Handlebars/backbone.marionette.templates',
|
2013-06-21 03:06:56 +03:00
|
|
|
'mixins/AsNamedView',
|
|
|
|
|
|
|
|
'Handlebars/Helpers/DateTime'
|
|
|
|
],
|
|
|
|
|
2013-06-15 02:18:37 +03:00
|
|
|
exports: 'Marionette',
|
2013-06-21 03:06:56 +03:00
|
|
|
init : function (Backbone, Handlebars, TemplateMixin, AsNamedView, DateTimeHelpers) {
|
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);
|
2013-06-21 03:06:56 +03:00
|
|
|
DateTimeHelpers.register(Handlebars);
|
|
|
|
|
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-21 03:06:56 +03:00
|
|
|
|
2013-06-15 02:18:37 +03:00
|
|
|
signalR: {
|
2013-06-21 03:06:56 +03:00
|
|
|
deps:
|
|
|
|
[
|
|
|
|
'$'
|
|
|
|
]
|
2013-06-14 03:41:46 +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
|
|
|
},
|
|
|
|
|
|
|
|
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 () {
|
|
|
|
Backgrid.Column.prototype.defaults = {
|
|
|
|
name : undefined,
|
|
|
|
label : undefined,
|
|
|
|
sortable : true,
|
|
|
|
editable : false,
|
|
|
|
renderable: true,
|
|
|
|
formatter : undefined,
|
|
|
|
cell : undefined,
|
|
|
|
headerCell: 'nzbDrone'
|
|
|
|
};
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'backgrid.paginator': {
|
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-06-21 03:06:56 +03:00
|
|
|
define(
|
|
|
|
[
|
|
|
|
'marionette',
|
|
|
|
'shared/modal/region',
|
|
|
|
'Instrumentation/StringFormat',
|
|
|
|
'Instrumentation/ErrorHandler'
|
2013-06-21 08:19:41 +03:00
|
|
|
], function (Marionette, ModalRegion) {
|
2013-01-22 08:40:26 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
require(
|
|
|
|
[
|
|
|
|
'libs/backbone.mutators'
|
|
|
|
]);
|
2013-06-15 08:28:35 +03:00
|
|
|
|
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone = new Marionette.Application();
|
|
|
|
window.NzbDrone.Config = {};
|
|
|
|
window.NzbDrone.Form = {};
|
2013-05-12 02:39:32 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone.Series = {
|
|
|
|
Index : {
|
|
|
|
Table : {},
|
|
|
|
List : {},
|
|
|
|
Posters: {}
|
2013-05-12 02:39:32 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
},
|
|
|
|
Edit : {},
|
|
|
|
Delete : {},
|
|
|
|
Details: {}
|
|
|
|
};
|
2013-05-12 02:39:32 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone.Episode = {
|
|
|
|
Search : {},
|
|
|
|
Summary : {},
|
|
|
|
Activity: {}
|
|
|
|
};
|
2013-05-15 04:17:24 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone.Quality = {};
|
2013-05-12 02:39:32 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone.Commands = {};
|
2013-05-12 02:39:32 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone.Shared = {
|
|
|
|
Toolbar : {},
|
|
|
|
Messenger : {},
|
|
|
|
FormatHelpers: {},
|
|
|
|
Grid : {}
|
|
|
|
};
|
2013-06-09 23:51:32 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone.Cells = {};
|
2013-06-09 23:51:32 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone.Calendar = {};
|
2013-05-12 02:39:32 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone.Missing = {};
|
|
|
|
window.NzbDrone.History = {};
|
|
|
|
window.NzbDrone.Logs = {};
|
|
|
|
window.NzbDrone.Release = {};
|
2013-03-04 03:09:43 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone.Events = {
|
|
|
|
SeriesAdded: 'seriesAdded'
|
|
|
|
};
|
2013-02-16 03:49:25 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone.Commands = {
|
|
|
|
SaveSettings: 'saveSettings'
|
|
|
|
};
|
2013-04-25 07:27:49 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone.Constants = {
|
|
|
|
ApiRoot: '/api'
|
|
|
|
};
|
2013-01-22 08:40:26 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone.addInitializer(function () {
|
|
|
|
console.log('starting application');
|
|
|
|
});
|
2013-02-14 05:28:56 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
NzbDrone.addRegions({
|
|
|
|
mainRegion : '#main-region',
|
|
|
|
notificationRegion: '#notification-region',
|
|
|
|
modalRegion : ModalRegion,
|
|
|
|
footerRegion : '#footer-region'
|
|
|
|
});
|
2013-03-29 21:37:10 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.NzbDrone.start();
|
2013-02-14 20:18:29 +03:00
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
|
2013-06-21 04:43:58 +03:00
|
|
|
//NzbDrone.footerRegion.show(new FooterView());
|
|
|
|
|
|
|
|
|
2013-06-21 03:06:56 +03:00
|
|
|
window.require(
|
|
|
|
[
|
2013-06-21 09:01:00 +03:00
|
|
|
'Router',
|
|
|
|
'jQuery/TooltipBinder'
|
2013-06-21 03:06:56 +03:00
|
|
|
]);
|
|
|
|
|
|
|
|
return NzbDrone;
|
|
|
|
});
|
2013-02-14 05:28:56 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-29 21:37:10 +03:00
|
|
|
|