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){
// prettify version & calculate padding
// 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),
paddedStr = "";
for(var i=0; i<=spaces; i++){
@ -13,7 +13,7 @@ export default
for(var j = paddedStr.length; j<16; j++){
paddedStr = paddedStr + " ";
}
return paddedStr
return paddedStr;
};
var init = function(){
CheckLicense.get()
@ -28,4 +28,4 @@ export default
});
init();
}
];
];

View File

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

View File

@ -22,6 +22,10 @@ function adhocController($q, $scope, $rootScope, $location, $stateParams,
var 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!!!!
privateFn.setAvailableUrls = function() {
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
privateFn.setFieldDefaults = function(verbosity_options, forks_default) {
var verbosity;
@ -164,7 +164,7 @@ function adhocController($q, $scope, $rootScope, $location, $stateParams,
$scope.formCancel = function(){
$state.go('inventoryManage');
}
};
// remove all data input into the form and reset the form back to defaults
$scope.formReset = function () {

View File

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

View File

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

View File

@ -160,7 +160,6 @@ export function HomeGroups($rootScope, $log, $scope, $filter, $compile, $locatio
list = HomeGroupList,
defaultUrl = GetBasePath('groups'),
scope = $scope,
modal_scope = $scope.$new(),
opt, PreviousSearchParams;
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,
Find, GetProjectIcon, GetProjectToolTip, $filter, $state) {
console.log("foo");
ClearScope();
Wait('start');

View File

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

View File

@ -297,7 +297,7 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
//
var html = '',
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.title !== false){