mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
removed NzbDrone. namespace, everything is done using require.
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
'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,
|
||||
itemView: SeasonLayout,
|
||||
|
||||
initialize: function (options) {
|
||||
initialize: function (options) {
|
||||
|
||||
if (!options.episodeCollection) {
|
||||
throw 'episodeCollection is needed';
|
||||
if (!options.episodeCollection) {
|
||||
throw 'episodeCollection is needed';
|
||||
}
|
||||
|
||||
this.episodeCollection = options.episodeCollection;
|
||||
|
||||
},
|
||||
|
||||
itemViewOptions: function () {
|
||||
return {
|
||||
episodeCollection: this.episodeCollection
|
||||
};
|
||||
}
|
||||
|
||||
this.episodeCollection = options.episodeCollection;
|
||||
|
||||
},
|
||||
|
||||
itemViewOptions: function () {
|
||||
return {
|
||||
episodeCollection: this.episodeCollection
|
||||
};
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
'use strict';
|
||||
define([
|
||||
'app',
|
||||
'Cells/EpisodeStatusCell',
|
||||
'Cells/EpisodeTitleCell',
|
||||
'Cells/AirDateCell',
|
||||
'Cells/ToggleCell',
|
||||
'Shared/Messenger'],
|
||||
function (App, EpisodeStatusCell, EpisodeTitleCell, AirDateCell, ToggleCell, Messenger) {
|
||||
return Backbone.Marionette.Layout.extend({
|
||||
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'Cells/ToggleCell',
|
||||
'Cells/EpisodeTitleCell',
|
||||
'Cells/AirDateCell',
|
||||
'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,39 +26,38 @@ define([
|
||||
episodeGrid: '#x-episode-grid'
|
||||
},
|
||||
|
||||
columns: [
|
||||
|
||||
{
|
||||
name : 'ignored',
|
||||
label : '',
|
||||
cell : ToggleCell,
|
||||
trueClass : 'icon-bookmark-empty',
|
||||
falseClass: 'icon-bookmark'
|
||||
},
|
||||
{
|
||||
name : 'episodeNumber',
|
||||
label: '#',
|
||||
cell : Backgrid.IntegerCell.extend({
|
||||
className: 'episode-number-cell'
|
||||
})
|
||||
},
|
||||
|
||||
{
|
||||
name : 'this',
|
||||
label: 'Title',
|
||||
cell : EpisodeTitleCell
|
||||
},
|
||||
{
|
||||
name : 'airDate',
|
||||
label: 'Air Date',
|
||||
cell : AirDateCell
|
||||
} ,
|
||||
{
|
||||
name : 'status',
|
||||
label: 'Status',
|
||||
cell : EpisodeStatusCell
|
||||
}
|
||||
],
|
||||
columns:
|
||||
[
|
||||
{
|
||||
name : 'ignored',
|
||||
label : '',
|
||||
cell : ToggleCell,
|
||||
trueClass : 'icon-bookmark-empty',
|
||||
falseClass: 'icon-bookmark'
|
||||
},
|
||||
{
|
||||
name : 'episodeNumber',
|
||||
label: '#',
|
||||
cell : Backgrid.IntegerCell.extend({
|
||||
className: 'episode-number-cell'
|
||||
})
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label: 'Title',
|
||||
cell : EpisodeTitleCell
|
||||
},
|
||||
{
|
||||
name : 'airDate',
|
||||
label: 'Air Date',
|
||||
cell : AirDateCell
|
||||
} ,
|
||||
{
|
||||
name : 'status',
|
||||
label: 'Status',
|
||||
cell : EpisodeStatusCell
|
||||
}
|
||||
],
|
||||
|
||||
initialize: function (options) {
|
||||
|
||||
@@ -66,12 +69,11 @@ define([
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
this.episodeGrid.show(new Backgrid.Grid(
|
||||
{
|
||||
columns : this.columns,
|
||||
collection: this.episodeCollection,
|
||||
className : 'table table-hover season-grid'
|
||||
}));
|
||||
this.episodeGrid.show(new Backgrid.Grid({
|
||||
columns : this.columns,
|
||||
collection: this.episodeCollection,
|
||||
className : 'table table-hover season-grid'
|
||||
}));
|
||||
},
|
||||
|
||||
_seasonSearch: function () {
|
||||
@@ -82,12 +84,12 @@ define([
|
||||
this.ui.seasonSearch.addClass('icon-spinner icon-spin');
|
||||
|
||||
var properties = {
|
||||
seriesId: this.model.get('seriesId'),
|
||||
seriesId : this.model.get('seriesId'),
|
||||
seasonNumber: this.model.get('seasonNumber')
|
||||
};
|
||||
|
||||
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) {
|
||||
|
||||
@@ -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({
|
||||
collection : self.seasonCollection,
|
||||
episodeCollection: self.episodeCollection
|
||||
}));
|
||||
}
|
||||
);
|
||||
$.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');
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user