| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- var Unibase;
- (function (Unibase) {
- let Themes;
- (function (Themes) {
- let Compact;
- (function (Compact) {
- let Components;
- (function (Components) {
- class HomeAffairsLogin extends Unibase.Platform.Core.BaseComponent {
- jsFiles() {
- var jsfiles = ["tenants/themes/compact/index.mobil_anonymous.js", "platform/membership/managers/accountmanager.js", "platform/membership/infos/identity.js", "platform/membership/requests/login.js", "platform/core/helpers/cookies/cookiehelper.js", "tenants/themes/compact/components/notifications/notification.js", "platform/core/enums/rowstatus.js"];
- return jsfiles;
- }
- cssFiles() {
- return [];
- }
- load(id, containerid, callback) {
- this._accountManager = Unibase.Platform.Membership.Managers.AccountManager.Instance();
- Unibase.Platform.Membership.Infos.Identity.setCurrentUser(null);
- var instance = this;
- $(".biz-pg-wrapper").addClass("mt-0");
- $('#BtnLogin_nav').click(function () {
- $('.first-display').addClass('d-none');
- $('.login-display').removeClass('d-none');
- });
- $('.back-btn').click(function () {
- $('.first-display').removeClass('d-none');
- $('.login-display').addClass('d-none');
- });
- if (isMobileApp()) {
- $('#Frm_Login').find('.register-div').addClass('d-none');
- }
- jQuery(".preloader-it").delay(500).fadeOut("slow");
- jQuery("#external-container").delay(500).fadeIn("slow");
- jQuery("#bizgaze_body").css("background-color", "#f4f6f7");
- $("#InputEmail,#InputPassword").keypress(function (e) {
- if (e.which == 13)
- document.getElementById("BtnLogin").click();
- });
- $('#PasswordHide').click(function () {
- var input = $('#InputPassword');
- input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
- $('#PasswordHide').toggleClass('fa-eye-slash fa-eye');
- });
- $("#btnClearcache").click(function () {
- if (isMobileApp()) {
- Unibase.Platform.Helpers.MobileHelper.Instance().openSettings();
- }
- });
- jQuery("#InputEmail,#InputPassword").on("input", function () {
- let username = $("#InputEmail").val().toString().trim();
- let password = $("#InputPassword").val();
- let validData = true;
- if (username == '' || username == undefined || password == '' || password == undefined)
- validData = false;
- if (validData) {
- jQuery("#BtnLogin").removeClass("disabled");
- }
- else {
- jQuery("#BtnLogin").addClass("disabled");
- }
- });
- $(".btn-outline-secondary").addClass('hidden');
- jQuery("#BtnLogin").click(function () {
- instance.validate();
- });
- if (callback != null) {
- callback();
- }
- }
- loadDomainLogo(imagerurl) {
- if (imagerurl != null && imagerurl != undefined && imagerurl != "") {
- this.imageUrl = imagerurl;
- }
- else {
- this.imageUrl = "tenants/themes/compact/imgs/bg_1.png";
- }
- }
- validate(username, password, remember) {
- MessageHelper.Instance().hideMessage();
- if (!isMobileApp() || (username == undefined && password == undefined)) {
- username = $("#InputEmail").val().toString().trim();
- password = $("#InputPassword").val().toString();
- remember = $("#InputRemember").prop("checked");
- }
- else {
- remember = true;
- }
- let validData = true;
- if (username == '' || username == undefined || password == '' || password == undefined)
- validData = false;
- if (validData) {
- jQuery("#BtnLogin").addClass("disabled");
- jQuery("#BtnLogin").text("Validating");
- var request = new Unibase.Platform.Membership.Requests.Login(username, password, '', remember);
- if (this._accountManager == undefined) {
- this._accountManager = Unibase.Platform.Membership.Managers.AccountManager.Instance();
- }
- this._accountManager.validateLogin(request).then(function (response) {
- var identity = response.result;
- if (identity === null) {
- if (isMobileApp()) {
- Unibase.Platform.Helpers.MobileHelper.Instance().cacheUserCredantials('', '');
- }
- MessageHelper.Instance().showError(response.message, 'validation-summary');
- jQuery("#BtnLogin").removeClass("disabled");
- jQuery("#BtnLogin").text("Login");
- }
- else {
- if (isMobileApp()) {
- Unibase.Platform.Helpers.MobileHelper.Instance().cacheUserCredantials(username, password);
- Unibase.Platform.Helpers.MobileHelper.Instance().saveUserDevice(identity.sessionId);
- }
- Unibase.Platform.Membership.Infos.Identity.setCurrentUser(identity);
- window.location.href = '#/welcome';
- if (isMobileApp()) {
- }
- }
- });
- }
- else {
- if (isMobileApp()) {
- Unibase.Platform.Helpers.MobileHelper.Instance().cacheUserCredantials('', '');
- Unibase.Platform.Helpers.MobileHelper.Instance().redirectToLogin();
- }
- MessageHelper.Instance().showError("Mandatory fields are missing", 'validation-summary');
- }
- }
- html(id, containerid) {
- if (jQuery("#external-form").length === 0) {
- var index = new Compact.Components.Index_Mobil_Anonymous();
- index.init(null, this.imageUrl);
- }
- let assesturl = _appsettings.asset_url();
- let html = '';
- if (($(window).width()) > 1200) {
- html += `<div class="row h-100" style="background:url('` + assesturl + `tenants/themes/compact/imgs/homeaffairs/homeaffariesdesktopbg.jpg');background-size:cover;"><div class="col-xl-5"><div class="banner-img-container h-100 d-flex align-items-center justify-content-center pl-145"><img src="` + assesturl + `tenants/themes/compact/imgs/homeaffairs/aa.png" alt="img" class="img-fluid"> </div></div><div class="col-xl-7 desktop-view d-flex align-items-center justify-content-center flex-column pr-140 text-white"><form id="Frm_Login" default="" data-validate="parsley" data-isdynamic="false"><h1 class="display-4 mb-10 text-white">Login</h1><p class="mb-30">Sign in to your account and enjoy unlimited perks.</p><div id="validation-summary"></div><div class="form-group"><input class="form-control" id="InputEmail" placeholder="Phone or Email" type="text"></div><div class="form-group mb-20"><input class="form-control" id="InputPassword" placeholder="Password" type="password" autocomplete="new-password"><span toggle="#InputPassword" id="PasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span></div><div class="input-group mb-20"><div class="custom-control custom-checkbox col-xs"><input class="custom-control-input" id="InputRemember" type="checkbox"><label class="custom-control-label font-14" for="InputRemember">Keep me logged in</label></div><div class="col-xs ml-auto"><p class="text-right"><a href="index.html#/forgotpassword" class="text-white">Forgot Password?</a></p></div></div><a class="btn btn-block text-white disabled" id="BtnLogin" style="background:#001F5D;">Login</a></form><div class="option-sep">or</div><div class="row"><div class="text-center pa-5">Already an existing user? <a href="index.html#/registeruser">Register</a></div><div class="text-center col-sm p-2"></div></div></div></div>`;
- }
- else {
- html = `<form id="Frm_Login" default="" class="p-4 login-display d-flex biz-custom-scrollbar" data - validate="parsley" data - isdynamic="false" style="background:url('` + assesturl + `tenants/themes/compact/imgs/homeaffairs/homeaffariesmobilebg.jpg')!important;background-size:cover;">
- <div id="validation-summary" class="position-fixed w-85"> </div>
- <div class="d-flex flex-column justify-content-between p-3">
- <div class="logo_img mx-auto"> <img src="tenants/themes/compact/imgs/homeaffairs/aa.png" class="img-fluid w-100">
-
- </div>
- <div>
- <div class="form-group"> <input class="form-control login-input bg-white" id="InputEmail" placeholder="Phone or Email" type="text"></div>
- <div class="form-group mb-20"> <input class="form-control login-input" id="InputPassword" placeholder="Password" type="password" autocomplete="new- password"> <span toggle="#InputPassword" id="PasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span> </div>
- <div class="input-group mb-20"><div class="custom-control custom-checkbox col-xs"><input class="custom-control-input" id="InputRemember" type="checkbox"><label class="custom-control-label font-14 text-charcoal-dark-3" for="InputRemember">Keep me logged in</label></div><div class="col-xs ml-auto"><p class="text-right"><a href="index.html#/forgotpassword" class="text-white">Forgot Password?</a></p></div></div>
- <div class="input-group mb-20 flex-column">
- <a class="btn btn-block rounded-10 text-white w-70 mt-25 mx-auto shadow-lg-blue" style="background:#001F5D; padding: 10px!important;" id="BtnLogin"> Login </a>
- </div>
- <div class="register-div">
- <div class="option-sep">or</div>
- <div class="row"><div class="text-center text-brown col-sm-6 pa-5 text-dark">Already an existing user? <a href="index.html#/registeruser" class="text-white">Register</a></div><div class="text-center col-sm p-2"></div></div>
- </div>
- </div>
-
- </div>
- </form>
- </div>`;
- }
- return html;
- }
- static Instance() {
- return new HomeAffairsLogin();
- }
- }
- Components.HomeAffairsLogin = HomeAffairsLogin;
- })(Components = Compact.Components || (Compact.Components = {}));
- })(Compact = Themes.Compact || (Themes.Compact = {}));
- })(Themes = Unibase.Themes || (Unibase.Themes = {}));
- })(Unibase || (Unibase = {}));
|