2013-06-25 04:43:16 +00:00
|
|
|
|
'use strict';
|
2013-03-29 18:37:10 +00:00
|
|
|
|
require.config({
|
2013-02-14 02:28:56 +00:00
|
|
|
|
|
2013-06-21 01:43:58 +00:00
|
|
|
|
urlArgs: 'v=' + window.ServerStatus.version,
|
2013-06-21 00:06:56 +00:00
|
|
|
|
|
2013-02-14 02:28:56 +00:00
|
|
|
|
paths: {
|
2013-06-19 01:02:23 +00:00
|
|
|
|
'backbone' : 'JsLibraries/backbone',
|
2013-07-14 02:40:47 +00:00
|
|
|
|
'moment' : 'JsLibraries/moment',
|
2013-07-17 06:23:44 +00:00
|
|
|
|
'filesize' : 'JsLibraries/filesize',
|
2013-06-19 01:02:23 +00:00
|
|
|
|
'handlebars' : 'JsLibraries/handlebars.runtime',
|
2013-06-27 00:29:48 +00:00
|
|
|
|
'handlebars.helpers' : 'JsLibraries/handlebars.helpers',
|
2013-06-19 01:02:23 +00:00
|
|
|
|
'bootstrap' : 'JsLibraries/bootstrap',
|
|
|
|
|
'backbone.deepmodel' : 'JsLibraries/backbone.deep.model',
|
|
|
|
|
'backbone.pageable' : 'JsLibraries/backbone.pageable',
|
2013-08-21 01:07:48 +00:00
|
|
|
|
'backbone.validation' : 'JsLibraries/backbone.validation',
|
2013-06-19 01:02:23 +00:00
|
|
|
|
'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 05:14:12 +00:00
|
|
|
|
'underscore' : 'JsLibraries/lodash.underscore',
|
2013-06-19 01:02:23 +00:00
|
|
|
|
'marionette' : 'JsLibraries/backbone.marionette',
|
|
|
|
|
'signalR' : 'JsLibraries/jquery.signalR',
|
2013-06-25 07:21:10 +00:00
|
|
|
|
'jquery.knob' : 'JsLibraries/jquery.knob',
|
2013-08-08 07:27:49 +00:00
|
|
|
|
'jquery.dotdotdot' : 'JsLibraries/jquery.dotdotdot',
|
2013-06-19 01:02:23 +00:00
|
|
|
|
'libs' : 'JsLibraries/'
|
2013-06-21 01:43:58 +00:00
|
|
|
|
|
2013-01-26 20:05:08 +00:00
|
|
|
|
},
|
2013-01-22 05:40:26 +00:00
|
|
|
|
|
2013-02-14 02:28:56 +00:00
|
|
|
|
shim: {
|
2013-06-14 23:18:37 +00:00
|
|
|
|
|
|
|
|
|
$: {
|
2013-06-25 05:47:56 +00:00
|
|
|
|
exports: '$',
|
|
|
|
|
|
|
|
|
|
init: function () {
|
|
|
|
|
require(
|
|
|
|
|
[
|
2013-07-05 23:53:05 +00:00
|
|
|
|
'jQuery/ToTheTop',
|
|
|
|
|
'Instrumentation/ErrorHandler'
|
2013-06-25 05:47:56 +00:00
|
|
|
|
]);
|
|
|
|
|
}
|
2013-06-14 23:18:37 +00:00
|
|
|
|
|
2013-06-25 05:47:56 +00:00
|
|
|
|
},
|
2013-06-25 04:43:16 +00:00
|
|
|
|
|
|
|
|
|
signalR: {
|
|
|
|
|
deps:
|
|
|
|
|
[
|
|
|
|
|
'$'
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
|
2013-06-14 23:18:37 +00:00
|
|
|
|
bootstrap: {
|
2013-06-21 00:06:56 +00:00
|
|
|
|
deps:
|
|
|
|
|
[
|
|
|
|
|
'$'
|
|
|
|
|
]
|
2013-06-14 23:18:37 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
backstrech: {
|
2013-06-21 00:06:56 +00:00
|
|
|
|
deps:
|
|
|
|
|
[
|
|
|
|
|
'$'
|
|
|
|
|
]
|
2013-02-14 02:28:56 +00:00
|
|
|
|
},
|
2013-06-14 23:18:37 +00:00
|
|
|
|
|
2013-06-25 04:43:16 +00:00
|
|
|
|
underscore: {
|
2013-06-21 00:06:56 +00:00
|
|
|
|
deps :
|
|
|
|
|
[
|
|
|
|
|
'$'
|
|
|
|
|
],
|
2013-06-15 05:28:35 +00:00
|
|
|
|
exports: '_'
|
2013-06-14 23:18:37 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
backbone: {
|
2013-06-21 00:06:56 +00:00
|
|
|
|
deps :
|
|
|
|
|
[
|
2013-07-24 06:26:10 +00:00
|
|
|
|
'Mixins/backbone.ajax',
|
2013-06-21 00:06:56 +00:00
|
|
|
|
'underscore',
|
|
|
|
|
'$'
|
|
|
|
|
],
|
2013-06-21 05:35:56 +00:00
|
|
|
|
exports: 'Backbone',
|
|
|
|
|
init : function (AjaxMixin) {
|
|
|
|
|
AjaxMixin.apply(Backbone);
|
|
|
|
|
}
|
2013-06-15 05:28:35 +00:00
|
|
|
|
},
|
|
|
|
|
|
2013-06-21 00:06:56 +00:00
|
|
|
|
|
2013-06-15 05:28:35 +00:00
|
|
|
|
'backbone.deepmodel': {
|
2013-06-21 00:06:56 +00:00
|
|
|
|
deps:
|
|
|
|
|
[
|
2013-07-24 06:26:10 +00:00
|
|
|
|
'Mixins/underscore.mixin.deepExtend'
|
2013-06-21 00:06:56 +00:00
|
|
|
|
]
|
2013-02-14 02:28:56 +00:00
|
|
|
|
},
|
2013-06-14 23:18:37 +00:00
|
|
|
|
|
2013-08-21 01:07:48 +00:00
|
|
|
|
'backbone.validation': {
|
|
|
|
|
deps :
|
|
|
|
|
[
|
|
|
|
|
'backbone'
|
|
|
|
|
],
|
|
|
|
|
exports: 'Backbone.Validation'
|
|
|
|
|
},
|
|
|
|
|
|
2013-02-14 02:28:56 +00:00
|
|
|
|
marionette: {
|
2013-06-21 00:06:56 +00:00
|
|
|
|
deps:
|
|
|
|
|
[
|
|
|
|
|
'backbone',
|
2013-06-21 05:35:56 +00:00
|
|
|
|
'Handlebars/backbone.marionette.templates',
|
2013-07-24 06:26:10 +00:00
|
|
|
|
'Mixins/AsNamedView'
|
2013-06-21 00:06:56 +00:00
|
|
|
|
],
|
|
|
|
|
|
2013-06-14 23:18:37 +00:00
|
|
|
|
exports: 'Marionette',
|
2013-06-25 04:43:16 +00:00
|
|
|
|
init : function (Backbone, TemplateMixin, AsNamedView) {
|
2013-06-15 05:28:35 +00:00
|
|
|
|
TemplateMixin.call(Marionette.TemplateCache);
|
2013-06-19 01:02:23 +00:00
|
|
|
|
AsNamedView.call(Marionette.ItemView.prototype);
|
2013-06-21 00:06:56 +00:00
|
|
|
|
|
2013-06-14 23:18:37 +00:00
|
|
|
|
}
|
2013-02-14 02:28:56 +00:00
|
|
|
|
},
|
2013-06-14 23:18:37 +00:00
|
|
|
|
|
2013-06-25 07:31:01 +00:00
|
|
|
|
'jquery.knob': {
|
2013-06-25 07:21:10 +00:00
|
|
|
|
deps:
|
|
|
|
|
[
|
|
|
|
|
'$'
|
|
|
|
|
]
|
|
|
|
|
},
|
2013-06-21 00:06:56 +00:00
|
|
|
|
|
2013-08-08 07:27:49 +00:00
|
|
|
|
'jquery.dotdotdot': {
|
|
|
|
|
deps:
|
|
|
|
|
[
|
|
|
|
|
'$'
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
|
2013-06-14 23:18:37 +00:00
|
|
|
|
'backbone.pageable': {
|
2013-06-21 00:06:56 +00:00
|
|
|
|
deps:
|
|
|
|
|
[
|
|
|
|
|
'backbone'
|
|
|
|
|
]
|
2013-06-14 23:18:37 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
backgrid : {
|
2013-06-21 00:06:56 +00:00
|
|
|
|
deps:
|
|
|
|
|
[
|
|
|
|
|
'backbone'
|
|
|
|
|
],
|
2013-06-21 05:35:56 +00:00
|
|
|
|
|
|
|
|
|
exports: 'Backgrid',
|
|
|
|
|
|
2013-06-14 23:18:37 +00:00
|
|
|
|
init: function () {
|
2013-06-24 23:41:59 +00:00
|
|
|
|
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'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
});
|
2013-06-14 23:18:37 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
'backgrid.paginator': {
|
2013-06-24 23:41:59 +00:00
|
|
|
|
|
|
|
|
|
exports: 'Backgrid.Extension.Paginator',
|
|
|
|
|
|
2013-06-21 00:06:56 +00:00
|
|
|
|
deps:
|
|
|
|
|
[
|
|
|
|
|
'backgrid'
|
|
|
|
|
]
|
2013-02-14 02:28:56 +00:00
|
|
|
|
}
|
2013-01-28 18:06:54 +00:00
|
|
|
|
}
|
2013-01-26 20:05:08 +00:00
|
|
|
|
});
|
2013-01-22 05:40:26 +00:00
|
|
|
|
|
2013-06-21 00:06:56 +00:00
|
|
|
|
define(
|
|
|
|
|
[
|
|
|
|
|
'marionette',
|
2013-09-11 06:33:47 +00:00
|
|
|
|
'Shared/SignalRBroadcaster',
|
2013-07-19 23:08:41 +00:00
|
|
|
|
'Instrumentation/StringFormat'
|
2013-09-11 06:33:47 +00:00
|
|
|
|
], function (Marionette, SignalRBroadcaster) {
|
2013-01-22 05:40:26 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
var app = new Marionette.Application();
|
2013-05-11 23:39:32 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
app.Events = {
|
2013-07-24 01:15:58 +00:00
|
|
|
|
SeriesAdded : 'series:added',
|
2013-09-03 05:02:47 +00:00
|
|
|
|
SeriesDeleted: 'series:deleted',
|
|
|
|
|
SeasonRenamed: 'season:renamed'
|
2013-06-21 00:06:56 +00:00
|
|
|
|
};
|
2013-02-16 00:49:25 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
app.Commands = {
|
2013-07-24 01:15:58 +00:00
|
|
|
|
EditSeriesCommand : 'EditSeriesCommand',
|
|
|
|
|
DeleteSeriesCommand: 'DeleteSeriesCommand',
|
|
|
|
|
CloseModalCommand : 'CloseModalCommand',
|
|
|
|
|
ShowEpisodeDetails : 'ShowEpisodeDetails',
|
2013-08-26 05:31:58 +00:00
|
|
|
|
ShowHistoryDetails : 'ShowHistryDetails',
|
2013-07-28 23:13:14 +00:00
|
|
|
|
SaveSettings : 'saveSettings',
|
|
|
|
|
ShowLogFile : 'showLogFile'
|
2013-06-21 00:06:56 +00:00
|
|
|
|
};
|
2013-04-25 04:27:49 +00:00
|
|
|
|
|
2013-08-22 00:56:25 +00:00
|
|
|
|
app.Reqres = {
|
|
|
|
|
GetEpisodeFileById: 'GetEpisodeFileById'
|
|
|
|
|
};
|
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
app.addInitializer(function () {
|
2013-06-21 00:06:56 +00:00
|
|
|
|
console.log('starting application');
|
|
|
|
|
});
|
2013-02-14 02:28:56 +00:00
|
|
|
|
|
2013-09-11 06:33:47 +00:00
|
|
|
|
app.addInitializer(SignalRBroadcaster.appInitializer, {app: app});
|
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
app.addRegions({
|
2013-08-02 01:02:55 +00:00
|
|
|
|
navbarRegion: '#nav-region',
|
2013-07-24 01:15:58 +00:00
|
|
|
|
mainRegion : '#main-region',
|
|
|
|
|
footerRegion: '#footer-region'
|
2013-06-21 00:06:56 +00:00
|
|
|
|
});
|
2013-03-29 18:37:10 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
app.start();
|
2013-06-21 01:43:58 +00:00
|
|
|
|
|
2013-06-21 00:06:56 +00:00
|
|
|
|
window.require(
|
|
|
|
|
[
|
2013-06-21 06:01:00 +00:00
|
|
|
|
'Router',
|
|
|
|
|
'jQuery/TooltipBinder'
|
2013-06-21 00:06:56 +00:00
|
|
|
|
]);
|
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
return app;
|
2013-06-21 00:06:56 +00:00
|
|
|
|
});
|