removed NzbDrone. namespace, everything is done using require.

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

View file

@ -1,37 +1,41 @@
'use strict';
define(['app', 'Series/EpisodeModel', 'backbone.pageable'], function (app, EpisodeModel, PagableCollection) {
return PagableCollection.extend({
url : NzbDrone.Constants.ApiRoot + '/missing',
model: NzbDrone.Series.EpisodeModel,
'use strict';
define(
[
'Series/EpisodeModel',
'backbone.pageable'
], function (EpisodeModel, PagableCollection) {
return PagableCollection.extend({
url : window.ApiRoot + '/missing',
model: EpisodeModel,
state: {
pageSize: 15,
sortKey : 'airDate',
order : 1
},
state: {
pageSize: 15,
sortKey : 'airDate',
order : 1
},
queryParams: {
totalPages : null,
totalRecords: null,
pageSize : 'pageSize',
sortKey : 'sortKey',
order : 'sortDir',
directions : {
'-1': 'asc',
'1' : 'desc'
queryParams: {
totalPages : null,
totalRecords: null,
pageSize : 'pageSize',
sortKey : 'sortKey',
order : 'sortDir',
directions : {
'-1': 'asc',
'1' : 'desc'
}
},
parseState: function (resp) {
return {totalRecords: resp.totalRecords};
},
parseRecords: function (resp) {
if (resp) {
return resp.records;
}
return resp;
}
},
parseState: function (resp, queryParams, state) {
return {totalRecords: resp.totalRecords};
},
parseRecords: function (resp) {
if (resp) {
return resp.records;
}
return resp;
}
});
});
});

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: {
@ -53,21 +41,20 @@ define(
cell : EpisodeTitleCell
},
{
name : 'airDate',
label : 'Air Date',
cell : AirDateCell
name : 'airDate',
label: 'Air Date',
cell : AirDateCell
}
],
_showTable: function () {
this.missing.show(new Backgrid.Grid({
row : MissingRow,
columns : this.columns,
collection: this.missingCollection,
className : 'table table-hover'
}));
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
}));
@ -80,8 +67,8 @@ define(
this.missingCollection = new MissingCollection();
this.missingCollection.fetch().done(function () {
self._showTable();
});
self._showTable();
});
}
});
});