summaryrefslogtreecommitdiffstats
path: root/app/login
diff options
context:
space:
mode:
authorAndrew Geissler <geissonator@yahoo.com>2018-05-24 10:58:00 -0700
committerAndrew Geissler <geissonator@yahoo.com>2018-05-24 10:58:00 -0700
commitba5e3f3484c0de46f4f5fc5baf5804648179a9eb (patch)
tree5bfff42d64b4aac4339fc76a5b6e76f2556b723c /app/login
parent13251a8e57f3c5bd200ddd7dd42ef4e9af110429 (diff)
downloadphosphor-webui-ba5e3f3484c0de46f4f5fc5baf5804648179a9eb.tar.gz
phosphor-webui-ba5e3f3484c0de46f4f5fc5baf5804648179a9eb.zip
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>
Diffstat (limited to 'app/login')
-rw-r--r--app/login/controllers/login-controller.js89
-rw-r--r--app/login/index.js34
2 files changed, 62 insertions, 61 deletions
diff --git a/app/login/controllers/login-controller.js b/app/login/controllers/login-controller.js
index 594d3a1..03bbc15 100644
--- a/app/login/controllers/login-controller.js
+++ b/app/login/controllers/login-controller.js
@@ -6,53 +6,54 @@
* @name LoginController
*/
-window.angular && (function (angular) {
- 'use strict';
+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';
- }else{
- $scope.error = true;
- if(description){
- $scope.description = description;
- }
- };
- });
- }
+ 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;
}
- }
- ]
- );
+ }
+ });
+ }
+ };
+ }
+ ]);
})(angular);
diff --git a/app/login/index.js b/app/login/index.js
index 8867065..04343f5 100644
--- a/app/login/index.js
+++ b/app/login/index.js
@@ -5,23 +5,23 @@
* @exports app/login/index
*/
-window.angular && (function (angular) {
- 'use strict';
+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
- });
- }]);
+ 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
+ });
+ }]);
})(window.angular);
OpenPOWER on IntegriCloud