1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-17 15:02:34 +02:00

cleaned up some jslint errors

This commit is contained in:
Keivan Beigi 2013-05-01 15:42:30 -07:00
parent 2683a3ca12
commit 50fd2f77b1
22 changed files with 65 additions and 42 deletions

View File

@ -0,0 +1,9 @@
<component name="ProjectDictionaryState">
<dictionary name="Keivan.Beigi">
<words>
<w>bnzbd</w>
<w>mouseenter</w>
<w>mouseleave</w>
</words>
</dictionary>
</component>

View File

@ -5,17 +5,21 @@
<inspection_tool class="AssignmentResultUsedJS" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="AssignmentResultUsedJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AssignmentToForLoopParameterJS" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="AssignmentToForLoopParameterJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="AssignmentToFunctionParameterJS" enabled="true" level="WEAK WARNING" enabled_by_default="true" /> <inspection_tool class="AssignmentToFunctionParameterJS" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="BreakStatementJS" enabled="true" level="SERVER PROBLEM" enabled_by_default="true" />
<inspection_tool class="BreakStatementWithLabelJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ChainedEqualityJS" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ChainedEqualityJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CheckEmptyScriptTag" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="CheckEmptyScriptTag" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ConditionalExpressionWithIdenticalBranchesJS" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="ConditionalExpressionWithIdenticalBranchesJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ConstantIfStatementJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ConstantOnLHSOfComparisonJS" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="ConstantOnLHSOfComparisonJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ContinueStatementWithLabelJS" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="ContinueStatementWithLabelJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="CssUnusedSymbolInspection" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="CssMissingSemicolonInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CyclomaticComplexityJS" enabled="true" level="WARNING" enabled_by_default="true"> <inspection_tool class="CyclomaticComplexityJS" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_limit" value="10" /> <option name="m_limit" value="10" />
</inspection_tool> </inspection_tool>
<inspection_tool class="DefaultNotLastCaseInSwitchJS" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="DefaultNotLastCaseInSwitchJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="DuplicateConditionJS" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="DuplicateConditionJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="DynamicallyGeneratedCodeJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="EmptyTryBlockJS" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="EmptyTryBlockJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ExceptionCaughtLocallyJS" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="ExceptionCaughtLocallyJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ForLoopReplaceableByWhileJS" enabled="true" level="INFO" enabled_by_default="true"> <inspection_tool class="ForLoopReplaceableByWhileJS" enabled="true" level="INFO" enabled_by_default="true">
@ -41,7 +45,7 @@
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true"> <inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues"> <option name="myValues">
<value> <value>
<list size="7"> <list size="8">
<item index="0" class="java.lang.String" itemvalue="nobr" /> <item index="0" class="java.lang.String" itemvalue="nobr" />
<item index="1" class="java.lang.String" itemvalue="noembed" /> <item index="1" class="java.lang.String" itemvalue="noembed" />
<item index="2" class="java.lang.String" itemvalue="comment" /> <item index="2" class="java.lang.String" itemvalue="comment" />
@ -49,16 +53,18 @@
<item index="4" class="java.lang.String" itemvalue="embed" /> <item index="4" class="java.lang.String" itemvalue="embed" />
<item index="5" class="java.lang.String" itemvalue="script" /> <item index="5" class="java.lang.String" itemvalue="script" />
<item index="6" class="java.lang.String" itemvalue="icon" /> <item index="6" class="java.lang.String" itemvalue="icon" />
<item index="7" class="java.lang.String" itemvalue="p" />
</list> </list>
</value> </value>
</option> </option>
<option name="myCustomValuesEnabled" value="true" /> <option name="myCustomValuesEnabled" value="true" />
</inspection_tool> </inspection_tool>
<inspection_tool class="IfStatementWithIdenticalBranchesJS" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="IfStatementWithIdenticalBranchesJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="IfStatementWithTooManyBranchesJS" enabled="true" level="WARNING" enabled_by_default="true"> <inspection_tool class="IfStatementWithTooManyBranchesJS" enabled="true" level="ERROR" enabled_by_default="true">
<option name="m_limit" value="3" /> <option name="m_limit" value="3" />
</inspection_tool> </inspection_tool>
<inspection_tool class="JSHint" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="JSHint" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="JSPotentiallyInvalidUsageOfThis" enabled="true" level="SERVER PROBLEM" enabled_by_default="true" />
<inspection_tool class="JSUnresolvedVariable" enabled="false" level="WEAK WARNING" enabled_by_default="false" /> <inspection_tool class="JSUnresolvedVariable" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="JSUnusedGlobalSymbols" enabled="false" level="INFO" enabled_by_default="false" /> <inspection_tool class="JSUnusedGlobalSymbols" enabled="false" level="INFO" enabled_by_default="false" />
<inspection_tool class="LabeledStatementJS" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="LabeledStatementJS" enabled="true" level="ERROR" enabled_by_default="true" />
@ -68,6 +74,7 @@
<option name="m_maxLength" value="32" /> <option name="m_maxLength" value="32" />
</inspection_tool> </inspection_tool>
<inspection_tool class="LossyEncoding" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="LossyEncoding" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="NegatedIfStatementJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="NestedAssignmentJS" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NestedAssignmentJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="NestedFunctionCallJS" enabled="false" level="ERROR" enabled_by_default="false" /> <inspection_tool class="NestedFunctionCallJS" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="NestedSwitchStatementJS" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="NestedSwitchStatementJS" enabled="true" level="WARNING" enabled_by_default="true" />
@ -80,7 +87,6 @@
<option name="m_minLength" value="1" /> <option name="m_minLength" value="1" />
<option name="m_maxLength" value="32" /> <option name="m_maxLength" value="32" />
</inspection_tool> </inspection_tool>
<inspection_tool class="ReplaceAssignmentWithOperatorAssignmentJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ReuseOfLocalVariableJS" enabled="true" level="WARNING" enabled_by_default="true" /> <inspection_tool class="ReuseOfLocalVariableJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="StatementsPerFunctionJS" enabled="true" level="WARNING" enabled_by_default="true"> <inspection_tool class="StatementsPerFunctionJS" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_limit" value="30" /> <option name="m_limit" value="30" />
@ -94,6 +100,7 @@
</set> </set>
</option> </option>
</inspection_tool> </inspection_tool>
<inspection_tool class="ThreeNegationsPerFunctionJS" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UnterminatedStatementJS" enabled="true" level="ERROR" enabled_by_default="true"> <inspection_tool class="UnterminatedStatementJS" enabled="true" level="ERROR" enabled_by_default="true">
<option name="ignoreSemicolonAtEndOfBlock" value="true" /> <option name="ignoreSemicolonAtEndOfBlock" value="true" />
</inspection_tool> </inspection_tool>

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
Handlebars.registerHelper('partial', function(templateName, context){ Handlebars.registerHelper('partial', function (templateName) {
//TODO: We should be able to pass in the context, either an object or a property //TODO: We should be able to pass in the context, either an object or a property
var templateFunction = Marionette.TemplateCache.get(templateName); var templateFunction = Marionette.TemplateCache.get(templateName);
@ -17,4 +17,4 @@ Handlebars.registerHelper("debug", function(optionalValue) {
console.log("===================="); console.log("====================");
console.log(optionalValue); console.log(optionalValue);
} }
}); });

View File

@ -1,7 +1,7 @@
$.tablesorter.addParser({ $.tablesorter.addParser({
// set a unique id // set a unique id
id : 'title', id : 'title',
is : function (s) { is : function () {
// return false so this parser is not auto detected // return false so this parser is not auto detected
return false; return false;
}, },
@ -16,7 +16,7 @@ $.tablesorter.addParser({
$.tablesorter.addParser({ $.tablesorter.addParser({
// set a unique id // set a unique id
id : 'date', id : 'date',
is : function (s) { is : function () {
// return false so this parser is not auto detected // return false so this parser is not auto detected
return false; return false;
}, },
@ -37,7 +37,7 @@ $.tablesorter.addParser({
$.tablesorter.addParser({ $.tablesorter.addParser({
// set a unique id // set a unique id
id : 'innerHtml', id : 'innerHtml',
is : function (s) { is : function () {
// return false so this parser is not auto detected // return false so this parser is not auto detected
return false; return false;
}, },
@ -47,4 +47,4 @@ $.tablesorter.addParser({
}, },
// set type, either numeric or text // set type, either numeric or text
type : 'text' type : 'text'
}); });

View File

@ -1,6 +1,7 @@
define(['app', 'Quality/QualitySizeModel'], function () { "use strict";
define(['app', 'Quality/QualitySizeModel'], function () {
NzbDrone.Quality.QualitySizeCollection = Backbone.Collection.extend({ NzbDrone.Quality.QualitySizeCollection = Backbone.Collection.extend({
model: NzbDrone.Quality.QualitySizeModel, model: NzbDrone.Quality.QualitySizeModel,
url : NzbDrone.Constants.ApiRoot + '/qualitysizes' url : NzbDrone.Constants.ApiRoot + '/qualitysizes'
}); });
}); });

View File

@ -1,4 +1,5 @@
define(['app'], function () { "use strict";
define(['app'], function () {
NzbDrone.Quality.QualitySizeModel = Backbone.Model.extend({ NzbDrone.Quality.QualitySizeModel = Backbone.Model.extend({
initialize: function () { initialize: function () {
@ -14,4 +15,4 @@
} }
} }
}); });
}); });

View File

@ -1,4 +1,5 @@
define(['app', 'Quality/QualityProfileModel'], function () { "use strict";
define(['app', 'Quality/QualityProfileModel'], function () {
var qualityProfileCollection = Backbone.Collection.extend({ var qualityProfileCollection = Backbone.Collection.extend({
model: NzbDrone.Quality.QualityProfileModel, model: NzbDrone.Quality.QualityProfileModel,

View File

@ -1,4 +1,5 @@
define(['app'], function () { "use strict";
define(['app'], function () {
NzbDrone.Quality.QualityProfileModel = Backbone.Model.extend({ NzbDrone.Quality.QualityProfileModel = Backbone.Model.extend({
mutators: { mutators: {

View File

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

View File

@ -1,3 +1,4 @@
"use strict";
Backgrid.AirDateCell = Backgrid.Cell.extend({ Backgrid.AirDateCell = Backgrid.Cell.extend({
className: "air-date-cell", className: "air-date-cell",
@ -9,4 +10,4 @@ Backgrid.AirDateCell = Backgrid.Cell.extend({
return this; return this;
} }
}); });

View File

@ -1,3 +1,4 @@
"use strict";
Backgrid.SeriesStatusCell = Backgrid.Cell.extend({ Backgrid.SeriesStatusCell = Backgrid.Cell.extend({
className: "series-status-cell", className: "series-status-cell",
@ -19,4 +20,4 @@ Backgrid.SeriesStatusCell = Backgrid.Cell.extend({
return this; return this;
} }
}); });

View File

@ -1,4 +1,5 @@
define(['app'], function () { "use strict";
define(['app'], function () {
NzbDrone.Series.SeasonModel = Backbone.Model.extend({ NzbDrone.Series.SeasonModel = Backbone.Model.extend({
mutators: { mutators: {

View File

@ -1,4 +1,5 @@
define(['app', 'Series/SeriesModel'], function () { "use strict";
define(['app', 'Series/SeriesModel'], function () {
NzbDrone.Series.SeriesCollection = Backbone.Collection.extend({ NzbDrone.Series.SeriesCollection = Backbone.Collection.extend({
url : NzbDrone.Constants.ApiRoot + '/series', url : NzbDrone.Constants.ApiRoot + '/series',
model: NzbDrone.Series.SeriesModel, model: NzbDrone.Series.SeriesModel,
@ -10,4 +11,4 @@
return model.get(this.defaultSortKey); return model.get(this.defaultSortKey);
} }
}); });
}); });

View File

@ -47,11 +47,7 @@ define(['app', 'Quality/QualityProfileCollection', 'AddSeries/RootFolders/RootFo
return "http://trakt.tv/show/" + this.get('titleSlug'); return "http://trakt.tv/show/" + this.get('titleSlug');
}, },
isContinuing : function () { isContinuing : function () {
if (this.get('status') === 0) { return this.get('status') === 0;
return true;
}
return false;
}, },
statusText : function () { statusText : function () {
if (this.get('status') === 0) { if (this.get('status') === 0) {

View File

@ -1,6 +1,7 @@
define(['app', 'Settings/Indexers/Model'], function () { "use strict";
define(['app', 'Settings/Indexers/Model'], function () {
NzbDrone.Settings.Indexers.Collection = Backbone.Collection.extend({ NzbDrone.Settings.Indexers.Collection = Backbone.Collection.extend({
url : NzbDrone.Constants.ApiRoot + '/indexer', url : NzbDrone.Constants.ApiRoot + '/indexer',
model: NzbDrone.Settings.Indexers.Model model: NzbDrone.Settings.Indexers.Model
}); });
}); });

View File

@ -18,7 +18,7 @@ define([
}, },
saveSettings: function () { saveSettings: function () {
var test = 1;
//this.model.save(undefined, this.syncNotification("Naming Settings Saved", "Couldn't Save Naming Settings")); //this.model.save(undefined, this.syncNotification("Naming Settings Saved", "Couldn't Save Naming Settings"));
}, },

View File

@ -6,6 +6,6 @@ define([
], function () { ], function () {
NzbDrone.Settings.Notifications.NotificationsView = Backbone.Marionette.ItemView.extend({ NzbDrone.Settings.Notifications.NotificationsView = Backbone.Marionette.ItemView.extend({
template: 'Settings/Notifications/NotificationsTemplate', template: 'Settings/Notifications/NotificationsTemplate'
}); });
}); });

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
define(['app', 'Settings/Quality/Profile/QualityProfileView'], function (app) { define(['app', 'Settings/Quality/Profile/QualityProfileView'], function () {
NzbDrone.Settings.Quality.Profile.QualityProfileCollectionView = Backbone.Marionette.CompositeView.extend({ NzbDrone.Settings.Quality.Profile.QualityProfileCollectionView = Backbone.Marionette.CompositeView.extend({
itemView : NzbDrone.Settings.Quality.Profile.QualityProfileView, itemView : NzbDrone.Settings.Quality.Profile.QualityProfileView,
itemViewContainer: 'tbody', itemViewContainer: 'tbody',
@ -17,4 +17,4 @@ define(['app', 'Settings/Quality/Profile/QualityProfileView'], function (app) {
} }
}); });
}); });

View File

@ -1,4 +1,5 @@
define([ "use strict";
define([
'app', 'app',
'Quality/QualityProfileCollection', 'Quality/QualityProfileCollection',
'Quality/QualitySizeCollection', 'Quality/QualitySizeCollection',

View File

@ -1,13 +1,13 @@
'use strict'; 'use strict';
define(['app', 'Settings/Quality/Size/QualitySizeView'], function (app) { define(['app', 'Settings/Quality/Size/QualitySizeView'], function () {
NzbDrone.Settings.Quality.Size.QualitySizeCollectionView = Backbone.Marionette.CompositeView.extend({ NzbDrone.Settings.Quality.Size.QualitySizeCollectionView = Backbone.Marionette.CompositeView.extend({
itemView : NzbDrone.Settings.Quality.Size.QualitySizeView, itemView : NzbDrone.Settings.Quality.Size.QualitySizeView,
itemViewContainer: '#quality-sizes-container', itemViewContainer: '#quality-sizes-container',
template : 'Settings/Quality/Size/QualitySizeCollectionTemplate', template : 'Settings/Quality/Size/QualitySizeCollectionTemplate',
initialize: function () { initialize: function () {
var test = 1;
}, },
ui: { ui: {
@ -18,4 +18,4 @@ define(['app', 'Settings/Quality/Size/QualitySizeView'], function (app) {
} }
}); });
}); });

View File

@ -1,5 +1,6 @@
define(['app'], function (app) { "use strict";
define(['app'], function () {
NzbDrone.Settings.SettingsModel = Backbone.Model.extend({ NzbDrone.Settings.SettingsModel = Backbone.Model.extend({
url: NzbDrone.Constants.ApiRoot + '/settings' url: NzbDrone.Constants.ApiRoot + '/settings'
}); });
}); });

View File

@ -6,6 +6,6 @@ define([
], function () { ], function () {
NzbDrone.Settings.System.SystemView = Backbone.Marionette.ItemView.extend({ NzbDrone.Settings.System.SystemView = Backbone.Marionette.ItemView.extend({
template: 'Settings/System/SystemTemplate', template: 'Settings/System/SystemTemplate'
}); });
}); });