Run js-beautify and fixjsstyle on code
Found this pointer on stackoverflow:
https://stackoverflow.com/a/31660434/5508494
End goal is to get the code formatted well enough that
clang format will run correctly against it.
Change-Id: I80053e78d253d8eee49233e42d55e5807ae8fdc8
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/app/users/controllers/user-accounts-controller.js b/app/users/controllers/user-accounts-controller.js
index 2cccbd7..2d65d8a 100644
--- a/app/users/controllers/user-accounts-controller.js
+++ b/app/users/controllers/user-accounts-controller.js
@@ -6,57 +6,56 @@
* @name userAccountsController
*/
-window.angular && (function (angular) {
- 'use strict';
+window.angular && (function(angular) {
+ 'use strict';
- angular
- .module('app.users')
- .controller('userAccountsController', [
- '$scope',
- '$window',
- 'APIUtils',
- 'dataService',
- function($scope, $window, APIUtils, dataService){
- $scope.dataService = dataService;
- $scope.state = "none";
- $scope.errorMsg = "";
+ angular
+ .module('app.users')
+ .controller('userAccountsController', [
+ '$scope',
+ '$window',
+ 'APIUtils',
+ 'dataService',
+ function($scope, $window, APIUtils, dataService) {
+ $scope.dataService = dataService;
+ $scope.state = 'none';
+ $scope.errorMsg = '';
- $scope.changePassword = function(oldPassword, newPassword, confirmNewPassword){
- var user = $scope.dataService.getUser();
- if(!oldPassword || !newPassword || !confirmNewPassword ){
- $scope.state = "error";
- $scope.errorMsg = "Field is required!";
- return false;
- }
- if (newPassword !== confirmNewPassword){
- $scope.state = "error";
- $scope.errorMsg = "New passwords do not match!";
- return false;
- }
- if (newPassword === oldPassword){
- $scope.state = "error";
- $scope.errorMsg = "New password and old password match!";
- return false;
- }
+ $scope.changePassword = function(oldPassword, newPassword, confirmNewPassword) {
+ var user = $scope.dataService.getUser();
+ if (!oldPassword || !newPassword || !confirmNewPassword) {
+ $scope.state = 'error';
+ $scope.errorMsg = 'Field is required!';
+ return false;
+ }
+ if (newPassword !== confirmNewPassword) {
+ $scope.state = 'error';
+ $scope.errorMsg = 'New passwords do not match!';
+ return false;
+ }
+ if (newPassword === oldPassword) {
+ $scope.state = 'error';
+ $scope.errorMsg = 'New password and old password match!';
+ return false;
+ }
- // Verify the oldPassword is correct
- APIUtils.testPassword(user, oldPassword).then(function(state){
- APIUtils.changePassword(user, newPassword).then(function(response){
- // Clear the textboxes on a success
- $scope.passwordVerify = '';
- $scope.password = '';
- $scope.oldPassword = '';
- $scope.state = "success";
- }, function(error){
- $scope.state = "error";
- $scope.errorMsg = "Error changing password!";
- });
- }, function(error){
- $scope.state = "error";
- $scope.errorMsg = "Old password is not correct!";
- });
- }
- }
- ]
- );
+ // Verify the oldPassword is correct
+ APIUtils.testPassword(user, oldPassword).then(function(state) {
+ APIUtils.changePassword(user, newPassword).then(function(response) {
+ // Clear the textboxes on a success
+ $scope.passwordVerify = '';
+ $scope.password = '';
+ $scope.oldPassword = '';
+ $scope.state = 'success';
+ }, function(error) {
+ $scope.state = 'error';
+ $scope.errorMsg = 'Error changing password!';
+ });
+ }, function(error) {
+ $scope.state = 'error';
+ $scope.errorMsg = 'Old password is not correct!';
+ });
+ };
+ }
+ ]);
})(angular);
diff --git a/app/users/index.js b/app/users/index.js
index d238b97..4dfa1f2 100644
--- a/app/users/index.js
+++ b/app/users/index.js
@@ -5,28 +5,28 @@
* @exports app/users/index
*/
-window.angular && (function (angular) {
- 'use strict';
+window.angular && (function(angular) {
+ 'use strict';
- angular
- .module('app.users', [
- 'ngRoute',
- 'app.constants',
- 'app.common.services'
- ])
- // Route configuration
- .config(['$routeProvider', function ($routeProvider) {
- $routeProvider
- .when('/users/manage-accounts', {
- 'template': require('./controllers/user-accounts-controller.html'),
- 'controller': 'userAccountsController',
- authenticated: true
- })
- .when('/users', {
- 'template': require('./controllers/user-accounts-controller.html'),
- 'controller': 'userAccountsController',
- authenticated: true
- });
- }]);
+ angular
+ .module('app.users', [
+ 'ngRoute',
+ 'app.constants',
+ 'app.common.services'
+ ])
+ // Route configuration
+ .config(['$routeProvider', function($routeProvider) {
+ $routeProvider
+ .when('/users/manage-accounts', {
+ 'template': require('./controllers/user-accounts-controller.html'),
+ 'controller': 'userAccountsController',
+ authenticated: true
+ })
+ .when('/users', {
+ 'template': require('./controllers/user-accounts-controller.html'),
+ 'controller': 'userAccountsController',
+ authenticated: true
+ });
+ }]);
})(window.angular);