Updates jshint settings

This commit is contained in:
Joe Fiorini 2015-01-30 15:08:28 -05:00
parent 2464d68b38
commit 4775523764
12 changed files with 81 additions and 34 deletions

View File

@ -3,15 +3,29 @@
"jquery": true,
"esnext": true,
"globalstrict": true,
"globals": { "angular":false, "alert":false, "$AnsibleConfig":true, "$basePath":true, "jsyaml":false, "_":false, "d3":false, "Donut3D":false, "nv":false },
"curly": true,
"immed": true,
"latedef": "nofunc",
"noarg": true,
"nonew": true,
"notypeof": true,
"globals": {
"angular":false,
"alert":false,
"$AnsibleConfig":true,
"$basePath":true,
"jsyaml":false,
"_":false,
"d3":false,
"Donut3D":false,
"nv":false
},
"strict": false,
"quotmark": false,
"smarttabs": true,
"trailing": true,
"undef": true,
"unused": true,
"eqeqeq": true,
"indent": 4,
"onevar": true,
"newcap": false
}

View File

@ -28,7 +28,7 @@
// > password_strength = green
// It also controls password validation. Passwords are rejected if the score is not > password_strength.
session_timeout: 1800, // Number of seconds before an inactive session is automatically timed out and forced to log in again.
session_timeout: 1800, // Number of seconds before an inactive session is automatically timed out and forced to log in again.
// Separate from time out value set in API.

View File

@ -527,7 +527,9 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa
if($scope.survey_enabled === true && $scope.survey_exists!==true){
$scope.$emit("PromptForSurvey");
} else $scope.$emit("GatherFormFields");
} else {
$scope.$emit("GatherFormFields");
}
};
@ -634,7 +636,9 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
' project or make the playbooks available on the file system.', 'alert-info');
});
}
else Wait('stop');
else {
Wait('stop');
}
};
// Detect and alert user to potential SCM status issues
@ -964,7 +968,9 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
if($scope.survey_enabled === true && $scope.survey_exists!==true){
$scope.$emit("PromptForSurvey");
} else $scope.$emit("GatherFormFields");
} else {
$scope.$emit("GatherFormFields");
}
};
@ -1021,11 +1027,12 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
if($scope.survey_enabled === true && $scope.survey_exists!==true){
$scope.$emit("PromptForSurvey");
}
else
else {
PlaybookRun({
scope: $scope,
id: id
});
}
};
// handler for 'Enable Survey' button
@ -1063,4 +1070,4 @@ JobTemplatesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$l
'GetBasePath', 'md5Setup', 'ParseTypeChange', 'JobStatusToolTip', 'FormatDate', 'Wait', 'Stream', 'Empty', 'Prompt',
'ParseVariableString', 'ToJSON', 'SchedulesControllerInit', 'JobsControllerInit', 'JobsListUpdate', 'GetChoices',
'SchedulesListInit', 'SchedulesList', 'CallbackHelpInit', 'PlaybookRun' , 'SurveyControllerInit', '$sce'
];
];

View File

@ -1074,8 +1074,9 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
msg: 'Failed to retrieve inventory source. GET status: ' + status });
});
}
else
else {
modal_scope.$emit('groupVariablesLoaded'); // JT-- "groupVariablesLoaded" is where the schedule info is loaded, so I make a call after the sources_scope.source has been loaded
}
});
if (sources_scope.removeScopeSourceTypeOptionsReady) {

View File

@ -1208,10 +1208,12 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
keys;
function listSort(a,b) {
if (parseInt(a,10) < parseInt(b,10))
if (parseInt(a,10) < parseInt(b,10)) {
return -1;
if (parseInt(a,10) > parseInt(b,10))
}
if (parseInt(a,10) > parseInt(b,10)) {
return 1;
}
return 0;
}
@ -1276,10 +1278,12 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
idx, key, keys, newKeys, tasks, t;
function listSort(a,b) {
if (parseInt(a,10) < parseInt(b,10))
if (parseInt(a,10) < parseInt(b,10)) {
return -1;
if (parseInt(a,10) > parseInt(b,10))
}
if (parseInt(a,10) > parseInt(b,10)) {
return 1;
}
return 0;
}
@ -1385,15 +1389,19 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
keys = Object.keys(filteredListB);
keys.sort(function compare(a, b) {
if (filteredListB[a].name === filteredListB[b].name) {
if (filteredListB[a].counter < filteredListB[b].counter)
if (filteredListB[a].counter < filteredListB[b].counter) {
return -1;
if (filteredListB[a].counter >filteredListB[b].counter)
}
if (filteredListB[a].counter >filteredListB[b].counter) {
return 1;
}
} else {
if (filteredListB[a].name < filteredListB[b].name)
if (filteredListB[a].name < filteredListB[b].name) {
return -1;
if (filteredListB[a].name > filteredListB[b].name)
}
if (filteredListB[a].name > filteredListB[b].name) {
return 1;
}
}
// a must be equal to b
return 0;
@ -1453,10 +1461,12 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
keys = Object.keys(filteredListB);
keys.sort(function(a,b) {
if (filteredListB[a].name > filteredListB[b].name)
if (filteredListB[a].name > filteredListB[b].name) {
return 1;
if (filteredListB[a].name < filteredListB[b].name)
}
if (filteredListB[a].name < filteredListB[b].name) {
return -1;
}
// a must be equal to b
return 0;
});

View File

@ -111,7 +111,9 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
if(scope.prompt_for_vars===false && scope.survey_enabled===true){
scope.$emit('GetExtraVars');
}
else scope.$emit('BuildData');
else {
scope.$emit('BuildData');
}
};
@ -831,7 +833,9 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
else if (!Empty(scope.survey_enabled) && scope.survey_enabled===true) {
scope.$emit('PromptForSurvey', html, url);
}
else scope.$emit('StartPlaybookRun', url);
else {
scope.$emit('StartPlaybookRun', url);
}
}
})
@ -1021,4 +1025,4 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
});
};
}
]);
]);

View File

@ -95,7 +95,9 @@ angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'Job
if(scope.$parent.portalMode===true){
$window.open('/#/jobs/' + job.id, '_blank');
}
else $location.url('/jobs/' + job.id);
else {
$location.url('/jobs/' + job.id);
}
}
else {
LogViewer({

View File

@ -34,8 +34,8 @@ angular.module('PermissionsHelper', [])
} else {
scope.projectrequired = true;
html = "<dl>\n" +
"<dt>Create</dt>\n" +
"<dd>Allow the user or team to create job templates. This implies that they have the Run and Check permissions.</dd>\n" +
"<dt>Create</dt>\n" +
"<dd>Allow the user or team to create job templates. This implies that they have the Run and Check permissions.</dd>\n" +
"<dt>Run</dt>\n" +
"<dd>Allow the user or team to run a job template from the project against the inventory. In Run mode modules will " +
"be executed, and changes to the inventory will occur.</dd>\n" +

View File

@ -73,7 +73,9 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
if(scope.can_edit === false){
$('#survey-save-button').attr('disabled', "disabled");
}
else $('#survey-save-button').attr('ng-disabled', "survey_questions.length<1 ");
else {
$('#survey-save-button').attr('ng-disabled', "survey_questions.length<1 ");
}
element = angular.element(document.getElementById('survey-save-button'));
$compile(element)(scope);
@ -513,7 +515,9 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
if(scope.mode === 'add'){
questions = [];
}
else scope.survey_questions = [];
else {
scope.survey_questions = [];
}
$(me).dialog('close');
};

View File

@ -100,8 +100,9 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job
scope.update = function(){
var val = [];
angular.forEach(scope.cbModel, function(v,k){
if (v)
if (v) {
val.push(k);
}
});
if (val.length>0){
scope.ngModel.value = val;

View File

@ -425,10 +425,11 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
list.iterator + ".id }}\" ng-click=\"toggle_" + list.iterator + "(" + list.iterator + ".id, true)\" ng-value=\"1\" " +
"ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
}
else // its assumed that options.input_type = checkbox
else { // its assumed that options.input_type = checkbox
html += "<td><input type=\"checkbox\" ng-model=\"" + list.iterator + ".checked\" name=\"check_{{" +
list.iterator + ".id }}\" ng-click=\"toggle_" + list.iterator + "(" + list.iterator + ".id, true)\" ng-true-value=\"1\" " +
"ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
}
} else if ((options.mode === 'edit' || options.mode === 'summary') && list.fieldActions) {
// Row level actions

View File

@ -63,14 +63,16 @@ angular.module('PromptDialog', ['Utilities'])
focus = function() {
var focusableElement = focusableChildren[currentIndex];
if (focusableElement)
if (focusableElement) {
focusableElement.focus();
}
};
focusPrevious = function () {
currentIndex--;
if (currentIndex < 0)
if (currentIndex < 0) {
currentIndex = numElements - 1;
}
focus();
@ -79,8 +81,9 @@ angular.module('PromptDialog', ['Utilities'])
focusNext = function () {
currentIndex++;
if (currentIndex >= numElements)
if (currentIndex >= numElements) {
currentIndex = 0;
}
focus();
@ -118,4 +121,4 @@ angular.module('PromptDialog', ['Utilities'])
};
}
]);
]);