1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

removed NzbDrone. namespace, everything is done using require.

This commit is contained in:
Keivan Beigi 2013-06-24 16:41:59 -07:00
parent ef62af75df
commit b0bd3f34f1
121 changed files with 2570 additions and 2587 deletions

View File

@ -10,8 +10,6 @@ module.exports = function (grunt) {
'UI/JsLibraries/backbone.modelbinder.js' : 'http://raw.github.com/theironcook/Backbone.ModelBinder/master/Backbone.ModelBinder.js',
'UI/JsLibraries/backbone.mutators.js' : 'http://raw.github.com/asciidisco/Backbone.Mutators/master/backbone.mutators.js',
'UI/JsLibraries/backbone.shortcuts.js' : 'http://raw.github.com/bry4n/backbone-shortcuts/master/backbone.shortcuts.js',
'UI/JsLibraries/backbone.relational.js' : 'http://raw.github.com/PaulUithol/Backbone-relational/0.8.5/backbone-relational.js',
'UI/JsLibraries/backbone.associations.js' : 'http://raw.github.com/dhruvaray/backbone-associations/master/backbone-associations.js',
'UI/JsLibraries/backbone.pageable.js' : 'http://raw.github.com/wyuenho/backbone-pageable/master/lib/backbone-pageable.js',
'UI/JsLibraries/backbone.backgrid.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/backgrid.js',
@ -28,6 +26,7 @@ module.exports = function (grunt) {
'UI/JsLibraries/require.js' : 'http://raw.github.com/jrburke/requirejs/master/require.js',
'UI/JsLibraries/sugar.js' : 'http://raw.github.com/andrewplummer/Sugar/master/release/sugar-full.development.js',
'UI/JsLibraries/underscore.js' : 'http://underscorejs.org/underscore.js',
'UI/JsLibraries/lodash.underscore.js' : 'http://raw.github.com/bestiejs/lodash/master/dist/lodash.underscore.js',
'UI/JsLibraries/lunr.js' : 'http://raw.github.com/olivernn/lunr.js/master/lunr.js',
'UI/JsLibraries/messenger.js' : 'http://raw.github.com/HubSpot/messenger/master/build/js/messenger.js',
@ -36,6 +35,7 @@ module.exports = function (grunt) {
'UI/Content/bootstrap.toggle-switch.css' : 'http://raw.github.com/ghinda/css-toggle-switch/gh-pages/toggle-switch.css',
/*
'UI/Content/FontAwesome/fontawesome.otf' : 'http://github.com/FortAwesome/Font-Awesome/blob/master/build/assets/font-awesome/font/FontAwesome.otf?raw=true',
'UI/Content/FontAwesome/fontawesome-webfont.eot' : 'http://github.com/FortAwesome/Font-Awesome/blob/master/build/assets/font-awesome/font/fontawesome-webfont.eot?raw=true',
'UI/Content/FontAwesome/fontawesome-webfont.svg' : 'http://github.com/FortAwesome/Font-Awesome/blob/master/build/assets/font-awesome/font/fontawesome-webfont.svg?raw=true',
@ -51,6 +51,7 @@ module.exports = function (grunt) {
'UI/Content/FontAwesome/mixins.less' : 'http://raw.github.com/FortAwesome/Font-Awesome/master/build/assets/font-awesome/less/mixins.less',
'UI/Content/FontAwesome/path.less' : 'http://raw.github.com/FortAwesome/Font-Awesome/master/build/assets/font-awesome/less/path.less',
'UI/Content/FontAwesome/variables.less' : 'http://raw.github.com/FortAwesome/Font-Awesome/master/build/assets/font-awesome/less/variables.less'
*/
},
clean: {
@ -125,6 +126,9 @@ module.exports = function (grunt) {
},
watch: {
options: {
nospawn: false,
},
bootstrap : {
files: ['UI/**/Bootstrap/**', 'UI/**/FontAwesome/**'],
tasks: ['less:bootstrap']

View File

@ -5,7 +5,6 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="jQuery-1.9.1" level="application" />
<orderEntry type="library" name="libraries" level="project" />
</component>
</module>

View File

@ -35,10 +35,7 @@
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="SPACE_AFTER_COLON" value="false" />
<option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="CALL_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="2" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />

View File

@ -4,6 +4,7 @@
<w>backgrid</w>
<w>bnzbd</w>
<w>clickable</w>
<w>couldn</w>
<w>mouseenter</w>
<w>mouseleave</w>
</words>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="PROJECT" libraries="{libraries}" />
<file url="PROJECT" libraries="{jQuery-1.9.1}" />
</component>
</project>

View File

@ -63,7 +63,7 @@
<option passfail="false" />
<option white="false" />
<option maxerr="50" />
<option predef="NzbDrone, define, Backbone, _, window,Handlebars,require,$,Marionette, Backgrid, jQuery, signalR" />
<option predef="window, define, require ,$" />
</component>
</project>

View File

@ -1,51 +0,0 @@
<component name="libraryTable">
<library name="libraries" type="javaScript">
<properties>
<sourceFilesUrls>
<item url="file://$PROJECT_DIR$/JsLibraries/bootstrap.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.debug.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/sugar.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.shortcuts.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.pager.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/handlebars.runtime.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.bootstrap.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.modelbinder.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/fullcalendar.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.collectionbinder.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/underscore.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/bootstrap.slider.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.viewswapper.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/require.js" />
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.mutators.js" />
</sourceFilesUrls>
</properties>
<CLASSES>
<root url="file://$PROJECT_DIR$/JsLibraries/bootstrapSwitch.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/toastr-1.1.5.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/bootstrap.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.debug.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/sugar.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.shortcuts.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.pager.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/handlebars.runtime.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.bootstrap.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.modelbinder.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.collectionbinder.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/fullcalendar.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/underscore.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/bootstrap.slider.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.viewswapper.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.mutators.js" />
<root url="file://$PROJECT_DIR$/JsLibraries/require.js" />
</CLASSES>
<SOURCES />
</library>
</component>

View File

@ -1,13 +1,9 @@
'use strict';
'use strict';
define(
[
'marionette',
'AddSeries/Collection',
'AddSeries/SearchResultCollectionView',
'Shared/SpinnerView',
'app',
'AddSeries/RootFolders/Collection',
'AddSeries/SearchResultView',
'Shared/SpinnerView'
], function (Marionette, AddSeriesCollection, SearchResultCollectionView, SpinnerView) {
return Marionette.Layout.extend({

View File

@ -1,12 +1,11 @@
'use strict';
'use strict';
define(
[
'app',
'backbone',
'Series/SeriesModel'
], function (App, Backbone, SeriesModel) {
], function (Backbone, SeriesModel) {
return Backbone.Collection.extend({
url : Constants.ApiRoot + '/series/lookup',
url : window.ApiRoot + '/series/lookup',
model: SeriesModel,
parse: function (response) {

View File

@ -1,4 +1,4 @@
'use strict';
'use strict';
define(
[
'backbone',
@ -6,12 +6,12 @@ define(
'mixins/backbone.signalr.mixin'
], function (Backbone, RootFolderModel) {
var rootFolderCollection = Backbone.Collection.extend({
url : NzbDrone.Constants.ApiRoot + '/rootfolder',
var RootFolderCollection = Backbone.Collection.extend({
url : window.ApiRoot + '/rootfolder',
model: RootFolderModel
});
var collection = new rootFolderCollection().BindSignalR();
var collection = new RootFolderCollection().BindSignalR();
return collection;
});

View File

@ -1,12 +1,12 @@
'use strict';
define([
'app',
define(
[
'marionette',
'Calendar/UpcomingCollection',
'Calendar/UpcomingCollectionView',
'Calendar/CalendarView',
'Shared/Toolbar/ToolbarLayout'
],
function () {
NzbDrone.Calendar.CalendarLayout = Backbone.Marionette.Layout.extend({
], function (Marionette, UpcomingCollection, UpcomingCollectionView, CalendarView) {
return Marionette.Layout.extend({
template: 'Calendar/CalendarLayoutTemplate',
regions: {
@ -15,7 +15,7 @@ define([
},
initialize: function () {
this.upcomingCollection = new NzbDrone.Calendar.UpcomingCollection();
this.upcomingCollection = new UpcomingCollection();
this.upcomingCollection.fetch();
},
@ -25,13 +25,13 @@ define([
},
_showUpcoming: function () {
this.upcoming.show(new NzbDrone.Calendar.UpcomingCollectionView({
this.upcoming.show(new UpcomingCollectionView({
collection: this.upcomingCollection
}));
},
_showCalendar: function () {
this.calendar.show(new NzbDrone.Calendar.CalendarView());
this.calendar.show(new CalendarView());
}
});
});

View File

@ -1,9 +1,17 @@
'use strict';
'use strict';
define(['app', 'Calendar/Collection','fullcalendar'], function () {
NzbDrone.Calendar.CalendarView = Backbone.Marionette.ItemView.extend({
define(
[
'marionette',
'Calendar/Collection',
'fullcalendar'
], function (Marionette, CalendarCollection) {
var _instance;
return Marionette.ItemView.extend({
initialize: function () {
this.collection = new NzbDrone.Calendar.Collection();
this.collection = new CalendarCollection();
},
render : function () {
$(this.$el).empty().fullCalendar({
@ -46,7 +54,7 @@ define(['app', 'Calendar/Collection','fullcalendar'], function () {
}
});
NzbDrone.Calendar.CalendarView.Instance = this;
_instance = this;
},
onShow: function () {
@ -54,12 +62,10 @@ define(['app', 'Calendar/Collection','fullcalendar'], function () {
},
getEvents: function (start, end, callback) {
var bbView = NzbDrone.Calendar.CalendarView.Instance;
var startDate = Date.create(start).format(Date.ISO8601_DATETIME);
var endDate = Date.create(end).format(Date.ISO8601_DATETIME);
bbView.collection.fetch({
_instance.collection.fetch({
data : { start: startDate, end: endDate },
success: function (calendarCollection) {
_.each(calendarCollection.models, function (element) {

View File

@ -1,8 +1,12 @@
'use strict';
define(['app', 'Series/EpisodeModel'], function () {
NzbDrone.Calendar.Collection = Backbone.Collection.extend({
url : NzbDrone.Constants.ApiRoot + '/calendar',
model : NzbDrone.Series.EpisodeModel,
'use strict';
define(
[
'backbone',
'Series/EpisodeModel'
], function (Backbone, EpisodeModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/calendar',
model: EpisodeModel,
comparator: function (model) {
var date = new Date(model.get('airDate'));

View File

@ -1,8 +1,12 @@
'use strict';
define(['app', 'Series/EpisodeModel'], function () {
NzbDrone.Calendar.UpcomingCollection = Backbone.Collection.extend({
url : NzbDrone.Constants.ApiRoot + '/calendar',
model : NzbDrone.Series.EpisodeModel,
'use strict';
define(
[
'backbone',
'Series/EpisodeModel'
], function (Backbone, EpisodeModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/calendar',
model: EpisodeModel,
comparator: function (model) {
var date = new Date(model.get('airDate'));

View File

@ -1,7 +1,11 @@
'use strict';
'use strict';
define(['app', 'Calendar/UpcomingItemView'], function () {
NzbDrone.Calendar.UpcomingCollectionView = Backbone.Marionette.CollectionView.extend({
itemView: NzbDrone.Calendar.UpcomingItemView
define(
[
'marionette',
'Calendar/UpcomingItemView'
], function (Marionette, UpcomingItemView) {
return Marionette.CollectionView.extend({
itemView: UpcomingItemView
});
});

View File

@ -1,11 +1,10 @@
'use strict';
define([
'app',
'Calendar/UpcomingCollection'
], function () {
NzbDrone.Calendar.UpcomingItemView = Backbone.Marionette.ItemView.extend({
define(
[
'marionette'
], function (Marionette) {
return Marionette.ItemView.extend({
template: 'Calendar/UpcomingItemTemplate',
tagName : 'div'
});

View File

@ -1,13 +1,17 @@
'use strict';
define(['app', 'Shared/FormatHelpers', 'Cells/NzbDroneCell'], function () {
return NzbDrone.Cells.NzbDroneCell.extend({
define(
[
'backgrid',
'Shared/FormatHelpers'
], function (Backgrid, FormatHelpers) {
return Backgrid.Cell.extend({
className: 'air-date-cell',
render: function () {
this.$el.empty();
var airDate = this.model.get(this.column.get('name'));
this.$el.html(NzbDrone.Shared.FormatHelpers.DateHelper(airDate));
this.$el.html(FormatHelpers.DateHelper(airDate));
return this;
}

View File

@ -1,7 +1,10 @@
'use strict';
define(['app', 'Cells/NzbDroneCell'], function () {
return NzbDrone.Cells.NzbDroneCell.extend({
define(
[
'Cells/NzbDroneCell'
], function (NzbDroneCell) {
return NzbDroneCell.extend({
className: 'episode-number-cell',

View File

@ -1,7 +1,10 @@
'use strict';
define(['app','cells/nzbdronecell' ], function () {
return NzbDrone.Cells.NzbDroneCell.extend({
define(
[
'backgrid'
], function (Backgrid) {
return Backgrid.Cell.extend({
className: 'episode-status-cell',

View File

@ -1,7 +1,12 @@
'use strict';
define(['app', 'Cells/NzbDroneCell'], function () {
return NzbDrone.Cells.NzbDroneCell.extend({
define(
[
'app',
'Cells/NzbDroneCell',
'Episode/Layout'
], function (App, NzbDroneCell, EpisodeLayout) {
return NzbDroneCell.extend({
className: 'episode-title-cell',
@ -10,8 +15,8 @@ define(['app', 'Cells/NzbDroneCell'], function () {
},
showDetails: function () {
var view = new NzbDrone.Episode.Layout({ model: this.cellValue });
NzbDrone.modalRegion.show(view);
var view = new EpisodeLayout({ model: this.cellValue });
App.modalRegion.show(view);
},
render: function () {

View File

@ -1,13 +1,17 @@
'use strict';
define(['app', 'Shared/FormatHelpers','backgrid'], function () {
NzbDrone.Cells.FileSizeCell = Backgrid.Cell.extend({
define(
[
'backgrid',
'Shared/FormatHelpers'
], function (Backgrid, FormatHelpers) {
return Backgrid.Cell.extend({
className: 'file-size-cell',
render: function () {
var size = this.model.get(this.column.get('name'));
this.$el.html(NzbDrone.Shared.FormatHelpers.FileSizeHelper(size));
this.$el.html(FormatHelpers.FileSizeHelper(size));
this.delegateEvents();
return this;
}

View File

@ -1,6 +1,9 @@
'use strict';
define(['app','backgrid'], function () {
NzbDrone.Cells.IndexerCell = Backgrid.Cell.extend({
define(
[
'backgrid'
], function (Backgrid) {
return Backgrid.Cell.extend({
class : 'indexer-cell',

View File

@ -1,7 +1,10 @@
'use strict';
define(['app','backgrid'], function () {
NzbDrone.Cells.NzbDroneCell = Backgrid.Cell.extend({
define(
[
'backgrid'
], function (Backgrid) {
return Backgrid.Cell.extend({
_originalInit: Backgrid.Cell.prototype.initialize,

View File

@ -1,5 +1,8 @@
'use strict';
define(['app', 'Cells/TemplatedCell'], function (App, TemplatedCell) {
define(
[
'Cells/TemplatedCell'
], function (TemplatedCell) {
return TemplatedCell.extend({
className: 'quality-cell',

View File

@ -1,6 +1,9 @@
'use strict';
define(['app','Cells/NzbDroneCell'], function () {
return NzbDrone.Cells.NzbDroneCell.extend({
define(
[
'Cells/NzbDroneCell'
], function (NzbDroneCell) {
return NzbDroneCell.extend({
className: 'relative-date-cell',

View File

@ -1,25 +0,0 @@
'use strict';
define(['app','cells/nzbdronecell'], function () {
return NzbDrone.Cells.NzbDroneCell.extend({
className: 'series-status-cell',
render: function () {
this.$el.empty();
var monitored = this.model.get('monitored');
var status = this.model.get('status');
if (!monitored) {
this.$el.html('<i class="icon-pause grid-icon" title="Not Monitored"></i>');
}
else if (status === 'continuing') {
this.$el.html('<i class="icon-play grid-icon" title="Continuing"></i>');
}
else {
this.$el.html('<i class="icon-stop grid-icon" title="Ended"></i>');
}
return this;
}
});
});

View File

@ -1,5 +1,8 @@
'use strict';
define(['app', 'Cells/TemplatedCell'], function (App, TemplatedCell) {
define(
[
'Cells/TemplatedCell'
], function (TemplatedCell) {
return TemplatedCell.extend({
className: 'series-title',

View File

@ -1,7 +1,13 @@
'use strict';
define(['app','Cells/NzbDroneCell'], function () {
return NzbDrone.Cells.NzbDroneCell.extend({
define(
[
'marionette',
'Cells/NzbDroneCell'
], function (Marionette, NzbDroneCell) {
return NzbDroneCell.extend({
render: function () {
var templateName = this.column.get('template') || this.template;

View File

@ -1,6 +1,9 @@
'use strict';
define(['app', 'Episode/Layout'], function () {
define(
[
'backgrid'
], function (Backgrid) {
return Backgrid.Cell.extend({
className: 'toggle-cell clickable',

View File

@ -1,7 +1,6 @@
'use strict';
define(['app'], function () {
NzbDrone.Commands.Execute = function (name, properties) {
define({
Execute: function (name, properties) {
var data = { command: name };
if (properties) {
@ -10,8 +9,8 @@ define(['app'], function () {
return $.ajax({
type: 'POST',
url : NzbDrone.Constants.ApiRoot + '/command',
url : window.ApiRoot + '/command',
data: JSON.stringify(data)
});
};
}
});

View File

@ -2,18 +2,16 @@
define(
[
'app'
], function () {
NzbDrone.Config = {
], function (App) {
return {
Events: {
ConfigUpdatedEvent: 'ConfigUpdatedEvent'
},
Keys : {
DefaultQualityProfileId: 'DefaultQualityProfileId'
}
};
},
NzbDrone.Config.GetValue = function (key, defaultValue) {
GetValue: function (key, defaultValue) {
var storeValue = localStorage.getItem(key);
@ -22,21 +20,20 @@ define(
}
return storeValue.toString();
};
},
NzbDrone.Config.SetValue = function (key, value) {
SetValue: function (key, value) {
console.log('Config: [{0}] => [{1}] '.format(key, value));
if (NzbDrone.Config.GetValue(key) === value.toString()) {
if (this.GetValue(key) === value.toString()) {
return;
}
localStorage.setItem(key, value);
NzbDrone.vent.trigger(NzbDrone.Config.Events.ConfigUpdatedEvent, {key: key, value: value});
App.vent.trigger(this.Events.ConfigUpdatedEvent, {key: key, value: value});
}
};
return NzbDrone.Config;
});

View File

@ -244,10 +244,6 @@ ul.messenger-theme-future {
-ms-border-radius: 4px;
-o-border-radius: 4px;
border-radius: 4px;
-moz-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
user-select: none;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5c5b5b), color-stop(100%, #353535));
background-image: -webkit-linear-gradient(#5c5b5b, #353535);
background-image: -moz-linear-gradient(#5c5b5b, #353535);

View File

@ -1,4 +1,4 @@
.control-group {
.control-group {
.controls {
i.danger {
color: #b94a48;
@ -19,6 +19,14 @@
margin-bottom: 0px;
}
.help-inline-checkbox {
padding-left: 5px;
display: inline-block;
@ -35,6 +43,8 @@
font-size: 12px;
}
textarea.nzb-restrictions {
width: 260px;
}

View File

@ -1,40 +1,36 @@
'use strict';
'use strict';
define(
[
'app',
'marionette',
'History/HistoryLayout',
'Settings/SettingsLayout',
'AddSeries/AddSeriesLayout',
'Missing/MissingLayout',
'History/HistoryLayout',
'Form/FormBuilder',
'Series/Index/SeriesIndexLayout',
'Calendar/CalendarLayout',
'Shared/NotificationView',
'Shared/NotFoundView',
'MainMenuView',
'Series/Details/SeriesDetailsLayout',
'Series/EpisodeCollection',
'Missing/MissingLayout',
'Series/SeriesModel',
'Calendar/CalendarLayout',
'Logs/Layout',
'Release/Layout',
'Shared/FormatHelpers',
'Shared/TemplateHelpers',
'Shared/Footer/View'
], function (App, SettingsLayout, AddSeriesLayout, MissingLayout, HistoryLayout) {
var controller = Backbone.Marionette.Controller.extend({
'Shared/NotFoundView'
], function (App, Marionette, HistoryLayout, SettingsLayout, AddSeriesLayout, SeriesIndexLayout, SeriesDetailsLayout, MissingLayout, SeriesModel, CalendarLayout, NotFoundView,
LogsLayout, ReleaseLayout) {
return Marionette.Controller.extend({
series : function () {
this._setTitle('NzbDrone');
App.mainRegion.show(new NzbDrone.Series.Index.SeriesIndexLayout());
App.mainRegion.show(new SeriesIndexLayout());
},
seriesDetails: function (query) {
var self = this;
this._setTitle('Loading Series');
var series = new NzbDrone.Series.SeriesModel({ id: query });
var series = new SeriesModel({ id: query });
series.fetch({
success: function (seriesModel) {
self._setTitle(seriesModel.get('title'));
App.mainRegion.show(new NzbDrone.Series.Details.SeriesDetailsLayout({ model: seriesModel }));
App.mainRegion.show(new SeriesDetailsLayout({ model: seriesModel }));
}
});
},
@ -46,7 +42,7 @@ define(
calendar: function () {
this._setTitle('Calendar');
App.mainRegion.show(new NzbDrone.Calendar.CalendarLayout());
App.mainRegion.show(new CalendarLayout());
},
@ -69,17 +65,17 @@ define(
rss: function () {
this._setTitle('RSS');
App.mainRegion.show(new NzbDrone.Release.Layout());
App.mainRegion.show(new ReleaseLayout());
},
logs: function () {
this._setTitle('logs');
App.mainRegion.show(new NzbDrone.Logs.Layout());
App.mainRegion.show(new LogsLayout());
},
notFound: function () {
this._setTitle('Not Found');
App.mainRegion.show(new NzbDrone.Shared.NotFoundView(this));
App.mainRegion.show(new NotFoundView(this));
},
@ -112,8 +108,5 @@ define(
}
}
});
return new controller();
});

View File

@ -1,7 +1,14 @@
'use strict';
define(['app', 'Shared/SpinnerView', 'Episode/Summary/View', 'Episode/Search/Layout', 'Release/Collection'], function () {
define(
[
'marionette',
'Episode/Summary/View',
'Episode/Search/Layout',
'Release/Collection',
'Shared/SpinnerView'
], function (Marionette, SummaryView, SearchLayout, ReleaseCollection, SpinnerView) {
NzbDrone.Episode.Layout = Backbone.Marionette.Layout.extend({
return Marionette.Layout.extend({
template: 'Episode/LayoutTemplate',
@ -37,7 +44,7 @@ define(['app', 'Shared/SpinnerView', 'Episode/Summary/View', 'Episode/Search/Lay
}
this.ui.summary.tab('show');
this.summary.show(new NzbDrone.Episode.Summary.View({model: this.model}));
this.summary.show(new SummaryView({model: this.model}));
},
@ -61,14 +68,14 @@ define(['app', 'Shared/SpinnerView', 'Episode/Summary/View', 'Episode/Search/Lay
var self = this;
this.ui.search.tab('show');
this.search.show(new NzbDrone.Shared.SpinnerView());
this.search.show(new SpinnerView());
var releases = new NzbDrone.Release.Collection();
var releases = new ReleaseCollection();
var promise = releases.fetchEpisodeReleases(this.model.id);
promise.done(function () {
if (!self.isClosed) {
self.search.show(new NzbDrone.Episode.Search.Layout({collection: releases}));
self.search.show(new SearchLayout({collection: releases}));
}
});
}

View File

@ -1,20 +1,23 @@
'use strict';
define([
'app',
define(
[
'marionette',
'backgrid',
'Cells/FileSizeCell',
'Cells/QualityCell',
'Release/ApprovalStatusCell',
'Release/DownloadReportCell'
], function () {
], function (Marionette, Backgrid, FileSizeCell, QualityCell, ApprovalStatusCell, DownloadReportCell) {
NzbDrone.Episode.Search.Layout = Backbone.Marionette.Layout.extend({
return Marionette.Layout.extend({
template: 'Episode/Search/LayoutTemplate',
regions: {
grid: '#episode-release-grid'
},
columns: [
columns:
[
{
name : 'age',
label : 'Age',
@ -31,31 +34,30 @@ define([
name : 'size',
label : 'Size',
sortable: true,
cell : NzbDrone.Cells.FileSizeCell
cell : FileSizeCell
},
{
name : 'quality',
label : 'Quality',
sortable: true,
cell : NzbDrone.Cells.QualityCell
cell : QualityCell
},
{
name : 'rejections',
label: 'decision',
cell : NzbDrone.Release.ApprovalStatusCell
cell : ApprovalStatusCell
},
{
name : 'download',
label: '',
cell : NzbDrone.Release.DownloadReportCell
cell : DownloadReportCell
}
],
onShow: function () {
if (!this.isClosed) {
this.grid.show(new Backgrid.Grid(
{
this.grid.show(new Backgrid.Grid({
row : Backgrid.Row,
columns : this.columns,
collection: this.collection,

View File

@ -1,7 +1,10 @@
'use strict';
define(['app'], function () {
define(
[
'marionette'
], function (Marionette) {
NzbDrone.Episode.Summary.View = Backbone.Marionette.ItemView.extend({
return Marionette.ItemView.extend({
template: 'Episode/Summary/ViewTemplate'
});

View File

@ -1,31 +1,50 @@
'use strict';
define(['app', 'handlebars'], function (App,Handlebars) {
define(
[
'handlebars'
], function (Handlebars) {
var formBuilder = function (field) {
if (!field.type) {
return Handlebars.helpers.partial.apply(field,
[
'Form/TextboxTemplate'
]);
}
if (field.type === 'password') {
return Handlebars.helpers.partial.apply(field,
[
'Form/PasswordTemplate'
]);
}
if (field.type === 'checkbox') {
return Handlebars.helpers.partial.apply(field,
[
'Form/CheckboxTemplate'
]);
}
if (field.type === 'select') {
return Handlebars.helpers.partial.apply(field,
[
'Form/SelectTemplate'
]);
}
return Handlebars.helpers.partial.apply(field,
[
'Form/TextboxTemplate'
]);
};
Handlebars.registerHelper('formBuilder', function () {
var ret = '';
_.each(this.fields, function (field) {
ret += NzbDrone.Form.FieldBuilder(field);
ret += this.FieldBuilder(field);
});
return new Handlebars.SafeString(ret);
});
NzbDrone.Form.FieldBuilder = function (field) {
if (!field.type) {
return Handlebars.helpers.partial.apply(field, ['Form/TextboxTemplate']);
}
if (field.type === 'password') {
return Handlebars.helpers.partial.apply(field, ['Form/PasswordTemplate']);
}
if (field.type === 'checkbox') {
return Handlebars.helpers.partial.apply(field, ['Form/CheckboxTemplate']);
}
if (field.type === 'select') {
return Handlebars.helpers.partial.apply(field, ['Form/SelectTemplate']);
}
return Handlebars.helpers.partial.apply(field, ['Form/TextboxTemplate']);
};
});

View File

@ -1,6 +1,9 @@
'use strict';
'use strict';
define(['templates'], function (Templates) {
define(
[
'templates'
], function (Templates) {
return function () {
this.get = function (templateId) {

View File

@ -1,8 +1,12 @@
'use strict';
define(['app', 'History/Model', 'backbone.pageable'], function (App, HistoryModel, PageableCollection) {
'use strict';
define(
[
'History/Model',
'backbone.pageable'
], function ( HistoryModel, PageableCollection) {
return PageableCollection.extend({
url : NzbDrone.Constants.ApiRoot + '/history',
model : NzbDrone.History.Model,
url : window.ApiRoot + '/history',
model: HistoryModel,
state: {
pageSize: 15,
@ -22,7 +26,7 @@ define(['app', 'History/Model', 'backbone.pageable'], function (App, HistoryMode
}
},
parseState: function (resp, queryParams, state) {
parseState: function (resp) {
return {totalRecords: resp.totalRecords};
},

View File

@ -1,7 +1,10 @@
'use strict';
define(['app', 'Cells/NzbDroneCell' ], function () {
return NzbDrone.Cells.NzbDroneCell.extend({
define(
[
'Cells/NzbDroneCell'
], function (NzbDroneCell) {
return NzbDroneCell.extend({
className: 'history-event-type-cell',

View File

@ -1,33 +1,19 @@
'use strict';
define([
'app',
define(
[
'marionette',
'backgrid',
'History/Collection',
'History/EventTypeCell',
'Cells/RelativeDateCell',
'Cells/TemplatedCell',
'Cells/SeriesTitleCell',
'Cells/EpisodeNumberCell',
'Cells/EpisodeTitleCell',
'Cells/QualityCell',
'Shared/Toolbar/ToolbarLayout',
'Cells/RelativeDateCell',
'Shared/Grid/Pager',
'Shared/Grid/HeaderCell',
'Shared/LoadingView'
],
function (App,
HistoryCollection,
EventTypeCell,
RelativeDateCell,
TemplatedCell,
SeriesTitleCell,
EpisodeNumberCell,
EpisodeTitleCell,
QualityCell,
ToolbarLayout,
Pager,
HeaderCell,
LoadingView) {
return Backbone.Marionette.Layout.extend({
], function (Marionette, Backgrid, HistoryCollection, EventTypeCell, SeriesTitleCell, EpisodeNumberCell, EpisodeTitleCell, QualityCell, RelativeDateCell, GridPager, LoadingView) {
return Marionette.Layout.extend({
template: 'History/HistoryLayoutTemplate',
regions: {
@ -36,7 +22,8 @@ define([
pager : '#x-pager'
},
columns: [
columns:
[
{
name : 'eventType',
label: '',
@ -71,19 +58,17 @@ define([
}
],
_showTable: function () {
_showTable: function (collection) {
this.history.show(new Backgrid.Grid(
{
row : NzbDrone.History.Row,
this.history.show(new Backgrid.Grid({
columns : this.columns,
collection: this.historyCollection,
collection: collection,
className : 'table table-hover'
}));
this.pager.show(new Pager({
this.pager.show(new GridPager({
columns : this.columns,
collection: this.historyCollection
collection: collection
}));
},
@ -92,16 +77,11 @@ define([
this.history.show(new LoadingView());
this.historyCollection = new HistoryCollection();
this.historyCollection.fetch()
.done(function () {
self._showTable();
var collection = new HistoryCollection();
collection.fetch().done(function () {
self._showTable(collection);
});
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
}
})
;
})
;
});
});

View File

@ -1,6 +1,11 @@
'use strict';
define(['app','Series/SeriesModel', 'Series/EpisodeModel'], function () {
NzbDrone.History.Model = Backbone.Model.extend({
'use strict';
define(
[
'backbone',
'Series/SeriesModel',
'Series/EpisodeModel'
], function (Backbone, SeriesModel, EpisodeModel) {
return Backbone.Model.extend({
mutators: {
seasonNumber: function () {
return this.get('episode').seasonNumber;
@ -12,11 +17,9 @@ define(['app','Series/SeriesModel', 'Series/EpisodeModel'], function () {
},
parse: function (model) {
model.series = new NzbDrone.Series.SeriesModel(model.series);
model.episode = new NzbDrone.Series.EpisodeModel(model.episode);
model.series = new SeriesModel(model.series);
model.episode = new EpisodeModel(model.episode);
return model;
}
});
});

View File

@ -1,28 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>NzbDrone</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link href="/content/font.css" rel='stylesheet' type='text/css'/>
<link href="/content/bootstrap.css" rel='stylesheet' type='text/css'/>
<link href="/content/bootstrap.slider.css" rel='stylesheet' type='text/css'/>
<link href="/Content/Font.css" rel='stylesheet' type='text/css'/>
<link href="/Content/Bootstrap.css" rel='stylesheet' type='text/css'/>
<link href="/Content/bootstrap.slider.css" rel='stylesheet' type='text/css'/>
<link href="/Content/Messenger/messenger.css" rel='stylesheet' type='text/css'/>
<link href="/Content/Messenger/messenger.future.css" rel='stylesheet' type='text/css'/>
<link href="/content/theme.css" rel='stylesheet' type='text/css'>
<link href="/Cells/cells.css" rel='stylesheet' type='text/css'>
<link href="/content/fullcalendar.css" rel='stylesheet' type='text/css'>
<link href="/content/backbone.css" rel='stylesheet' type='text/css'/>
<link href="/content/backbone.backgrid.filter.css" rel='stylesheet' type='text/css'/>
<link href="/content/bootstrap.toggle-switch.css" rel='stylesheet' type='text/css'/>
<link href="/AddSeries/addseries.css" rel='stylesheet' type='text/css'/>
<link href="/content/menu.css" rel='stylesheet' type='text/css'/>
<link href="/content/form.css" rel='stylesheet' type='text/css'/>
<link href="/series/series.css" rel='stylesheet' type='text/css'/>
<link href="/series/details.css" rel='stylesheet' type='text/css'/>
<link href="/content/base.css" rel='stylesheet' type='text/css'/>
<link href="/settings/notifications/notifications.css" rel='stylesheet' type='text/css'/>
<link href="/settings/indexers/indexers.css" rel='stylesheet' type='text/css'/>
<link href="/calendar/calendar.css" rel='stylesheet' type='text/css'/>
<link href="/Content/Theme.css" rel='stylesheet' type='text/css'>
<link href="/Cells/Cells.css" rel='stylesheet' type='text/css'>
<link href="/Content/fullcalendar.css" rel='stylesheet' type='text/css'>
<link href="/Content/Backbone.css" rel='stylesheet' type='text/css'/>
<link href="/Content/backbone.backgrid.filter.css" rel='stylesheet' type='text/css'/>
<link href="/Content/bootstrap.toggle-switch.css" rel='stylesheet' type='text/css'/>
<link href="/AddSeries/Addseries.css" rel='stylesheet' type='text/css'/>
<link href="/Content/menu.css" rel='stylesheet' type='text/css'/>
<link href="/Content/form.css" rel='stylesheet' type='text/css'/>
<link href="/Series/Series.css" rel='stylesheet' type='text/css'/>
<link href="/Series/Details.css" rel='stylesheet' type='text/css'/>
<link href="/Content/Base.css" rel='stylesheet' type='text/css'/>
<link href="/Settings/Notifications/notifications.css" rel='stylesheet' type='text/css'/>
<link href="/Settings/Indexers/indexers.css" rel='stylesheet' type='text/css'/>
<link href="/Calendar/Calendar.css" rel='stylesheet' type='text/css'/>
</head>
<body>
<div id="in-sub-nav">

View File

@ -1,14 +1,6 @@
'use strict';
'use strict';
(function () {
/* var model = new NzbDrone.Shared.NotificationModel();
model.set('title','test notification');
model.set('message','test message');
model.set('level', 'error');
this.push(model);
*/
if (!window.console) {
window.console = {};
}

View File

@ -1,8 +1,8 @@
'use strict';
define(['app', 'Logs/Model', 'backbone.pageable'], function (app, SeriesModel, PagableCollection) {
NzbDrone.Logs.Collection = PagableCollection.extend({
url : NzbDrone.Constants.ApiRoot + '/log',
model: NzbDrone.Logs.Model,
'use strict';
define(['backbone.pageable', 'Logs/Model', ], function (PagableCollection, LogsModel) {
return PagableCollection.extend({
url : window.ApiRoot + '/log',
model: LogsModel,
state: {
pageSize: 50,

View File

@ -1,12 +1,12 @@
'use strict';
define([
'app',
'Logs/Collection',
'Shared/Toolbar/ToolbarLayout',
'Shared/Grid/Pager'
'marionette',
'backgrid',
'Shared/Grid/Pager',
'Logs/Collection'
],
function () {
NzbDrone.Logs.Layout = Backbone.Marionette.Layout.extend({
function (Marionette,Backgrid, GridPager, LogCollection) {
return Marionette.Layout.extend({
template: 'Logs/LayoutTemplate',
regions: {
@ -51,20 +51,19 @@ define([
className : 'table table-hover'
}));
this.pager.show(new NzbDrone.Shared.Grid.Pager({
this.pager.show(new GridPager({
columns : this.columns,
collection: this.collection
}));
},
initialize: function () {
this.collection = new NzbDrone.Logs.Collection();
this.collection = new LogCollection();
this.collection.fetch();
},
onShow: function () {
this.showTable();
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
}
})

View File

@ -1,14 +1,8 @@
'use strict';
define(['app'], function (app) {
NzbDrone.Logs.Model = Backbone.Model.extend({
/* mutators: {
seasonNumber: function () {
return this.get('episode').seasonNumber;
},
paddedEpisodeNumber: function () {
return this.get('episode').episodeNumber.pad(2);
}
}*/
'use strict';
define(
[
'backbone'
], function (Backbone) {
return Backbone.Model.extend({
});
});

View File

@ -1,6 +1,6 @@
'use strict';
define(['app'], function () {
var MainMenuView = Backbone.Marionette.ItemView.extend({
'use strict';
define(['marionette'], function (Marionette) {
var MainMenuView = Marionette.ItemView.extend({
events: {
'click a': 'onClick'
},

View File

@ -1,8 +1,12 @@
'use strict';
define(['app', 'Series/EpisodeModel', 'backbone.pageable'], function (app, EpisodeModel, PagableCollection) {
'use strict';
define(
[
'Series/EpisodeModel',
'backbone.pageable'
], function (EpisodeModel, PagableCollection) {
return PagableCollection.extend({
url : NzbDrone.Constants.ApiRoot + '/missing',
model: NzbDrone.Series.EpisodeModel,
url : window.ApiRoot + '/missing',
model: EpisodeModel,
state: {
pageSize: 15,
@ -22,7 +26,7 @@ define(['app', 'Series/EpisodeModel', 'backbone.pageable'], function (app, Episo
}
},
parseState: function (resp, queryParams, state) {
parseState: function (resp) {
return {totalRecords: resp.totalRecords};
},

View File

@ -1,29 +1,17 @@
'use strict';
define(
[
'app',
'Missing/Row',
'marionette',
'backgrid',
'Missing/Collection',
'Cells/AirDateCell',
'Series/Index/Table/SeriesStatusCell',
'Shared/Toolbar/ToolbarLayout',
'Cells/SeriesTitleCell',
'Cells/EpisodeNumberCell',
'Cells/EpisodeTitleCell',
'Cells/AirDateCell',
'Shared/Grid/Pager',
'Shared/LoadingView'
], function (App,
MissingRow,
MissingCollection,
AirDateCell,
SeriesStatusCell,
ToolbarLayout,
SeriesTitleCell,
EpisodeNumberCell,
EpisodeTitleCell,
Pager,
LoadingView) {
return Backbone.Marionette.Layout.extend({
], function (Marionette, Backgrid, MissingCollection, SeriesTitleCell, EpisodeNumberCell, EpisodeTitleCell, AirDateCell, GridPager, LoadingView) {
return Marionette.Layout.extend({
template: 'Missing/MissingLayoutTemplate',
regions: {
@ -61,13 +49,12 @@ define(
_showTable: function () {
this.missing.show(new Backgrid.Grid({
row : MissingRow,
columns : this.columns,
collection: this.missingCollection,
className : 'table table-hover'
}));
this.pager.show(new NzbDrone.Shared.Grid.Pager({
this.pager.show(new GridPager({
columns : this.columns,
collection: this.missingCollection
}));

View File

@ -1,12 +1,12 @@
'use strict';
'use strict';
define(['app'], function () {
define(function () {
$.fn.autoComplete = function (resource) {
$(this).typeahead({
source : function (filter, callback) {
$.ajax({
url : NzbDrone.Constants.ApiRoot + resource,
url : window.ApiRoot + resource,
dataType: 'json',
type : 'GET',
data : { query: filter },

View File

@ -1,5 +1,8 @@
'use strict';
define(['app', 'signalR'], function () {
define(
[
'signalR'
], function () {
_.extend(Backbone.Collection.prototype, {BindSignalR: function (options) {
@ -40,7 +43,10 @@ define(['app', 'signalR'], function () {
self.fetch();
});
connection.start({ transport: ['longPolling'] });
connection.start({ transport:
[
'longPolling'
] });
return this;
}});

View File

@ -1,9 +1,10 @@
'use strict';
define(['app', 'Quality/QualitySizeModel'], function () {
NzbDrone.Quality.QualitySizeCollection = Backbone.Collection.extend({
model: NzbDrone.Quality.QualitySizeModel,
url : NzbDrone.Constants.ApiRoot + '/qualitysize'
'use strict';
define(
[
'Quality/QualitySizeModel'
], function (QualitySizeModel) {
return Backbone.Collection.extend({
model: QualitySizeModel,
url : window.ApiRoot + '/qualitysize'
});
return NzbDrone.Quality.QualitySizeCollection;
});

View File

@ -1,10 +1,9 @@
'use strict';
define(['app'], function () {
NzbDrone.Quality.QualitySizeModel = Backbone.Model.extend({
initialize: function () {
this.validators = {};
},
'use strict';
define(
[
'backbone'
], function (Backbone) {
return Backbone.Model.extend({
mutators: {
thirtyMinuteSize: function () {

View File

@ -1,12 +1,16 @@
'use strict';
define(['app', 'Quality/QualityProfileModel'], function () {
'use strict';
define(
[
'backbone',
'Quality/QualityProfileModel'
], function (Backbone, QualityProfileModel) {
var qualityProfileCollection = Backbone.Collection.extend({
model: NzbDrone.Quality.QualityProfileModel,
url : NzbDrone.Constants.ApiRoot + '/qualityprofiles'
var QualityProfileCollection = Backbone.Collection.extend({
model: QualityProfileModel,
url : window.ApiRoot + '/qualityprofiles'
});
var profiles = new qualityProfileCollection();
var profiles = new QualityProfileCollection();
profiles.fetch();

View File

@ -1,7 +1,9 @@
'use strict';
define(['app', 'backbone.deepmodel'], function (App, DeepModel) {
NzbDrone.Quality.QualityProfileModel = DeepModel.DeepModel.extend({
'use strict';
define(
[
'backbone.deepmodel'
], function (DeepModel) {
return DeepModel.DeepModel.extend({
defaults: {
id : null,
name : '',

View File

@ -1,7 +1,11 @@
'use strict';
define(
[
'backgrid'
], function (Backgrid) {
require(['app', 'backgrid'], function () {
NzbDrone.Release.ApprovalStatusCell = Backgrid.Cell.extend({
return Backgrid.Cell.extend({
className: 'approval-status-cell',

View File

@ -1,8 +1,12 @@
'use strict';
define(['app', 'Release/Model', 'backbone.pageable'], function (app, SeriesModel, PagableCollection) {
NzbDrone.Release.Collection = PagableCollection.extend({
url : NzbDrone.Constants.ApiRoot + '/release',
model: NzbDrone.Release.Model,
'use strict';
define(
[
'Release/Model',
'backbone.pageable'
], function (ReleaseModel, PagableCollection) {
return PagableCollection.extend({
url : window.ApiRoot + '/release',
model: ReleaseModel,
mode: 'client',

View File

@ -1,7 +1,10 @@
'use strict';
define(['app','backgrid'], function () {
NzbDrone.Release.DownloadReportCell = Backgrid.Cell.extend({
define(
[
'backgrid'
], function (Backgrid) {
return Backgrid.Cell.extend({
className: 'download-report-cell',
@ -14,8 +17,7 @@ define(['app','backgrid'], function () {
var self = this;
this.$el.html('<i class =\'icon-spinner icon-spin\' />');
this.model.save()
.always(function () {
this.model.save().always(function () {
self.$el.html('<i class =\'icon-download-alt\' />');
});
},
@ -27,7 +29,4 @@ define(['app','backgrid'], function () {
}
});
return NzbDrone.Release.DownloadReportCell;
});

View File

@ -1,17 +1,17 @@
'use strict';
define([
'app',
define(
[
'marionette',
'backgrid',
'Release/Collection',
'Release/ApprovalStatusCell',
'Shared/SpinnerView',
'Shared/Toolbar/ToolbarLayout',
'Cells/IndexerCell',
'Cells/EpisodeNumberCell',
'Cells/FileSizeCell',
'Cells/IndexerCell',
'Cells/QualityCell'
],
function () {
NzbDrone.Release.Layout = Backbone.Marionette.Layout.extend({
'Cells/QualityCell',
'Release/ApprovalStatusCell',
'Shared/SpinnerView'
], function (Marionette, Backgrid, ReleaseCollection, IndexerCell, EpisodeNumberCell, FileSizeCell, QualityCell, ApprovalStatusCell, SpinnerView) {
return Marionette.Layout.extend({
template: 'Release/LayoutTemplate',
regions: {
@ -19,12 +19,13 @@ define([
toolbar: '#x-toolbar'
},
columns: [
columns:
[
{
name : 'indexer',
label : 'Indexer',
sortable: true,
cell : NzbDrone.Cells.IndexerCell
cell : IndexerCell
},
{
@ -37,32 +38,31 @@ define([
name : 'episodeNumbers',
episodes: 'episodeNumbers',
label : 'season',
cell : NzbDrone.Cells.EpisodeNumberCell
cell : EpisodeNumberCell
},
{
name : 'size',
label : 'Size',
sortable: true,
cell : NzbDrone.Cells.FileSizeCell
cell : FileSizeCell
},
{
name : 'quality',
label : 'Quality',
sortable: true,
cell : NzbDrone.Cells.QualityCell
cell : QualityCell
},
{
name : 'rejections',
label: 'decision',
cell : NzbDrone.Release.ApprovalStatusCell
cell : ApprovalStatusCell
}
],
showTable: function () {
if (!this.isClosed) {
this.grid.show(new Backgrid.Grid(
{
this.grid.show(new Backgrid.Grid({
row : Backgrid.Row,
columns : this.columns,
collection: this.collection,
@ -72,7 +72,7 @@ define([
},
initialize: function () {
this.collection = new NzbDrone.Release.Collection();
this.collection = new ReleaseCollection();
this.fetchPromise = this.collection.fetch();
},
@ -80,12 +80,11 @@ define([
var self = this;
this.grid.show(new NzbDrone.Shared.SpinnerView());
this.grid.show(new SpinnerView());
this.fetchPromise.done(function () {
self.showTable();
});
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
}
});

View File

@ -1,6 +1,6 @@
'use strict';
define(['app'], function () {
NzbDrone.Release.Model = Backbone.Model.extend({
'use strict';
define(['backbone'], function (Backbone) {
return Backbone.Model.extend({
/* mutators: {
seasonNumber: function () {
return this.get('episode').seasonNumber;

View File

@ -1,4 +1,4 @@
'use strict';
'use strict';
require(
[
'app',
@ -7,9 +7,9 @@ require(
'jQuery/RouteBinder'
], function (App, Marionette, Controller, RouterBinder) {
NzbDrone.Router = Marionette.AppRouter.extend({
var Router = Marionette.AppRouter.extend({
controller: Controller,
controller: new Controller(),
appRoutes : {
'' : 'series',
'series' : 'series',
@ -28,17 +28,16 @@ require(
}
});
NzbDrone.addInitializer(function () {
App.addInitializer(function () {
NzbDrone.Router = new NzbDrone.Router();
App.Router = new Router();
Backbone.history.start({ pushState: true });
RouterBinder.bind(NzbDrone.Router);
// NzbDrone.footerRegion.show(new FooterView());
RouterBinder.bind(App.Router);
});
return NzbDrone.Router;
return App.Router;
});

View File

@ -2,10 +2,10 @@
define(
[
'app',
'Series/SeriesModel'
], function () {
'marionette'
], function (App, Marionette) {
NzbDrone.Series.Delete.DeleteSeriesView = Backbone.Marionette.ItemView.extend({
return Marionette.ItemView.extend({
template: 'Series/Delete/DeleteSeriesTemplate',
events: {
@ -24,11 +24,8 @@ define(
data: { 'deleteFiles': deleteFiles },
wait: true
}).done(function () {
NzbDrone.modalRegion.close();
App.modalRegion.close();
});
}
});
return NzbDrone.Series.Delete.DeleteSeriesView;
});

View File

@ -1,10 +1,10 @@
'use strict';
define(['app',
'Series/Details/SeasonLayout',
'Series/SeasonCollection',
'Series/EpisodeCollection'],
function (App, SeasonLayout, SeasonCollection, EpisodeCollection) {
NzbDrone.Series.Details.SeasonCollectionView = Backbone.Marionette.CollectionView.extend({
define(
[
'marionette',
'Series/Details/SeasonLayout'
], function (Marionette, SeasonLayout) {
return Marionette.CollectionView.extend({
itemView: SeasonLayout,

View File

@ -1,13 +1,17 @@
'use strict';
define([
'app',
'Cells/EpisodeStatusCell',

'use strict';
define(
[
'marionette',
'backgrid',
'Cells/ToggleCell',
'Cells/EpisodeTitleCell',
'Cells/AirDateCell',
'Cells/ToggleCell',
'Shared/Messenger'],
function (App, EpisodeStatusCell, EpisodeTitleCell, AirDateCell, ToggleCell, Messenger) {
return Backbone.Marionette.Layout.extend({
'Cells/EpisodeStatusCell',
'Commands/CommandController',
'Shared/Messenger'
], function ( Marionette, Backgrid, ToggleCell, EpisodeTitleCell, AirDateCell, EpisodeStatusCell, CommandController, Messenger) {
return Marionette.Layout.extend({
template: 'Series/Details/SeasonLayoutTemplate',
ui: {
@ -22,8 +26,8 @@ define([
episodeGrid: '#x-episode-grid'
},
columns: [
columns:
[
{
name : 'ignored',
label : '',
@ -38,7 +42,6 @@ define([
className: 'episode-number-cell'
})
},
{
name : 'this',
label: 'Title',
@ -66,8 +69,7 @@ define([
},
onShow: function () {
this.episodeGrid.show(new Backgrid.Grid(
{
this.episodeGrid.show(new Backgrid.Grid({
columns : this.columns,
collection: this.episodeCollection,
className : 'table table-hover season-grid'
@ -87,7 +89,7 @@ define([
};
var self = this;
var commandPromise = App.Commands.Execute(command, properties);
var commandPromise = CommandController.Execute(command, properties);
commandPromise.fail(function (options) {
if (options.readyState === 0 || options.status === 0) {

View File

@ -1,6 +1,14 @@
'use strict';
define(['app', 'Series/Details/SeasonCollectionView', 'Shared/LoadingView','backstrech'], function () {
NzbDrone.Series.Details.SeriesDetailsLayout = Backbone.Marionette.Layout.extend({
define(
[
'marionette',
'Series/EpisodeCollection',
'Series/SeasonCollection',
'Series/Details/SeasonCollectionView',
'Shared/LoadingView',
'backstrech'
], function (Marionette, EpisodeCollection, SeasonCollection, SeasonCollectionView, LoadingView) {
return Marionette.Layout.extend({
itemViewContainer: '.x-series-seasons',
template : 'Series/Details/SeriesDetailsTemplate',
@ -27,19 +35,17 @@ define(['app', 'Series/Details/SeasonCollectionView', 'Shared/LoadingView','back
$('body').removeClass('backdrop');
}
this.seasons.show(new NzbDrone.Shared.LoadingView());
this.seasons.show(new LoadingView());
this.seasonCollection = new NzbDrone.Series.SeasonCollection();
this.episodeCollection = new NzbDrone.Series.EpisodeCollection();
this.seasonCollection = new SeasonCollection();
this.episodeCollection = new EpisodeCollection();
$.when(this.episodeCollection.fetch({data: { seriesId: this.model.id }}), this.seasonCollection.fetch({data: { seriesId: this.model.id }}))
.done(function () {
self.seasons.show(new NzbDrone.Series.Details.SeasonCollectionView({
$.when(this.episodeCollection.fetch({data: { seriesId: this.model.id }}), this.seasonCollection.fetch({data: { seriesId: this.model.id }})).done(function () {
self.seasons.show(new SeasonCollectionView({
collection : self.seasonCollection,
episodeCollection: self.episodeCollection
}));
}
);
});
},
onClose: function () {
@ -47,5 +53,4 @@ define(['app', 'Series/Details/SeasonCollectionView', 'Shared/LoadingView','back
$('body').removeClass('backdrop');
}
});
}
);
});

View File

@ -1,7 +1,14 @@
'use strict';
define(['app', 'Series/SeriesModel', 'Series/Delete/DeleteSeriesView', 'Quality/QualityProfileCollection'], function (app, seriesModel, deleteSeriesView, qualityProfiles) {
'use strict';
define(
[
'App',
'marionette',
'Series/Delete/DeleteSeriesView',
'Quality/QualityProfileCollection',
'Mixins/AsModelBoundView'
], function (App, Marionette, DeleteSeriesView, QualityProfiles, AsModelBoundView) {
NzbDrone.Series.Edit.EditSeriesView = Backbone.Marionette.ItemView.extend({
var view = Marionette.ItemView.extend({
template: 'Series/Edit/EditSeriesTemplate',
ui: {
@ -17,9 +24,7 @@ define(['app', 'Series/SeriesModel', 'Series/Delete/DeleteSeriesView', 'Quality/
initialize: function () {
this.model.set('qualityProfiles',qualityProfiles);
this.model.set('qualityProfiles', QualityProfiles);
},
@ -33,13 +38,13 @@ define(['app', 'Series/SeriesModel', 'Series/Delete/DeleteSeriesView', 'Quality/
this.model.save();
this.trigger('saved');
NzbDrone.modalRegion.closeModal();
App.modalRegion.closeModal();
},
removeSeries: function () {
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
NzbDrone.modalRegion.show(view);
var view = new DeleteSeriesView({ model: this.model });
App.modalRegion.show(view);
}
});
return AsModelBoundView.apply(view);
});

View File

@ -1,18 +1,21 @@
'use strict';
define(['app', 'Series/EpisodeModel'], function () {
NzbDrone.Series.EpisodeCollection = Backbone.Collection.extend({
url : NzbDrone.Constants.ApiRoot + '/episodes',
model: NzbDrone.Series.EpisodeModel,
'use strict';
define(
[
'backbone',
'Series/EpisodeModel'
], function (Backbone, EpisodeModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/episodes',
model: EpisodeModel,
bySeason: function (season) {
var filtered = this.filter(function (episode) {
return episode.get('seasonNumber') === season;
});
return new NzbDrone.Series.EpisodeCollection(filtered);
var EpisodeCollection = require('Series/EpisodeCollection');
return new EpisodeCollection(filtered);
}
});
return NzbDrone.Series.EpisodeCollection;
});

View File

@ -1,10 +1,13 @@
'use strict';
define(['app', 'Series/SeriesModel'], function () {
NzbDrone.Series.EpisodeModel = Backbone.Model.extend({
define(
[
'backbone',
'Series/SeriesModel'
], function (Backbone, SeriesModel) {
return Backbone.Model.extend({
mutators: {
paddedEpisodeNumber: function () {
var test = this.get('episodeNumber');
return this.get('episodeNumber').pad(2);
},
day : function () {
@ -30,6 +33,8 @@ define(['app', 'Series/SeriesModel'], function () {
return start.addMinutes(runtime);
}
return undefined;
},
statusLevel : function () {
var episodeFileId = this.get('episodeFileId');
@ -58,7 +63,7 @@ define(['app', 'Series/SeriesModel'], function () {
parse: function (model) {
model.series = new NzbDrone.Series.SeriesModel(model.series);
model.series = new SeriesModel(model.series);
return model;
},
@ -70,13 +75,13 @@ define(['app', 'Series/SeriesModel'], function () {
// check if we have some getter mutations
if (_.isObject(this.mutators[name]) === true && _.isFunction(this.mutators[name].get)) {
json[name] = _.bind(this.mutators[name].get, this)();
} else {
}
else {
json[name] = _.bind(this.mutators[name], this)();
}
}, this));
if (this.has('series'))
{
if (this.has('series')) {
json.series = this.get('series').toJSON();
}
return json;
@ -87,6 +92,4 @@ define(['app', 'Series/SeriesModel'], function () {
status : 0
}
});
return NzbDrone.Series.EpisodeModel;
});

View File

@ -1,8 +1,9 @@
'use strict';
define(['app'], function () {
NzbDrone.Series.Index.EmptySeriesCollectionView = Backbone.Marionette.CompositeView.extend({
'use strict';
define(
[
'marionette'
], function (Marionette) {
return Marionette.CompositeView.extend({
template: 'Series/Index/EmptySeriesIndexTemplate'
});
return NzbDrone.Series.Index.EmptySeriesCollectionView;
});

View File

@ -1,10 +1,11 @@
'use strict';
'use strict';
define(['app'], function () {
define(
[
'marionette'
], function (Marionette) {
NzbDrone.Series.Index.EmptyView = Backbone.Marionette.CompositeView.extend({
return Marionette.CompositeView.extend({
template: 'Series/Index/EmptyTemplate'
});
return NzbDrone.Series.Index.EmptyView;
});

View File

@ -1,12 +1,14 @@
'use strict';
'use strict';
define(['app', 'Series/Index/List/ItemView', 'Config'], function () {
define(
[
'marionette',
'Series/Index/List/ItemView'
], function (Marionette, ListItemView) {
NzbDrone.Series.Index.List.CollectionView = Backbone.Marionette.CompositeView.extend({
itemView : NzbDrone.Series.Index.List.ItemView,
return Marionette.CompositeView.extend({
itemView : ListItemView,
itemViewContainer: '#x-series-list',
template : 'Series/Index/List/CollectionTemplate'
});
return NzbDrone.Series.Index.List.CollectionView;
});

View File

@ -1,15 +1,14 @@
'use strict';
'use strict';
define([
define(
[
'app',
'Quality/QualityProfileCollection',
'Series/SeriesCollection',
'marionette',
'Series/Edit/EditSeriesView',
'Series/Delete/DeleteSeriesView',
'Shared/FormatHelpers'
'Series/Delete/DeleteSeriesView'
], function () {
NzbDrone.Series.Index.List.ItemView = Backbone.Marionette.ItemView.extend({
], function (App, Marionette, EditSeriesView, DeleteSeriesView) {
return Marionette.ItemView.extend({
template: 'Series/Index/List/ItemTemplate',
ui: {
@ -22,15 +21,13 @@ define([
},
editSeries: function () {
var view = new NzbDrone.Series.Edit.EditSeriesView({ model: this.model});
NzbDrone.modalRegion.show(view);
var view = new EditSeriesView({ model: this.model});
App.modalRegion.show(view);
},
removeSeries: function () {
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
NzbDrone.modalRegion.show(view);
var view = new DeleteSeriesView({ model: this.model });
App.modalRegion.show(view);
}
});
return NzbDrone.Series.Index.List.ItemView;
});

View File

@ -1,12 +1,14 @@
'use strict';
'use strict';
define(['app', 'Series/Index/Posters/ItemView', 'Config'], function () {
define(
[
'marionette',
'Series/Index/Posters/ItemView'
], function (Marionette, PosterItemView) {
NzbDrone.Series.Index.Posters.CollectionView = Backbone.Marionette.CompositeView.extend({
itemView : NzbDrone.Series.Index.Posters.ItemView,
return Marionette.CompositeView.extend({
itemView : PosterItemView,
itemViewContainer: '#x-series-posters',
template : 'Series/Index/Posters/CollectionTemplate'
});
return NzbDrone.Series.Index.Posters.CollectionView;
});

View File

@ -1,14 +1,15 @@
'use strict';
'use strict';
define([
define(
[
'app',
'Series/SeriesCollection',
'marionette',
'Series/Edit/EditSeriesView',
'Series/Delete/DeleteSeriesView'
], function () {
], function (App, Marionette, EditSeriesView, DeleteSeriesView) {
NzbDrone.Series.Index.Posters.ItemView = Backbone.Marionette.ItemView.extend({
return Marionette.ItemView.extend({
tagName : 'li',
template: 'Series/Index/Posters/ItemTemplate',
@ -27,19 +28,17 @@ define([
editSeries: function () {
var view = new NzbDrone.Series.Edit.EditSeriesView({ model: this.model});
NzbDrone.modalRegion.show(view);
var view = new EditSeriesView({ model: this.model});
App.modalRegion.show(view);
},
removeSeries: function () {
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
NzbDrone.modalRegion.show(view);
var view = new DeleteSeriesView({ model: this.model });
App.modalRegion.show(view);
},
posterHoverAction: function () {
this.ui.controls.slideToggle();
}
});
return NzbDrone.Series.Index.Posters.ItemView;
});

View File

@ -1,33 +1,22 @@
'use strict';
define([
'app',
'Series/Index/List/CollectionView',
define(
[
'marionette',
'Series/Index/Posters/CollectionView',
'Series/Index/List/CollectionView',
'Series/Index/EmptyView',
'Series/SeriesCollection',
'Cells/AirDateCell',
'Cells/SeriesTitleCell',
'Cells/SeriesStatusCell',
'Cells/TemplatedCell',
'Series/Index/Table/SeriesStatusCell',
'Series/Index/Table/Row',
'Shared/Toolbar/ToolbarLayout',
'Config',
'Shared/LoadingView'
],
function (
App,
ListCollectionView,
PosterCollectionView,
EmptyView,
SeriesCollection,
AirDateCell,
SeriesTitleCell,
SeriesStatusCell,
TemplatedCell,
ToolbarLayout,
Config,
LoadingView)
{
NzbDrone.Series.Index.SeriesIndexLayout = Backbone.Marionette.Layout.extend({
], function (Marionette, PosterCollectionView, ListCollectionView, EmptyView, SeriesCollection, AirDateCell, SeriesTitleCell, TemplatedCell, SeriesStatusCell, SeriesIndexRow,
ToolbarLayout, Config, LoadingView) {
return Marionette.Layout.extend({
template: 'Series/Index/SeriesIndexLayoutTemplate',
regions: {
@ -35,7 +24,8 @@ define([
toolbar: '#x-toolbar'
},
columns: [
columns:
[
{
name : 'status',
label: '',
@ -85,7 +75,8 @@ define([
leftSideButtons: {
type : 'default',
storeState: false,
items : [
items :
[
{
title: 'Add Series',
icon : 'icon-plus',
@ -109,9 +100,8 @@ define([
},
_showTable: function () {
var view = new Backgrid.Grid(
{
row : NzbDrone.Series.Index.Table.Row,
var view = new Backgrid.Grid({
row : SeriesIndexRow,
columns : this.columns,
collection: this.seriesCollection,
className : 'table table-hover'
@ -140,8 +130,7 @@ define([
if (this.seriesCollection.models.length === 0) {
this.series.show(new LoadingView());
this.seriesCollection.fetch()
.done(function () {
this.seriesCollection.fetch().done(function () {
if (self.seriesCollection.models.length === 0) {
self._showEmpty();
}
@ -170,7 +159,8 @@ define([
storeState : true,
menuKey : 'seriesViewMode',
defaultAction: 'listView',
items : [
items :
[
{
key : 'tableView',
title : '',
@ -193,12 +183,16 @@ define([
};
this.toolbar.show(new ToolbarLayout({
right : [ viewButtons],
left : [ this.leftSideButtons],
right :
[
viewButtons
],
left :
[
this.leftSideButtons
],
context: this
}));
}
});
return NzbDrone.Series.Index.SeriesIndexLayou;
});

View File

@ -1,22 +1,26 @@
'use strict';
define(['app','backgrid'], function () {
NzbDrone.Series.Index.Table.Row = Backgrid.Row.extend({
define(
[
'app',
'backgrid',
'Series/Edit/EditSeriesView',
'Series/Delete/DeleteSeriesView'
], function (App, Backgrid, EditSeriesView, DeleteSeriesView) {
return Backgrid.Row.extend({
events: {
'click .x-edit' : 'editSeries',
'click .x-remove': 'removeSeries'
},
editSeries: function () {
var view = new NzbDrone.Series.Edit.EditSeriesView({ model: this.model});
NzbDrone.modalRegion.show(view);
var view = new EditSeriesView({ model: this.model});
App.modalRegion.show(view);
},
removeSeries: function () {
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
NzbDrone.modalRegion.show(view);
var view = new DeleteSeriesView({ model: this.model });
App.modalRegion.show(view);
}
});
return NzbDrone.Series.Table.Row;
});

View File

@ -0,0 +1,28 @@
'use strict';
define(
[
'backgrid'
], function (Backgrid) {
return Backgrid.Cell.extend({
className: 'series-status-cell',
render: function () {
this.$el.empty();
var monitored = this.model.get('monitored');
var status = this.model.get('status');
if (!monitored) {
this.$el.html('<i class="icon-pause grid-icon" title="Not Monitored"></i>');
}
else if (status === 'continuing') {
this.$el.html('<i class="icon-play grid-icon" title="Continuing"></i>');
}
else {
this.$el.html('<i class="icon-stop grid-icon" title="Ended"></i>');
}
return this;
}
});
});

View File

@ -1,8 +1,12 @@
'use strict';
define(['app', 'Series/SeasonModel', 'backbone.pageable'], function (App, SeasonModel, PageAbleCollection) {
NzbDrone.Series.SeasonCollection = PageAbleCollection.extend({
url : NzbDrone.Constants.ApiRoot + '/season',
model: NzbDrone.Series.SeasonModel,
'use strict';
define(
[
'Series/SeasonModel',
'backbone.pageable'
], function (SeasonModel, PageAbleCollection) {
return PageAbleCollection.extend({
url : window.ApiRoot + '/season',
model: SeasonModel,
mode: 'client',
@ -17,7 +21,4 @@ define(['app', 'Series/SeasonModel', 'backbone.pageable'], function (App, Season
order : null
}
});
return NzbDrone.Series.SeasonCollection;
});

View File

@ -1,6 +1,9 @@
'use strict';
define(['app'], function () {
NzbDrone.Series.SeasonModel = Backbone.Model.extend({
'use strict';
define(
[
'backbone'
], function (Backbone) {
return Backbone.Model.extend({
mutators: {
seasonTitle: function () {
@ -18,7 +21,5 @@ define(['app'], function () {
seasonNumber: 0
}
});
return NzbDrone.Series.SeasonModel;
});

View File

@ -1,8 +1,12 @@
'use strict';
define(['app', 'Series/SeriesModel'], function () {
NzbDrone.Series.SeriesCollection = Backbone.Collection.extend({
url : NzbDrone.Constants.ApiRoot + '/series',
model: NzbDrone.Series.SeriesModel,
'use strict';
define(
[
'backbone',
'Series/SeriesModel'
], function (Backbone, SeriesModel) {
return Backbone.Collection.extend({
url : window.ApiRoot + '/series',
model: SeriesModel,
comparator: function (model) {
return model.get('title');
@ -13,6 +17,4 @@ define(['app', 'Series/SeriesModel'], function () {
order : -1
}
});
return NzbDrone.Series.SeriesCollection;
});

View File

@ -1,8 +1,12 @@
'use strict';
define(['app', 'Quality/QualityProfileCollection'], function (app, qualityProfiles) {
NzbDrone.Series.SeriesModel = Backbone.Model.extend({
'use strict';
define(
[
'backbone',
'Quality/QualityProfileCollection',
], function (Backbone, QualityProfileCollection) {
return Backbone.Model.extend({
urlRoot: NzbDrone.Constants.ApiRoot + '/series',
urlRoot: Constants.ApiRoot + '/series',
mutators: {
percentOfEpisodes: function () {
@ -64,7 +68,7 @@ define(['app', 'Quality/QualityProfileCollection'], function (app, qualityProfil
qualityProfile: function () {
var profile = qualityProfiles.get(this.get('qualityProfileId'));
var profile = QualityProfileCollection.get(this.get('qualityProfileId'));
if (profile) {
return profile.toJSON();
@ -81,7 +85,4 @@ define(['app', 'Quality/QualityProfileCollection'], function (app, qualityProfil
status : 0
}
});
return NzbDrone.Series.SeriesModel;
});

View File

@ -1,6 +1,8 @@
window.ApiRoot = '/api';
var statusText = $.ajax({
type : 'GET',
url : '/api/system/status',
url : window.ApiRoot + '/system/status',
async: false
}).responseText;

View File

@ -1,9 +1,11 @@
'use strict';
'use strict';
define([
'app', 'marionette', 'Mixins/AsModelBoundView', 'bootstrap'
], function (App, Marionette, AsModelBoundView) {
define(
[
'marionette',
'Mixins/AsModelBoundView',
'bootstrap'
], function (Marionette, AsModelBoundView) {
var view = Marionette.ItemView.extend({
template : 'Settings/DownloadClient/DownloadClientTemplate',

View File

@ -1,8 +1,12 @@
'use strict';
define(['app', 'backbone', 'Mixins/AsChangeTrackingModel'], function (App, Backbone, AsChangeTrackingModel) {
'use strict';
define(
[
'backbone',
'Mixins/AsChangeTrackingModel'
], function (Backbone, AsChangeTrackingModel) {
var model = Backbone.Model.extend({
url: App.Constants.ApiRoot + '/settings/host',
url: window.ApiRoot + '/settings/host',
initialize: function () {
this.on('change', function () {

View File

@ -1,7 +1,10 @@
'use strict';
define(['app', 'Settings/Indexers/Model'], function (App, IndexerModel) {
'use strict';
define(
[
'Settings/Indexers/Model'
], function (IndexerModel) {
return Backbone.Collection.extend({
url : App.Constants.ApiRoot + '/indexer',
url : window.ApiRoot + '/indexer',
model: IndexerModel
});
});

View File

@ -1,10 +1,10 @@
'use strict';
'use strict';
define([
'app',
define(
[
'marionette',
'Mixins/AsModelBoundView'
], function (App, Marionette, AsModelBoundView) {
], function (Marionette, AsModelBoundView) {
var view = Marionette.ItemView.extend({
template: 'Settings/Indexers/EditTemplate',

View File

@ -1,8 +1,10 @@
'use strict';
define(['app',
'Settings/SettingsModelBase'], function (App, ModelBase) {
'use strict';
define(
[
'Settings/SettingsModelBase'
], function (ModelBase) {
return ModelBase.extend({
url : App.Constants.ApiRoot + '/config/naming',
url : window.ApiRoot + '/config/naming',
successMessage: 'Naming settings saved',
errorMessage : 'Couldn\'t save naming settings'
});

View File

@ -1,8 +1,10 @@
'use strict';
define(['app',
'use strict';
define(
[
'marionette',
'Settings/Naming/NamingModel',
'Mixins/AsModelBoundView'], function (App, Marionette, NamingModel, AsModelBoundView) {
'Mixins/AsModelBoundView'
], function (Marionette, NamingModel, AsModelBoundView) {
var view = Marionette.ItemView.extend({
template: 'Settings/Naming/NamingTemplate',

View File

@ -1,7 +1,10 @@
'use strict';
define(['app', 'Settings/Notifications/Model'], function (App, NotificationModel) {
'use strict';
define(
[
'Settings/Notifications/Model'
], function (NotificationModel) {
return Backbone.Collection.extend({
url : App.Constants.ApiRoot + '/notification',
url : window.ApiRoot + '/notification',
model: NotificationModel
});
});

View File

@ -1,5 +1,8 @@
'use strict';
define(['app', 'backbone.deepmodel'], function (App, DeepModel) {
'use strict';
define(
[
'backbone.deepmodel'
], function (DeepModel) {
return DeepModel.DeepModel.extend({
});
});

View File

@ -0,0 +1,11 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Delete: {{name}}</h3>
</div>
<div class="modal-body">
<p>Are you sure you want to delete '{{name}}'?</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">cancel</button>
<button class="btn btn-danger x-confirm-delete">delete</button>
</div>

View File

@ -0,0 +1,24 @@
'use strict';
define(
[
'app',
'marionette'
], function (App, Marionette) {
return Marionette.ItemView.extend({
template: 'Quality/Profile/DeleteTemplate',
events: {
'click .x-confirm-delete': '_removeProfile'
},
_removeProfile: function () {
this.model.destroy({
wait: true
}).done(function () {
App.modalRegion.close();
});
}
});
});

View File

@ -1,11 +1,15 @@
'use strict';

'use strict';
define([
define(
[
'app',
'marionette',
'Settings/Quality/Profile/EditQualityProfileView',
'Settings/Quality/Profile/DeleteView',
'Mixins/AsModelBoundView'
], function (App, Marionette, EditProfileView, AsModelBoundView) {
], function (App, Marionette, EditProfileView, DeleteProfileView, AsModelBoundView) {
var view = Marionette.ItemView.extend({
template: 'Settings/Quality/Profile/QualityProfileTemplate',
@ -26,10 +30,11 @@ define([
},
removeQuality: function () {
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
NzbDrone.modalRegion.show(view);
var view = new DeleteProfileView({ model: this.model });
App.modalRegion.show(view);
}
});
return AsModelBoundView.call(view);
});

View File

@ -1,13 +1,12 @@
'use strict';
define([
'app',
'use strict';
define(
[
'marionette',
'Quality/QualityProfileCollection',
'Settings/Quality/Profile/QualityProfileCollectionView',
'Quality/QualitySizeCollection',
'Settings/Quality/Size/QualitySizeCollectionView'
],
function (App, Marionette, QualityProfileCollection, QualityProfileCollectionView, QualitySizeCollection, QualitySizeCollectionView) {
], function (Marionette, QualityProfileCollection, QualityProfileCollectionView, QualitySizeCollection, QualitySizeCollectionView) {
return Marionette.Layout.extend({
template: 'Settings/Quality/QualityLayoutTemplate',

View File

@ -1,11 +1,12 @@
'use strict';
define([
'use strict';
define(
[
'app',
'marionette',
'Settings/SettingsModel',
'Settings/General/GeneralSettingsModel',
'Settings/Naming/NamingView',
'Settings/Naming/NamingModel',
'Settings/Naming/NamingView',
'Settings/Quality/QualityLayout',
'Settings/Indexers/CollectionView',
'Settings/Indexers/Collection',
@ -14,8 +15,8 @@ define([
'Settings/Notifications/Collection',
'Settings/General/GeneralView',
'Settings/Misc/MiscView'
],
function (App, Marionette, SettingsModel, GeneralSettingsModel, NamingView, NamingModel, QualityLayout, IndexerCollectionView, IndexerCollection, DownloadClientView, NotificationCollectionView, NotificationCollection, GeneralView, MiscView) {
], function (App, Marionette, SettingsModel, GeneralSettingsModel,NamingModel, NamingView, QualityLayout, IndexerCollectionView, IndexerCollection, DownloadClientView,
NotificationCollectionView, NotificationCollection, GeneralView, MiscView) {
return Marionette.Layout.extend({
template: 'Settings/SettingsLayoutTemplate',
@ -56,7 +57,7 @@ define([
}
this.ui.namingTab.tab('show');
App.Router.navigate('settings/naming');
this._navigate('settings/naming');
},
showQuality: function (e) {
@ -65,7 +66,7 @@ define([
}
this.ui.qualityTab.tab('show');
App.Router.navigate('settings/quality');
this._navigate('settings/quality');
},
showIndexers: function (e) {
@ -74,7 +75,7 @@ define([
}
this.ui.indexersTab.tab('show');
App.Router.navigate('settings/indexers');
this._navigate('settings/indexers');
},
showDownloadClient: function (e) {
@ -83,7 +84,7 @@ define([
}
this.ui.downloadClientTab.tab('show');
App.Router.navigate('settings/downloadclient');
this._navigate('settings/downloadclient');
},
showNotifications: function (e) {
@ -92,7 +93,7 @@ define([
}
this.ui.notificationsTab.tab('show');
App.Router.navigate('settings/notifications');
this._navigate('settings/notifications');
},
showGeneral: function (e) {
@ -101,7 +102,7 @@ define([
}
this.ui.generalTab.tab('show');
App.Router.navigate('settings/general');
this._navigate('settings/general');
},
showMisc: function (e) {
@ -110,7 +111,13 @@ define([
}
this.ui.miscTab.tab('show');
App.Router.navigate('settings/misc');
this._navigate('settings/misc');
},
_navigate:function(route){
require(['Router'], function(){
App.Router.navigate(route);
});
},
initialize: function (options) {

View File

@ -1,8 +1,8 @@
'use strict';
'use strict';
define(['app',
'Settings/SettingsModelBase'], function (App, SettingsModelBase) {
return SettingsModelBase.extend({
url : App.Constants.ApiRoot + '/settings',
url : window.ApiRoot + '/settings',
successMessage: 'Settings saved',
errorMessage : 'Failed to save settings'
});

View File

@ -1,12 +1,15 @@
'use strict';
define(['app'], function () {
NzbDrone.Shared.FormatHelpers.FileSizeHelper = function (sourceSize) {
define(
[
'sugar'
], {
FileSizeHelper: function (sourceSize) {
var size = Number(sourceSize);
return size.bytes(1);
};
},
NzbDrone.Shared.FormatHelpers.DateHelper = function (sourceDate) {
DateHelper: function (sourceDate) {
if (!sourceDate) {
return '';
}
@ -31,7 +34,5 @@ define(['app'], function () {
}
return date.format('{MM}/{dd}/{yyyy}');
};
return NzbDrone.Shared.FormatHelpers;
}
});

View File

@ -1,7 +1,9 @@
'use strict';
define(['app','backgrid'], function () {
define(
[
'backgrid'
], function (Backgrid) {
Backgrid.NzbDroneHeaderCell = Backgrid.HeaderCell.extend({
events: {

Some files were not shown because too many files have changed in this diff Show More