Skip to content

Commit

Permalink
[JENKINS-35020] Fixed some JSHint errors (#2368)
Browse files Browse the repository at this point in the history
* [JENKINS-35020] Fixed some JSHint errors

* [JENKINS-35020] @kzantow's comment was addressed

* [JENKINS-35020] @kzantow's comment was addressed
  • Loading branch information
recena authored and oleg-nenashev committed May 25, 2016
1 parent 02e4bc5 commit 1fe9255
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
9 changes: 5 additions & 4 deletions war/src/main/js/pluginSetupWizardGui.js
Expand Up @@ -427,7 +427,7 @@ var createPluginSetupWizard = function(appendTarget) {
};

// Define actions
var showInstallProgress = function(state) {
var showInstallProgress = function() {
// check for installing plugins that failed
if(failedPluginNames.length > 0) {
setPanel(pluginSuccessPanel, { installingPlugins : installingPlugins, failedPlugins: true });
Expand Down Expand Up @@ -525,7 +525,7 @@ var createPluginSetupWizard = function(appendTarget) {
}

// keep polling while install is running
if(complete < total || data.state == 'INITIAL_PLUGINS_INSTALLING') {
if(complete < total || data.state === 'INITIAL_PLUGINS_INSTALLING') {
setPanel(progressPanel, { installingPlugins : installingPlugins });
// wait a sec
setTimeout(updateStatus, 250);
Expand Down Expand Up @@ -795,7 +795,7 @@ var createPluginSetupWizard = function(appendTarget) {
}

try {
if(JSON.parse(data).status == 'ok') {
if(JSON.parse(data).status === 'ok') {
showStatePanel();
return;
}
Expand Down Expand Up @@ -950,7 +950,8 @@ var createPluginSetupWizard = function(appendTarget) {

// Process extensions
var extensionTranslationOverrides = [];
if ('undefined' != typeof(setupWizardExtensions)) {
/* globals setupWizardExtensions: true */
if ('undefined' !== typeof(setupWizardExtensions)) {
$.each(setupWizardExtensions, function() {
this.call(self, {
'$': $,
Expand Down
8 changes: 4 additions & 4 deletions war/src/main/js/upgradeWizard.js
@@ -1,12 +1,12 @@
/* globals onSetupWizardInitialized: true */
onSetupWizardInitialized(function(wizard) {
var $ = wizard.$; // jQuery
var jenkins = wizard.jenkins; // wizard-provided jenkins api
var pluginManager = wizard.pluginManager;

var upgradePanel = require('./templates/upgradePanel.hbs');
var upgradeSuccessPanel = require('./templates/upgradeSuccessPanel.hbs');
var upgradeSkippedPanel = require('./templates/upgradeSkippedPanel.hbs');

wizard.addActions({
'.skip-recommended-plugins': function() {
wizard.setPanel(upgradeSkippedPanel);
Expand All @@ -15,7 +15,7 @@ onSetupWizardInitialized(function(wizard) {
jenkins.goTo('/setupWizard/installState/UPGRADE/hideUpgradeWizard');
}
});

wizard.addStateHandlers({
UPGRADE: function() {
wizard.loadPluginCategories(function(){
Expand Down
9 changes: 5 additions & 4 deletions war/src/main/js/util/jenkins.js
Expand Up @@ -193,12 +193,13 @@ exports.loadTranslations = function(bundleName, handler, onError) {
}
throw 'Unable to load localization data: ' + res.message;
}

var translations = res.data;

if('undefined' !== typeof(Proxy)) {

/* globals Proxy: true */
if('undefined' !== typeof Proxy) {
translations = new Proxy(translations, {
get: function(target, property, receiver) {
get: function(target, property) {
if(property in target) {
return target[property];
}
Expand Down

0 comments on commit 1fe9255

Please sign in to comment.