mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
client side code webstorm code cleanup.
This commit is contained in:
parent
375f887539
commit
445ea4f344
94 changed files with 4355 additions and 4243 deletions
|
@ -4,6 +4,7 @@
|
|||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Are you sure you want to delete '{{title}}'?</p>
|
||||
|
||||
<div class="series-delete-files">
|
||||
<label class="checkbox">
|
||||
<input class="x-delete-files" type="checkbox" value="true">
|
||||
|
|
|
@ -3,29 +3,29 @@
|
|||
define(['app', 'Series/SeriesModel'], function () {
|
||||
|
||||
NzbDrone.Series.Delete.DeleteSeriesView = Backbone.Marionette.ItemView.extend({
|
||||
template:'Series/Delete/DeleteSeriesTemplate',
|
||||
tagName:'div',
|
||||
className:"modal",
|
||||
template : 'Series/Delete/DeleteSeriesTemplate',
|
||||
tagName : 'div',
|
||||
className: "modal",
|
||||
|
||||
events:{
|
||||
'click .x-confirm-delete':'removeSeries'
|
||||
events: {
|
||||
'click .x-confirm-delete': 'removeSeries'
|
||||
},
|
||||
|
||||
ui:{
|
||||
deleteFiles:'.x-delete-files'
|
||||
ui: {
|
||||
deleteFiles: '.x-delete-files'
|
||||
},
|
||||
|
||||
onRender:function () {
|
||||
onRender: function () {
|
||||
NzbDrone.ModelBinder.bind(this.model, this.el);
|
||||
},
|
||||
|
||||
removeSeries:function () {
|
||||
removeSeries: function () {
|
||||
|
||||
var deleteFiles = this.ui.deleteFiles.prop('checked');
|
||||
|
||||
this.model.destroy({
|
||||
data:{ 'deleteFiles':deleteFiles },
|
||||
success:function (model) {
|
||||
data : { 'deleteFiles': deleteFiles },
|
||||
success: function (model) {
|
||||
model.collection.remove(model);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -3,13 +3,13 @@ define(['app', 'Series/SeasonModel'], function () {
|
|||
|
||||
NzbDrone.Series.Details.EpisodeItemView = Backbone.Marionette.ItemView.extend({
|
||||
template: 'Series/Details/EpisodeItemTemplate',
|
||||
tagName: 'tr',
|
||||
tagName : 'tr',
|
||||
|
||||
ui: {
|
||||
|
||||
},
|
||||
|
||||
events: {
|
||||
events : {
|
||||
|
||||
},
|
||||
onRender: function () {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
'use strict';
|
||||
define(['app', 'Series/Details/EpisodeItemView'], function () {
|
||||
NzbDrone.Series.Details.SeasonCompositeView = Backbone.Marionette.CompositeView.extend({
|
||||
itemView: NzbDrone.Series.Details.EpisodeItemView,
|
||||
itemView : NzbDrone.Series.Details.EpisodeItemView,
|
||||
itemViewContainer: '.x-episodes',
|
||||
template: 'Series/Details/SeasonCompositeTemplate',
|
||||
template : 'Series/Details/SeasonCompositeTemplate',
|
||||
|
||||
initialize: function() {
|
||||
this.collection =new NzbDrone.Series.EpisodeCollection();
|
||||
initialize: function () {
|
||||
this.collection = new NzbDrone.Series.EpisodeCollection();
|
||||
this.collection.fetch({data: {
|
||||
seriesId: this.model.get('seriesId'),
|
||||
seasonNumber:this.model.get('seasonNumber')
|
||||
seriesId : this.model.get('seriesId'),
|
||||
seasonNumber: this.model.get('seasonNumber')
|
||||
}});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
define(['app', 'Quality/QualityProfileCollection', 'Series/Details/SeasonCompositeView', 'Series/SeasonCollection'], function () {
|
||||
NzbDrone.Series.Details.SeriesDetailsView = Backbone.Marionette.CompositeView.extend({
|
||||
|
||||
itemView: NzbDrone.Series.Details.SeasonCompositeView,
|
||||
itemView : NzbDrone.Series.Details.SeasonCompositeView,
|
||||
itemViewContainer: '.x-series-seasons',
|
||||
template: 'Series/Details/SeriesDetailsTemplate',
|
||||
template : 'Series/Details/SeriesDetailsTemplate',
|
||||
|
||||
initialize: function () {
|
||||
this.collection = new NzbDrone.Series.SeasonCollection();
|
||||
|
|
|
@ -4,24 +4,26 @@
|
|||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-horizontal">
|
||||
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Monitored</label>
|
||||
|
||||
<div class="controls">
|
||||
<div class="switch">
|
||||
<input type="checkbox" name="monitored" />
|
||||
<input type="checkbox" name="monitored"/>
|
||||
</div>
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="Should NzbDrone download episodes for this series?"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Use Season Folder</label>
|
||||
|
||||
<div class="controls">
|
||||
<div class="switch">
|
||||
<input type="checkbox" name="seasonFolder" />
|
||||
<input type="checkbox" name="seasonFolder"/>
|
||||
</div>
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="Should downloaded episodes be stored in season folders?"></i>
|
||||
|
@ -31,11 +33,12 @@
|
|||
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputQualityProfile">Quality Profile</label>
|
||||
|
||||
<div class="controls">
|
||||
|
||||
|
||||
<select class="x-quality-profile" id="inputQualityProfile" name="qualityProfileId">
|
||||
{{#each qualityProfiles.models}}
|
||||
<option value="{{id}}">{{attributes.name}}</option>
|
||||
<option value="{{id}}">{{attributes.name}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
|
@ -46,6 +49,7 @@
|
|||
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputPath">Path</label>
|
||||
|
||||
<div class="controls">
|
||||
<input type="text" id="inputPath" placeholder="Path" name="path">
|
||||
<span class="help-inline">
|
||||
|
@ -53,9 +57,10 @@
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputBacklogSetting">Backlog Setting</label>
|
||||
|
||||
<div class="controls">
|
||||
<select id="inputBacklogSetting" class="inputClass x-backlog-setting" name="backlogSetting">
|
||||
<option value="0">Inherit</option>
|
||||
|
@ -67,11 +72,12 @@
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputCustomStartDate">Custom Start Date</label>
|
||||
|
||||
<div class="controls">
|
||||
<input type="date" id="inputCustomStartDate" name="customStartDate">
|
||||
<input type="date" id="inputCustomStartDate" name="customStartDate">
|
||||
<span class="help-inline">
|
||||
<i class="icon-question-sign" title="Should NzbDrone only download episodes after your preferred start date?"></i>
|
||||
</span>
|
||||
|
@ -80,7 +86,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-danger pull-left x-remove" >delete</button>
|
||||
<button class="btn btn-danger pull-left x-remove">delete</button>
|
||||
<button class="btn" data-dismiss="modal">cancel</button>
|
||||
<button class="btn btn-primary x-save">save</button>
|
||||
</div>
|
|
@ -2,19 +2,19 @@
|
|||
define(['app', 'Series/SeriesModel', 'Series/Delete/DeleteSeriesView', 'Quality/QualityProfileCollection'], function () {
|
||||
|
||||
NzbDrone.Series.Edit.EditSeriesView = Backbone.Marionette.ItemView.extend({
|
||||
template: 'Series/Edit/EditSeriesTemplate',
|
||||
tagName: 'div',
|
||||
template : 'Series/Edit/EditSeriesTemplate',
|
||||
tagName : 'div',
|
||||
className: "modal",
|
||||
|
||||
ui: {
|
||||
progressbar: '.progress .bar',
|
||||
qualityProfile: '.x-quality-profile',
|
||||
progressbar : '.progress .bar',
|
||||
qualityProfile : '.x-quality-profile',
|
||||
backlogSettings: '.x-backlog-setting',
|
||||
switch: '.switch'
|
||||
switch : '.switch'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click .x-save': 'saveSeries',
|
||||
'click .x-save' : 'saveSeries',
|
||||
'click .x-remove': 'removeSeries'
|
||||
},
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
define(['app', 'Series/EpisodeModel'], function () {
|
||||
NzbDrone.Series.EpisodeCollection = Backbone.Collection.extend({
|
||||
url: NzbDrone.Constants.ApiRoot + '/episodes',
|
||||
url : NzbDrone.Constants.ApiRoot + '/episodes',
|
||||
model: NzbDrone.Series.EpisodeModel
|
||||
});
|
||||
});
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
define(['app', 'Quality/QualityProfileCollection', 'Series/Index/SeriesItemView'], function (app, qualityProfileCollection) {
|
||||
NzbDrone.Series.Index.SeriesIndexCollectionView = Backbone.Marionette.CompositeView.extend({
|
||||
itemView: NzbDrone.Series.Index.SeriesItemView,
|
||||
itemViewContainer: 'tbody',
|
||||
template: 'Series/Index/SeriesIndexTemplate',
|
||||
itemView : NzbDrone.Series.Index.SeriesItemView,
|
||||
itemViewContainer : 'tbody',
|
||||
template : 'Series/Index/SeriesIndexTemplate',
|
||||
qualityProfileCollection: qualityProfileCollection,
|
||||
//emptyView: NzbDrone.Series.EmptySeriesCollectionView,
|
||||
|
||||
|
@ -18,27 +18,26 @@ define(['app', 'Quality/QualityProfileCollection', 'Series/Index/SeriesItemView'
|
|||
this.itemViewOptions = { qualityProfiles: this.qualityProfileCollection };
|
||||
},
|
||||
|
||||
ui:{
|
||||
table : '.x-series-table'
|
||||
ui: {
|
||||
table: '.x-series-table'
|
||||
},
|
||||
|
||||
onItemRemoved: function()
|
||||
{
|
||||
onItemRemoved: function () {
|
||||
this.ui.table.trigger('update');
|
||||
},
|
||||
|
||||
onCompositeCollectionRendered: function()
|
||||
{
|
||||
onCompositeCollectionRendered: function () {
|
||||
this.ui.table.trigger('update');
|
||||
|
||||
if(!this.tableSorter && this.collection.length > 0)
|
||||
{
|
||||
if (!this.tableSorter && this.collection.length > 0) {
|
||||
this.tableSorter = this.ui.table.tablesorter({
|
||||
textExtraction: function (node) {
|
||||
return node.innerHTML;
|
||||
},
|
||||
sortList: [[1,0]],
|
||||
headers: {
|
||||
sortList : [
|
||||
[1, 0]
|
||||
],
|
||||
headers : {
|
||||
0: {
|
||||
sorter: 'title'
|
||||
},
|
||||
|
@ -59,30 +58,32 @@ define(['app', 'Quality/QualityProfileCollection', 'Series/Index/SeriesItemView'
|
|||
|
||||
this.applySortIcons();
|
||||
|
||||
this.ui.table.bind("sortEnd", function() {
|
||||
this.ui.table.bind("sortEnd", function () {
|
||||
this.applySortIcons();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
this.ui.table.trigger('update');
|
||||
}
|
||||
},
|
||||
//Todo: Remove this from each view that requires it
|
||||
applySortIcons: function() {
|
||||
$(this.ui.table).find('th.tablesorter-header .tablesorter-header-inner i').each(function(){
|
||||
applySortIcons : function () {
|
||||
$(this.ui.table).find('th.tablesorter-header .tablesorter-header-inner i').each(function () {
|
||||
$(this).remove();
|
||||
});
|
||||
|
||||
$(this.ui.table).find('th.tablesorter-header').each(function () {
|
||||
if ($(this).hasClass('tablesorter-headerDesc'))
|
||||
if ($(this).hasClass('tablesorter-headerDesc')) {
|
||||
$(this).children('.tablesorter-header-inner').append('<i class="icon-sort-up pull-right">');
|
||||
}
|
||||
|
||||
else if ($(this).hasClass('tablesorter-headerAsc'))
|
||||
else if ($(this).hasClass('tablesorter-headerAsc')) {
|
||||
$(this).children('.tablesorter-header-inner').append('<i class="icon-sort-down pull-right">');
|
||||
}
|
||||
|
||||
else if (!$(this).hasClass('sorter-false'))
|
||||
else if (!$(this).hasClass('sorter-false')) {
|
||||
$(this).children('.tablesorter-header-inner').append('<i class="icon-sort pull-right">');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -90,5 +91,5 @@ define(['app', 'Quality/QualityProfileCollection', 'Series/Index/SeriesItemView'
|
|||
|
||||
NzbDrone.Series.Index.EmptySeriesCollectionView = Backbone.Marionette.CompositeView.extend({
|
||||
template: 'Series/Index/EmptySeriesCollectionTemplate',
|
||||
tagName: 'tr'
|
||||
tagName : 'tr'
|
||||
});
|
|
@ -8,8 +8,9 @@
|
|||
<td>
|
||||
<div class="progress">
|
||||
<span class="progressbar-back-text">{{episodeFileCount}} / {{episodeCount}}</span>
|
||||
|
||||
<div class="bar" style="width:{{percentOfEpisodes}}%"><span class="progressbar-front-text">{{episodeFileCount}} / {{episodeCount}}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<i class="icon-cog x-edit" title="Edit Series"></i>
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
'use strict';
|
||||
|
||||
define([
|
||||
'app',
|
||||
'Quality/QualityProfileCollection',
|
||||
'Series/SeriesCollection',
|
||||
'Series/Edit/EditSeriesView',
|
||||
'Series/Delete/DeleteSeriesView'
|
||||
'app',
|
||||
'Quality/QualityProfileCollection',
|
||||
'Series/SeriesCollection',
|
||||
'Series/Edit/EditSeriesView',
|
||||
'Series/Delete/DeleteSeriesView'
|
||||
|
||||
], function () {
|
||||
|
||||
NzbDrone.Series.Index.SeriesItemView = Backbone.Marionette.ItemView.extend({
|
||||
template: 'Series/Index/SeriesItemTemplate',
|
||||
tagName: 'tr',
|
||||
tagName : 'tr',
|
||||
|
||||
ui: {
|
||||
'progressbar': '.progress .bar'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click .x-edit': 'editSeries',
|
||||
'click .x-edit' : 'editSeries',
|
||||
'click .x-remove': 'removeSeries'
|
||||
},
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
define(['app','Series/SeasonModel'], function () {
|
||||
define(['app', 'Series/SeasonModel'], function () {
|
||||
NzbDrone.Series.SeasonCollection = Backbone.Collection.extend({
|
||||
url: NzbDrone.Constants.ApiRoot + '/season',
|
||||
url : NzbDrone.Constants.ApiRoot + '/season',
|
||||
model: NzbDrone.Series.SeasonModel
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
define(['app', 'Series/SeriesModel'], function () {
|
||||
NzbDrone.Series.SeriesCollection = Backbone.Collection.extend({
|
||||
url: NzbDrone.Constants.ApiRoot + '/series',
|
||||
url : NzbDrone.Constants.ApiRoot + '/series',
|
||||
model: NzbDrone.Series.SeriesModel
|
||||
});
|
||||
});
|
|
@ -14,8 +14,9 @@
|
|||
|
||||
var percent = 100;
|
||||
|
||||
if (episodeCount > 0)
|
||||
if (episodeCount > 0) {
|
||||
percent = episodeFileCount / episodeCount * 100;
|
||||
}
|
||||
|
||||
return percent;
|
||||
}
|
||||
|
@ -23,8 +24,8 @@
|
|||
|
||||
defaults: {
|
||||
episodeFileCount: 0,
|
||||
episodeCount: 0,
|
||||
qualityProfiles: qualityProfileCollection
|
||||
episodeCount : 0,
|
||||
qualityProfiles : qualityProfileCollection
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue