2018-03-07 17:09:20 +01:00
|
|
|
{"version":3,"sources":["Main/Main.app.js"],"names":["LoginController","$scope","$window","$timeout","Dialog","$mdDialog","Authentication","vm","this","$onInit","creds","username","cookieUsername","password","rememberLogin","angular","isDefined","length","test","location","search","language","loginState","showLogin","login","then","data","cn","href","url","reload","msg","errorMessage","error","showAbout","$event","AboutDialogController","closeDialog","hide","show","targetEvent","templateUrl","controller","controllerAs","$inject","changeLanguage","ApplicationBaseURL","module"],"mappings":"CAGA,WACE,YAQA,SAASA,GAAgBC,EAAQC,EAASC,EAAUC,EAAQC,EAAWC,GACrE,GAAIC,GAAKC,IAETA,MAAKC,QAAU,WACbD,KAAKE,OACHC,SAAUT,EAAQU,eAClBC,SAAU,KACVC,cAAeC,QAAQC,UAAUd,EAAQU,iBAAmBV,EAAQU,eAAeK,OAAS,GAG1F,cAAcC,KAAKhB,EAAQiB,SAASC,UACtCZ,KAAKE,MAAMW,SAAWnB,EAAQmB,UAChCb,KAAKc,YAAa,EAGlBd,KAAKe,WAAY,EACjBpB,EAAS,WAAaI,EAAGgB,WAAY,GAAS,MAGhDf,KAAKgB,MAAQ,WAkBX,MAjBAjB,GAAGe,WAAa,iBAChBhB,EAAekB,MAAMjB,EAAGG,OACrBe,KAAK,SAASC,GACbnB,EAAGe,WAAa,SAChBf,EAAGoB,GAAKD,EAAKC,GAGbxB,EAAS,WACHD,EAAQiB,SAASS,OAASF,EAAKG,IACjC3B,EAAQiB,SAASW,QAAO,GAExB5B,EAAQiB,SAASS,KAAOF,EAAKG,KAC9B,MACF,SAASE,GACVxB,EAAGe,WAAa,QAChBf,EAAGyB,aAAeD,EAAIE,SAEnB,GAGTzB,KAAK0B,UAAY,SAASC,GAQxB,QAASC,GAAsB/B,GAC7BG,KAAK6B,YAAc,WACjBhC,EAAUiC,QATdjC,EAAUkC,MACRC,YAAaL,EACbM,YAAa,gBACbC,WAAYN,EACZO,aAAc,UAEhBP,EAAsBQ,SAAW,cAQnCpC,KAAKqC,eAAiB,SAASV,GAE7BjC,EAAQiB,SAASS,KAAOkB,mBAAqB,kBAAoBtC,KAAKE,MAAMW,UA/DhFN,QAAQgC,OAAO,eAAgB,cAAe,wBAK9C/C,EAAgB4C,SAAW,SAAU,UAAW,WAAY,SAAU,YAAa,kBA8DnF7B,QACGgC,OAAO,eACPL,WAAW,kBAAmB1C","file":"Main.js","sourcesContent":["/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* JavaScript for MainUI (SOGoRootPage) */\n\n(function() {\n 'use strict';\n\n angular.module('SOGo.MainUI', ['SOGo.Common', 'SOGo.Authentication']);\n\n /**\n * @ngInject\n */\n LoginController.$inject = ['$scope', '$window', '$timeout', 'Dialog', '$mdDialog', 'Authentication'];\n function LoginController($scope, $window, $timeout, Dialog, $mdDialog, Authentication) {\n var vm = this;\n\n this.$onInit = function() {\n this.creds = {\n username: $window.cookieUsername,\n password: null,\n rememberLogin: angular.isDefined($window.cookieUsername) && $window.cookieUsername.length > 0\n };\n // Send selected language only if user has changed it\n if (/\\blanguage=/.test($window.location.search))\n this.creds.language = $window.language;\n this.loginState = false;\n\n // Show login once everything is initialized\n this.showLogin = false;\n $timeout(function() { vm.showLogin = true; }, 100);\n };\n\n this.login = function() {\n vm.loginState = 'authenticating';\n Authentication.login(vm.creds)\n .then(function(data) {\n vm.loginState = 'logged';\n vm.cn = data.cn;\n\n // Let the user see the succesfull message before reloading the page\n $timeout(function() {\n if ($window.location.href === data.url)\n $window.location.reload(true);\n else\n $window.location.href = data.url;\n }, 1000);\n }, function(msg) {\n vm.loginState = 'error';\n vm.errorMessage = msg.error;\n });\n return false;\n };\n\n this.showAbout = function($event) {\n $mdDialog.show({\n targetEvent: $event,\n templateUrl: 'aboutBox.html',\n controller: AboutDialogController,\n controllerAs: 'about'\n });\n AboutDialogController.$inject = ['$mdDialog'];\n function AboutDialogController($mdDialog) {\n this.closeDialog = function() {\n $mdDialog.hide();\n };\n }\n };\n\n this.changeLanguage = function($event) {\n // Reload page\n $window.location.href = ApplicationBaseURL + 'login?language=' + this.creds.language;\n };\n }\n\n angular\n .module('SOGo.MainUI')\n .controller('LoginController', LoginController);\n})();\n"]}
|