diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2014-12-05 10:16:01 +0100 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2014-12-05 10:16:01 +0100 |
commit | 793804c6b5df3e0bf16e1c5d446d269b0ee0671f (patch) | |
tree | 130e5720b0b017eb6eb901314a0074f1348cd639 | |
parent | 99eca2019ad1c5c6a007304da6b7a8f2903abf12 (diff) |
Fix jslint errors and conventions.
Change-Id: I194b7e67228392cee1f654a847349d8a330cd209
-rw-r--r-- | app/dashboard/static/js/linaro-base-1.0.3.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/app/dashboard/static/js/linaro-base-1.0.3.js b/app/dashboard/static/js/linaro-base-1.0.3.js index 43f8be9..3d5aa60 100644 --- a/app/dashboard/static/js/linaro-base-1.0.3.js +++ b/app/dashboard/static/js/linaro-base-1.0.3.js @@ -54,7 +54,7 @@ var JSBase = (function() { '<button type="button" class="close" ' + 'data-dismiss="alert" aria-hidden="true">×</button>'; - if (reason !== null || typeof reason !== 'undefined') { + if (reason !== null && reason !== undefined) { text = text + reason + '<br/>'; } @@ -169,19 +169,19 @@ var JSBase = (function() { } }; - if (data !== null || typeof data !== 'undefined') { + if (data !== null && data !== undefined) { ajaxSettings.data = data; } - if (successFunction !== null || successFunction !== undefined) { + if (successFunction !== null && successFunction !== undefined) { ajaxSettings.success = successFunction; } - if (errorFunction !== null || errorFunction !== undefined) { + if (errorFunction !== null && errorFunction !== undefined) { ajaxSettings.error = errorFunction; } - if (headers !== null || typeof headers !== undefined) { + if (headers !== null && headers !== undefined) { ajaxSettings.headers = headers; } @@ -262,7 +262,7 @@ var JSBase = (function() { i = 0, key; - for (i = 0; i < len; i++) { + for (i = 0; i < len; i = i + 1) { arg = arguments[i]; if (typeof arg === 'object') { @@ -334,8 +334,8 @@ var JSBase = (function() { i, urlTranslation = $('#url-translation').val(); - if ((commitURL !== null || typeof commitURL !== 'undefined') && - (commitId !== null || typeof commitId !== 'undefined') && + if ((commitURL !== null && commitURL !== undefined) && + (commitId !== null && commitId !== undefined) && urlTranslation !== 'None') { urlTranslation = JSON.parse(urlTranslation); @@ -349,7 +349,7 @@ var JSBase = (function() { translateRule = knownGit[3]; lenTranslate = translateRule.length; - for (i = 0; i < lenTranslate; i++) { + for (i = 0; i < lenTranslate; i = i + 1) { urlPath = urlPath.replace( translateRule[i][0], translateRule[i][1]); } @@ -412,7 +412,7 @@ var JSBase = (function() { setErrorAlert: setErrorAlert, translateCommitURL: translateCommitURL }; -})(); +}()); var setErrorAlert = JSBase.setErrorAlert; var loadContent = JSBase.loadContent; |