workign commit of jshint fixes

This commit is contained in:
John Mitchell
2016-04-11 16:06:25 -04:00
committed by Leigh Johnson
parent 48e9c08672
commit b718f70b8e
10 changed files with 40 additions and 40 deletions

View File

@@ -3,7 +3,7 @@ export default
var processVersion = function(version){ var processVersion = function(version){
// prettify version & calculate padding // prettify version & calculate padding
// e,g 3.0.0-0.git201602191743/ -> 3.0.0 // e,g 3.0.0-0.git201602191743/ -> 3.0.0
var split = version.split('-')[0] var split = version.split('-')[0];
var spaces = Math.floor((16-split.length)/2), var spaces = Math.floor((16-split.length)/2),
paddedStr = ""; paddedStr = "";
for(var i=0; i<=spaces; i++){ for(var i=0; i<=spaces; i++){
@@ -13,7 +13,7 @@ export default
for(var j = paddedStr.length; j<16; j++){ for(var j = paddedStr.length; j<16; j++){
paddedStr = paddedStr + " "; paddedStr = paddedStr + " ";
} }
return paddedStr return paddedStr;
}; };
var init = function(){ var init = function(){
CheckLicense.get() CheckLicense.get()

View File

@@ -36,7 +36,7 @@ export default ['templateUrl', function(templateUrl) {
$scope.changeStreamTarget = function(){ $scope.changeStreamTarget = function(){
if($scope.streamTarget && $scope.streamTarget == 'dashboard') { if($scope.streamTarget && $scope.streamTarget === 'dashboard') {
// Just navigate to the base activity stream // Just navigate to the base activity stream
$state.go('activityStream', {}, {inherit: false}); $state.go('activityStream', {}, {inherit: false});
} }
@@ -45,7 +45,7 @@ export default ['templateUrl', function(templateUrl) {
$state.go('activityStream', {target: $scope.streamTarget}, {inherit: false}); $state.go('activityStream', {target: $scope.streamTarget}, {inherit: false});
} }
} };
}], }],
}; };
}]; }];

View File

@@ -22,6 +22,10 @@ function adhocController($q, $scope, $rootScope, $location, $stateParams,
var privateFn = {}; var privateFn = {};
this.privateFn = privateFn; this.privateFn = privateFn;
var id = $stateParams.inventory_id,
urls = privateFn.setAvailableUrls(),
hostPattern = $rootScope.hostPatterns || "all";
// note: put any urls that the controller will use in here!!!! // note: put any urls that the controller will use in here!!!!
privateFn.setAvailableUrls = function() { privateFn.setAvailableUrls = function() {
return { return {
@@ -31,10 +35,6 @@ function adhocController($q, $scope, $rootScope, $location, $stateParams,
}; };
}; };
var id = $stateParams.inventory_id,
urls = privateFn.setAvailableUrls(),
hostPattern = $rootScope.hostPatterns || "all";
// set the default options for the selects of the adhoc form // set the default options for the selects of the adhoc form
privateFn.setFieldDefaults = function(verbosity_options, forks_default) { privateFn.setFieldDefaults = function(verbosity_options, forks_default) {
var verbosity; var verbosity;
@@ -164,7 +164,7 @@ function adhocController($q, $scope, $rootScope, $location, $stateParams,
$scope.formCancel = function(){ $scope.formCancel = function(){
$state.go('inventoryManage'); $state.go('inventoryManage');
} };
// remove all data input into the form and reset the form back to defaults // remove all data input into the form and reset the form back to defaults
$scope.formReset = function () { $scope.formReset = function () {

View File

@@ -5,12 +5,13 @@
*************************************************/ *************************************************/
var urlPrefix; var urlPrefix;
var $basePath;
if ($basePath) { if ($basePath) {
urlPrefix = $basePath; urlPrefix = $basePath;
} else { } else {
// required to make tests work // required to make tests work
var $basePath = '/static/'; $basePath = '/static/';
urlPrefix = $basePath; urlPrefix = $basePath;
} }
@@ -710,7 +711,7 @@ var tower = angular.module('Tower', [
var sock; var sock;
$rootScope.addPermission = function (scope) { $rootScope.addPermission = function (scope) {
$compile("<add-permissions class='AddPermissions'></add-permissions>")(scope); $compile("<add-permissions class='AddPermissions'></add-permissions>")(scope);
} };
$rootScope.deletePermission = function (user, role, userName, $rootScope.deletePermission = function (user, role, userName,
roleName, resourceName) { roleName, resourceName) {
@@ -774,16 +775,17 @@ var tower = angular.module('Tower', [
$rootScope.removeConfigReady(); $rootScope.removeConfigReady();
} }
$rootScope.removeConfigReady = $rootScope.$on('ConfigReady', function() { $rootScope.removeConfigReady = $rootScope.$on('ConfigReady', function() {
var list, id;
// initially set row edit indicator for crud pages // initially set row edit indicator for crud pages
if ($location.$$path && $location.$$path.split("/")[3] && $location.$$path.split("/")[3] === "schedules") { if ($location.$$path && $location.$$path.split("/")[3] && $location.$$path.split("/")[3] === "schedules") {
var list = $location.$$path.split("/")[3]; list = $location.$$path.split("/")[3];
var id = $location.$$path.split("/")[4]; id = $location.$$path.split("/")[4];
$rootScope.listBeingEdited = list; $rootScope.listBeingEdited = list;
$rootScope.rowBeingEdited = id; $rootScope.rowBeingEdited = id;
$rootScope.initialIndicatorLoad = true; $rootScope.initialIndicatorLoad = true;
} else if ($location.$$path.split("/")[2]) { } else if ($location.$$path.split("/")[2]) {
var list = $location.$$path.split("/")[1]; list = $location.$$path.split("/")[1];
var id = $location.$$path.split("/")[2]; id = $location.$$path.split("/")[2];
$rootScope.listBeingEdited = list; $rootScope.listBeingEdited = list;
$rootScope.rowBeingEdited = id; $rootScope.rowBeingEdited = id;
} }
@@ -917,13 +919,14 @@ var tower = angular.module('Tower', [
$rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) { $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
// catch license expiration notifications immediately after user logs in, redirect // catch license expiration notifications immediately after user logs in, redirect
if (fromState.name == 'signIn'){ if (fromState.name === 'signIn'){
CheckLicense.notify(); CheckLicense.notify();
} }
var list, id;
// broadcast event change if editing crud object // broadcast event change if editing crud object
if ($location.$$path && $location.$$path.split("/")[3] && $location.$$path.split("/")[3] === "schedules") { if ($location.$$path && $location.$$path.split("/")[3] && $location.$$path.split("/")[3] === "schedules") {
var list = $location.$$path.split("/")[3]; list = $location.$$path.split("/")[3];
var id = $location.$$path.split("/")[4]; id = $location.$$path.split("/")[4];
if (!$rootScope.initialIndicatorLoad) { if (!$rootScope.initialIndicatorLoad) {
delete $rootScope.listBeingEdited; delete $rootScope.listBeingEdited;
@@ -934,8 +937,8 @@ var tower = angular.module('Tower', [
$rootScope.$broadcast("EditIndicatorChange", list, id); $rootScope.$broadcast("EditIndicatorChange", list, id);
} else if ($location.$$path.split("/")[2]) { } else if ($location.$$path.split("/")[2]) {
var list = $location.$$path.split("/")[1]; list = $location.$$path.split("/")[1];
var id = $location.$$path.split("/")[2]; id = $location.$$path.split("/")[2];
delete $rootScope.listBeingEdited; delete $rootScope.listBeingEdited;
delete $rootScope.rowBeingEdited; delete $rootScope.rowBeingEdited;

View File

@@ -3,7 +3,7 @@ export default
return { return {
restrict: 'E', restrict: 'E',
templateUrl: templateUrl('bread-crumb/bread-crumb'), templateUrl: templateUrl('bread-crumb/bread-crumb'),
link: function(scope, element, attrs) { link: function(scope) {
var streamConfig = {}; var streamConfig = {};
@@ -15,15 +15,15 @@ export default
if(streamConfig && streamConfig.activityStream) { if(streamConfig && streamConfig.activityStream) {
if(streamConfig.activityStreamTarget) { if(streamConfig.activityStreamTarget) {
stateGoParams['target'] = streamConfig.activityStreamTarget; stateGoParams.target = streamConfig.activityStreamTarget;
} }
if(streamConfig.activityStreamId) { if(streamConfig.activityStreamId) {
stateGoParams['id'] = $state.params[streamConfig.activityStreamId]; stateGoParams.id = $state.params[streamConfig.activityStreamId];
} }
} }
$state.go('activityStream', stateGoParams); $state.go('activityStream', stateGoParams);
} };
scope.$on("$stateChangeSuccess", function updateActivityStreamButton(event, toState) { scope.$on("$stateChangeSuccess", function updateActivityStreamButton(event, toState) {
@@ -38,7 +38,7 @@ export default
// attached to the $rootScope. // attached to the $rootScope.
FeaturesService.get() FeaturesService.get()
.then(function(features) { .then(function() {
if(FeaturesService.featureEnabled('activity_streams')) { if(FeaturesService.featureEnabled('activity_streams')) {
scope.showActivityStreamButton = true; scope.showActivityStreamButton = true;
} }

View File

@@ -160,7 +160,6 @@ export function HomeGroups($rootScope, $log, $scope, $filter, $compile, $locatio
list = HomeGroupList, list = HomeGroupList,
defaultUrl = GetBasePath('groups'), defaultUrl = GetBasePath('groups'),
scope = $scope, scope = $scope,
modal_scope = $scope.$new(),
opt, PreviousSearchParams; opt, PreviousSearchParams;
generator.inject(list, { mode: 'edit', scope: scope }); generator.inject(list, { mode: 'edit', scope: scope });

View File

@@ -17,8 +17,6 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams,
SelectionInit, ProjectUpdate, Refresh, Wait, GetChoices, Empty, SelectionInit, ProjectUpdate, Refresh, Wait, GetChoices, Empty,
Find, GetProjectIcon, GetProjectToolTip, $filter, $state) { Find, GetProjectIcon, GetProjectToolTip, $filter, $state) {
console.log("foo");
ClearScope(); ClearScope();
Wait('start'); Wait('start');

View File

@@ -16,7 +16,7 @@ GetBasePath, Wait, Find, LoadDialogPartial, LoadSchedulesScope, GetChoices) {
ClearScope(); ClearScope();
var base, e, id, url, parentObject; var base, id, url, parentObject;
base = $location.path().replace(/^\//, '').split('/')[0]; base = $location.path().replace(/^\//, '').split('/')[0];

View File

@@ -142,10 +142,10 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
.factory('GenerateForm', ['$rootScope', '$location', '$compile', 'generateList', .factory('GenerateForm', ['$rootScope', '$location', '$compile', 'generateList',
'SearchWidget', 'PaginateWidget', 'Attr', 'Icon', 'Column', 'SearchWidget', 'PaginateWidget', 'Attr', 'Icon', 'Column',
'NavigationLink', 'HelpCollapse', 'DropDown', 'Empty', 'SelectIcon', 'NavigationLink', 'HelpCollapse', 'DropDown', 'Empty', 'SelectIcon',
'Store', 'ActionButton', 'getSearchHtml', '$state', 'Store', 'ActionButton', 'getSearchHtml',
function ($rootScope, $location, $compile, GenerateList, SearchWidget, function ($rootScope, $location, $compile, GenerateList, SearchWidget,
PaginateWidget, Attr, Icon, Column, NavigationLink, HelpCollapse, PaginateWidget, Attr, Icon, Column, NavigationLink, HelpCollapse,
DropDown, Empty, SelectIcon, Store, ActionButton, getSearchHtml, $state) { DropDown, Empty, SelectIcon, Store, ActionButton, getSearchHtml) {
return { return {
setForm: function (form) { this.form = form; }, setForm: function (form) { this.form = form; },
@@ -1041,7 +1041,8 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
html += "ng-model=\"" + fld + '" '; html += "ng-model=\"" + fld + '" ';
html += 'name="' + fld + '" '; html += 'name="' + fld + '" ';
html += "class=\"form-control Form-textArea"; html += "class=\"form-control Form-textArea";
html += (field['elementClass']) ? " " + field['elementClass'] : ""; html += (field.class) ? " " + field.class : "";
html += (field.elementClass) ? " " + field.elementClass : "";
html += "\" "; html += "\" ";
html += (field.ngChange) ? this.attr(field, 'ngChange') : ""; html += (field.ngChange) ? this.attr(field, 'ngChange') : "";
html += buildId(field, fld, this.form); html += buildId(field, fld, this.form);
@@ -1487,8 +1488,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
} }
html += "</div>\n"; html += "</div>\n";
} else { } else {
var inSubForm = false; var currentSubForm;
var currentSubForm = undefined;
var hasSubFormField; var hasSubFormField;
// original, single-column form // original, single-column form
section = ''; section = '';
@@ -1560,7 +1560,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
html += "<div class=\"buttons Form-buttons\" "; html += "<div class=\"buttons Form-buttons\" ";
html += "id=\"" + this.form.name + "_controls\" "; html += "id=\"" + this.form.name + "_controls\" ";
if (options.mode === 'edit' && !_.isEmpty(this.form.related)) { if (options.mode === 'edit' && !_.isEmpty(this.form.related)) {
html += "ng-show=\"" + this.form.name + "Selected\"; " html += "ng-show=\"" + this.form.name + "Selected\"; ";
} }
html += ">\n"; html += ">\n";
@@ -1685,7 +1685,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
form = params.form, form = params.form,
itm = params.related, itm = params.related,
collection = form.related[itm], collection = form.related[itm],
act, action, fld, cnt, base, fAction; act, fld, cnt, base, fAction;
if (collection.instructions) { if (collection.instructions) {
html += "<div class=\"alert alert-info alert-block\">\n"; html += "<div class=\"alert alert-info alert-block\">\n";
@@ -1747,7 +1747,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
html += "\" id=\"" + collection.iterator + '-' + fld + "-header\" "; html += "\" id=\"" + collection.iterator + '-' + fld + "-header\" ";
if (!collection.fields[fld].noSort) { if (!collection.fields[fld].noSort) {
html += "ng-click=\"sort('" + collection.iterator + "', '" + fld + "')\">" html += "ng-click=\"sort('" + collection.iterator + "', '" + fld + "')\">";
} else { } else {
html += ">"; html += ">";
} }
@@ -1768,7 +1768,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
} else { } else {
html += "fa fa-sort"; html += "fa fa-sort";
} }
html += "\"></i>" html += "\"></i>";
} }
html += "</a></th>\n"; html += "</a></th>\n";

View File

@@ -297,7 +297,7 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
// //
var html = '', var html = '',
list = this.list, list = this.list,
base, size, action, fld, cnt, field_action, fAction, itm; base, action, fld, cnt, field_action, fAction, itm;
if (options.mode !== 'lookup') { if (options.mode !== 'lookup') {
if(options.title !== false){ if(options.title !== false){