diff options
author | Andrew Geissler <geissonator@yahoo.com> | 2018-05-24 11:07:27 -0700 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2018-05-24 11:07:27 -0700 |
commit | d27bb135f1561b87a174d1b9890dde2f3cf01c80 (patch) | |
tree | fee09cde2808a2319d33f65092bebecb9651dd78 /app/login | |
parent | ba5e3f3484c0de46f4f5fc5baf5804648179a9eb (diff) | |
download | phosphor-webui-d27bb135f1561b87a174d1b9890dde2f3cf01c80.tar.gz phosphor-webui-d27bb135f1561b87a174d1b9890dde2f3cf01c80.zip |
Format code using clang-format-5.0
Once merged, this repository will have CI enforce
the coding guidelines in the .clang-format file.
Change-Id: I96a05972665f9c67625c6850c3da25edc540be06
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'app/login')
-rw-r--r-- | app/login/controllers/login-controller.js | 75 | ||||
-rw-r--r-- | app/login/index.js | 26 |
2 files changed, 44 insertions, 57 deletions
diff --git a/app/login/controllers/login-controller.js b/app/login/controllers/login-controller.js index 03bbc15..be79bb6 100644 --- a/app/login/controllers/login-controller.js +++ b/app/login/controllers/login-controller.js @@ -9,51 +9,40 @@ window.angular && (function(angular) { 'use strict'; - angular - .module('app.login') - .controller('LoginController', [ - '$scope', - '$window', - 'APIUtils', - 'dataService', - 'userModel', - '$routeParams', - function($scope, $window, APIUtils, dataService, userModel, $routeParams) { - $scope.dataService = dataService; - $scope.host = $scope.dataService.host.replace(/^https?\:\/\//ig, ''); + angular.module('app.login').controller('LoginController', [ + '$scope', '$window', 'APIUtils', 'dataService', 'userModel', '$routeParams', + function($scope, $window, APIUtils, dataService, userModel, $routeParams) { + $scope.dataService = dataService; + $scope.host = $scope.dataService.host.replace(/^https?\:\/\//ig, ''); - $scope.tryLogin = function(host, username, password, event) { - if (event.keyCode === 13) { - $scope.login(host, username, password); - } - }; - $scope.login = function(host, username, password) { - $scope.error = false; - $scope.description = false; + $scope.tryLogin = function(host, username, password, event) { + if (event.keyCode === 13) { + $scope.login(host, username, password); + } + }; + $scope.login = function(host, username, password) { + $scope.error = false; + $scope.description = false; - if (!username || username == '' || - !password || password == '' || - !host || host == '' - ) { - return false; - } - else { - $scope.dataService.setHost(host); - userModel.login(username, password, function(status, description) { - if (status) { - $scope.$emit('user-logged-in', {}); - $window.location.hash = '#/overview/server'; + if (!username || username == '' || !password || password == '' || + !host || host == '') { + return false; + } else { + $scope.dataService.setHost(host); + userModel.login(username, password, function(status, description) { + if (status) { + $scope.$emit('user-logged-in', {}); + $window.location.hash = '#/overview/server'; + } else { + $scope.error = true; + if (description) { + $scope.description = description; } - else { - $scope.error = true; - if (description) { - $scope.description = description; - } - } - }); - } - }; - } - ]); + } + }); + } + }; + } + ]); })(angular); diff --git a/app/login/index.js b/app/login/index.js index 04343f5..9ec06bf 100644 --- a/app/login/index.js +++ b/app/login/index.js @@ -9,19 +9,17 @@ window.angular && (function(angular) { 'use strict'; angular - .module('app.login', [ - 'ngRoute', - 'app.constants', - 'app.common.services' - ]) - // Route configuration - .config(['$routeProvider', function($routeProvider) { - $routeProvider - .when('/login', { - 'template': require('./controllers/login-controller.html'), - 'controller': 'LoginController', - authenticated: false - }); - }]); + .module('app.login', ['ngRoute', 'app.constants', 'app.common.services']) + // Route configuration + .config([ + '$routeProvider', + function($routeProvider) { + $routeProvider.when('/login', { + 'template': require('./controllers/login-controller.html'), + 'controller': 'LoginController', + authenticated: false + }); + } + ]); })(window.angular); |