Moved source code under src folder - massive change

This commit is contained in:
Mark McDowall
2013-10-02 18:01:32 -07:00
parent 2fc8123d6b
commit 5bf0e197ec
1499 changed files with 1054 additions and 1444 deletions
+17
View File
@@ -0,0 +1,17 @@
'use strict';
define(
[
'backbone',
'History/Queue/QueueModel',
'Mixins/backbone.signalr.mixin'
], function (Backbone, QueueModel) {
var QueueCollection = Backbone.Collection.extend({
url : window.NzbDrone.ApiRoot + '/queue',
model: QueueModel
});
var collection = new QueueCollection().bindSignalR();
collection.fetch();
return collection;
});
+77
View File
@@ -0,0 +1,77 @@
'use strict';
define(
[
'marionette',
'backgrid',
'History/Queue/QueueCollection',
'Cells/SeriesTitleCell',
'Cells/EpisodeNumberCell',
'Cells/EpisodeTitleCell',
'Cells/QualityCell',
'History/Queue/TimeleftCell'
], function (Marionette,
Backgrid,
QueueCollection,
SeriesTitleCell,
EpisodeNumberCell,
EpisodeTitleCell,
QualityCell,
TimeleftCell) {
return Marionette.Layout.extend({
template: 'History/Queue/QueueLayoutTemplate',
regions: {
table: '#x-queue'
},
columns:
[
{
name : 'series',
label: 'Series',
cell : SeriesTitleCell
},
{
name : 'episode',
label : 'Episode',
sortable: false,
cell : EpisodeNumberCell
},
{
name : 'episode',
label : 'Episode Title',
sortable: false,
cell : EpisodeTitleCell
},
{
name : 'quality',
label : 'Quality',
cell : QualityCell,
sortable: false
},
{
name : 'timeleft',
label : 'Timeleft',
cell : TimeleftCell,
cellValue : 'this'
}
],
initialize: function () {
this.listenTo(QueueCollection, 'sync', this._showTable);
},
onShow: function () {
this._showTable();
},
_showTable: function () {
this.table.show(new Backgrid.Grid({
columns : this.columns,
collection: QueueCollection,
className : 'table table-hover'
}));
}
});
});
@@ -0,0 +1,5 @@
<div class="row">
<div class="span12">
<div id="x-queue"/>
</div>
</div>
+16
View File
@@ -0,0 +1,16 @@
'use strict';
define(
[
'backbone',
'Series/SeriesModel',
'Series/EpisodeModel'
], function (Backbone, SeriesModel, EpisodeModel) {
return Backbone.Model.extend({
parse: function (model) {
model.series = new SeriesModel(model.series);
model.episode = new EpisodeModel(model.episode);
model.episode.set('series', model.series);
return model;
}
});
});
+27
View File
@@ -0,0 +1,27 @@
'use strict';
define(
[
'Cells/NzbDroneCell'
], function (NzbDroneCell) {
return NzbDroneCell.extend({
className: 'timeleft-cell',
render: function () {
this.$el.empty();
if (this.cellValue) {
var timeleft = this.cellValue.get('timeleft');
var size = this.cellValue.get('size');
var sizeleft = this.cellValue.get('sizeleft');
this.$el.html(timeleft);
this.$el.attr('title', '{0} MB / {1} MB'.format(sizeleft, size));
}
return this;
}
});
});