sogo/UI/WebServerResources/js/Main.js
2018-03-07 11:09:20 -05:00

2 lines
1.1 KiB
JavaScript

!function(){"use strict";function a(a,b,c,d,e,f){var g=this;this.$onInit=function(){this.creds={username:b.cookieUsername,password:null,rememberLogin:angular.isDefined(b.cookieUsername)&&b.cookieUsername.length>0},/\blanguage=/.test(b.location.search)&&(this.creds.language=b.language),this.loginState=!1,this.showLogin=!1,c(function(){g.showLogin=!0},100)},this.login=function(){return g.loginState="authenticating",f.login(g.creds).then(function(a){g.loginState="logged",g.cn=a.cn,c(function(){b.location.href===a.url?b.location.reload(!0):b.location.href=a.url},1e3)},function(a){g.loginState="error",g.errorMessage=a.error}),!1},this.showAbout=function(a){function b(a){this.closeDialog=function(){a.hide()}}e.show({targetEvent:a,templateUrl:"aboutBox.html",controller:b,controllerAs:"about"}),b.$inject=["$mdDialog"]},this.changeLanguage=function(a){b.location.href=ApplicationBaseURL+"login?language="+this.creds.language}}angular.module("SOGo.MainUI",["SOGo.Common","SOGo.Authentication"]),a.$inject=["$scope","$window","$timeout","Dialog","$mdDialog","Authentication"],angular.module("SOGo.MainUI").controller("LoginController",a)}();
//# sourceMappingURL=Main.js.map