(js) New file structure for login page (RootPage)

This commit is contained in:
Francis Lachapelle committed 2015-06-12 12:02:11 -04:00
1 parent d056f5581a
commit 874e393948
4 files changed
+133 -139

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* JavaScript for MainUI (SOGoRootPage) */
(function() {
'use strict';
angular.module('SOGo.MainUI', ['SOGo.Common', 'SOGo.Authentication'])
.controller('loginController', loginController);
loginController.$inject = ['$scope', '$mdDialog', 'Authentication'];
function loginController($scope, $mdDialog, Authentication) {
$scope.warning = false;
$scope.creds = { username: cookieUsername, password: null };
$scope.login = function(creds) {
$scope.warning = false;
Authentication.login(creds)
.then(function(url) {
window.location.href = url;
}, function(msg) {
$scope.warning = msg.error;
});
return false;
};
$scope.showAbout = function() {
var alert;
alert = $mdDialog.alert({
title: 'About SOGo',
content: 'This is SOGo v3!',
ok: 'OK'
});
$mdDialog
.show( alert )
.finally(function() {
alert = undefined;
});
};
}
})();
-36
View File
@@ -1,36 +0,0 @@
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* JavaScript for SOGoRootPage */
(function() {
'use strict';
angular.module('SOGo.MainUI', ['SOGo.Authentication', 'SOGo.UI'])
.controller('loginController', ['$scope', '$mdDialog', 'Authentication', function($scope, $mdDialog, Authentication) {
$scope.warning = false;
$scope.creds = { username: cookieUsername, password: null };
$scope.login = function(creds) {
$scope.warning = false;
Authentication.login(creds)
.then(function(url) {
window.location.href = url;
}, function(msg) {
$scope.warning = msg.error;
});
return false;
};
$scope.showAbout = function() {
var alert;
alert = $mdDialog.alert({
title: 'About SOGo',
content: 'This is SOGo v3!',
ok: 'OK'
});
$mdDialog
.show( alert )
.finally(function() {
alert = undefined;
});
};
}]);
})();
+1 -1
View File
@@ -47,7 +47,7 @@
@import 'components/slider/slider';
@import 'components/sticky/sticky';
@import 'components/subheader/subheader';
//@import 'components/switch/switch';
@import 'components/switch/switch';
@import 'components/tabs/tabs';
//@import 'components/toast/toast';
@import 'components/toolbar/toolbar';