var Unibase; (function (Unibase) { let Themes; (function (Themes) { let Compact; (function (Compact) { let Components; (function (Components) { class MobilRegister extends Unibase.Platform.Core.BaseComponent { submit() { } jsFiles() { return ["tenants/themes/compact/index.anonymous.js", "platform/membership/managers/accountmanager.js", "platform/core/helpers/navigation/navigationhelper.js", "libs/passwordrequirement/passwordrequirement.js"]; } cssFiles() { return ["libs/passwordrequirement/passwordrequirement.css"]; } html(id, containerid) { if (jQuery("#external-form").length === 0) { var index = new Components.Index_Anonymous(); index.init(null); } const html = `

Register

We will send link to your Email to create your password.

Back to login

Password Created Successfully

Click here to Login

`; return html; } load(id, containerid, callback) { var _fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance(); jQuery(".preloader-it").delay(500).fadeOut("slow"); jQuery("#external-container").delay(500).fadeIn("slow"); jQuery("#bizgaze_body").css("background-color", "#f4f6f7"); $("#div_modalbody").removeAttr("style"); this._accountManager = Unibase.Platform.Membership.Managers.AccountManager.Instance(); $(".pr-password").click(function () { var signUpPswd = $(".pr-password"); signUpPswd.passwordRequirements({ numCharacters: 8, useLowercase: true, useUppercase: true, useNumbers: true, useSpecial: true }); }); $("#PasswordHide").click(function () { var input = $('#signupPassword'); input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password'); $("#PasswordHide").toggleClass('fa-eye-slash fa-eye'); }); $("#confirmPasswordHide").click(function () { var input = $('#ConfirmPassword'); input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password'); $('#confirmPasswordHide').toggleClass('fa-eye-slash fa-eye'); }); $(".btn-outline-secondary").addClass('hidden'); } register(obj) { var instance = this; $("#signupEmail").val(obj.email); $(document).bind('keypress', function (e) { if (e.keyCode == 13) { $('#btnSignUp').trigger('click'); } }); $("#btnSignUp").click(function () { instance.signupregister(obj.userid, obj.tenant, obj.email, obj.phonenumber); }); } signupregister(unibseid, tenantid, email, phonenumber) { var instance = this; var ConfirmPassword = $(".ConfirmPassword").val().toString(); var password = $(".signupPassword").val().toString(); var tenantid = tenantid; var unibaseid = unibseid; var email = email; var phonenumber = phonenumber; if (password == '' || ConfirmPassword == '') { MessageHelper.Instance().showError("Password cannot be empty", "bizgaze_SpiltErrorMessages"); return false; } if ($(".signupPassword").val().toString().length < 8 || $(".ConfirmPassword").val().toString().length < 8) { MessageHelper.Instance().showError("Password must be atleast 8 characters !", "bizgaze_SpiltErrorMessages"); return false; } if (password != ConfirmPassword) { MessageHelper.Instance().showError("New and Confirm passwords does not match", "bizgaze_SpiltErrorMessages"); return false; } var decimal = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/; var checkpassword = password.match(decimal) ? true : false; if (checkpassword == true) { var postData = { ConfirmPassword: ConfirmPassword, Password: password, UserId: unibaseid, TenantId: Number(tenantid), UserName: unibaseid, Email: email, ContactNumber: phonenumber }; } else { $(".pr-password").focus(); MessageHelper.Instance().showError("Please Match the Password in requested Format", "bizgaze_SpiltErrorMessages"); } instance._accountManager.register(postData).then(function (response) { $("#div_CreatePswd").addClass('d-none'); $("#div_SuccessMsg").removeClass('d-none'); MessageHelper.Instance().showSuccess("Password Created Successfully", 'bizgaze_SpiltErrorMessages'); }); } static Instance() { return new MobilRegister(); } } Components.MobilRegister = MobilRegister; })(Components = Compact.Components || (Compact.Components = {})); })(Compact = Themes.Compact || (Themes.Compact = {})); })(Themes = Unibase.Themes || (Unibase.Themes = {})); })(Unibase || (Unibase = {}));