From 874e393948e67a90947a8a1c93d87d2f1361a8f2 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 6 May 2015 12:06:14 -0400 Subject: [PATCH] (js) New file structure for login page (RootPage) --- UI/Templates/MainUI/SOGoRootPage.wox | 196 +++++++++++------------ UI/WebServerResources/js/Main.app.js | 38 +++++ UI/WebServerResources/js/SOGoRootPage.js | 36 ----- UI/WebServerResources/scss/styles.scss | 2 +- 4 files changed, 133 insertions(+), 139 deletions(-) create mode 100644 UI/WebServerResources/js/Main.app.js delete mode 100644 UI/WebServerResources/js/SOGoRootPage.js diff --git a/UI/Templates/MainUI/SOGoRootPage.wox b/UI/Templates/MainUI/SOGoRootPage.wox index 7486345d7..fc4f160f1 100644 --- a/UI/Templates/MainUI/SOGoRootPage.wox +++ b/UI/Templates/MainUI/SOGoRootPage.wox @@ -7,113 +7,105 @@ xmlns:const="http://www.skyrix.com/od/constant" xmlns:rsrc="OGo:url" xmlns:label="OGo:label" - const:jsFiles="Common/SOGoAuthentication.js" + const:jsFiles="Main.app.js, Common.js" const:popup="YES" - > + >
- -
+ +
- - - -
- + + + +
+ -
- -
{{warning}}
- - - - - - - - -
- - - - - - - - + + + + +
{{warning}}
+ + + + + + + + +
+ + + + + + + + +
+ + + + +
+ + + + + +
+ + + + + + + About + +
- - - - - - - -
- - - - - -
- - - - - - - - - - About - - -
-
- -
+ + + diff --git a/UI/WebServerResources/js/Main.app.js b/UI/WebServerResources/js/Main.app.js new file mode 100644 index 000000000..ca84585d4 --- /dev/null +++ b/UI/WebServerResources/js/Main.app.js @@ -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; + }); + }; + } +})(); diff --git a/UI/WebServerResources/js/SOGoRootPage.js b/UI/WebServerResources/js/SOGoRootPage.js deleted file mode 100644 index ec97d95e2..000000000 --- a/UI/WebServerResources/js/SOGoRootPage.js +++ /dev/null @@ -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; - }); - }; - }]); -})(); diff --git a/UI/WebServerResources/scss/styles.scss b/UI/WebServerResources/scss/styles.scss index f46051ac0..20d56f745 100755 --- a/UI/WebServerResources/scss/styles.scss +++ b/UI/WebServerResources/scss/styles.scss @@ -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';