Built files from Bizgaze WebServer
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

mobilregister.js 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. var Unibase;
  2. (function (Unibase) {
  3. let Themes;
  4. (function (Themes) {
  5. let Compact;
  6. (function (Compact) {
  7. let Components;
  8. (function (Components) {
  9. class MobilRegister extends Unibase.Platform.Core.BaseComponent {
  10. submit() {
  11. }
  12. jsFiles() {
  13. return ["tenants/themes/compact/index.anonymous.js", "platform/membership/managers/accountmanager.js", "platform/core/helpers/navigation/navigationhelper.js", "libs/passwordrequirement/passwordrequirement.js"];
  14. }
  15. cssFiles() {
  16. return ["libs/passwordrequirement/passwordrequirement.css"];
  17. }
  18. html(id, containerid) {
  19. if (jQuery("#external-form").length === 0) {
  20. var index = new Components.Index_Anonymous();
  21. index.init(null);
  22. }
  23. const html = `<div>
  24. <form id="frm_Register">
  25. <div id="bizgaze_SpiltErrorMessages"></div>
  26. <div id="div_CreatePswd">
  27. <h1 class="display-4 mb-30 text-dark-100 text-center">Register</h1>
  28. <div class="alert alert-primary">We will send link to your <a href=""><u>Email</u></a> to create your password.</div>
  29. <div class="form-group">
  30. <label class="control-label" id="lbl_Email">Email Address</label>
  31. <input id="signupEmail" value="" class="form-control input-lg text-dark" disabled="disabled">
  32. </div>
  33. <div class="form-group">
  34. <label class="control-label w-100">New Password</label>
  35. <input type="password" id="signupPassword" placeholder="Type a password" class="pr-password signupPassword form-control input-lg" autocomplete="off">
  36. <span toggle="#InputPassword" id="PasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span>
  37. <div class="showpwsdreq"></div>
  38. </div>
  39. <div class="form-group ">
  40. <label class="control-label w-100">Confirm Password</label>
  41. <input type="password" id="ConfirmPassword" placeholder="Type a password" class="ConfirmPassword form-control input-lg" autocomplete="new-password">
  42. <span toggle="#InputPassword" id="confirmPasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span>
  43. </div>
  44. <button class="btn btn-primary btn-block mb-20"
  45. type="button" id="btnSignUp">Register</button><p class="text-right"><a href="Index.html#/login">
  46. Back to login</a></p>
  47. </div>
  48. </div>
  49. <div id="div_SuccessMsg" class="d-none">
  50. <div class="d-62 bg-white rounded-circle mb-10 d-flex align-items-center justify-content-center mx-auto"><i class="fa fa-check font-50 text-success"></i>
  51. </div>
  52. <h1 class="display-4 mb-20 text-center">Password Created Successfully</h1>
  53. <p class="text-center"><a href="Index.html#/login">Click here to Login</a></p>
  54. </div>
  55. </form>`;
  56. return html;
  57. }
  58. load(id, containerid, callback) {
  59. var _fileCacheHelper = Unibase.Platform.Helpers.FileCacheHelper.Instance();
  60. jQuery(".preloader-it").delay(500).fadeOut("slow");
  61. jQuery("#external-container").delay(500).fadeIn("slow");
  62. jQuery("#bizgaze_body").css("background-color", "#f4f6f7");
  63. $("#div_modalbody").removeAttr("style");
  64. this._accountManager = Unibase.Platform.Membership.Managers.AccountManager.Instance();
  65. $(".pr-password").click(function () {
  66. var signUpPswd = $(".pr-password");
  67. signUpPswd.passwordRequirements({
  68. numCharacters: 8,
  69. useLowercase: true,
  70. useUppercase: true,
  71. useNumbers: true,
  72. useSpecial: true
  73. });
  74. });
  75. $("#PasswordHide").click(function () {
  76. var input = $('#signupPassword');
  77. input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
  78. $("#PasswordHide").toggleClass('fa-eye-slash fa-eye');
  79. });
  80. $("#confirmPasswordHide").click(function () {
  81. var input = $('#ConfirmPassword');
  82. input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
  83. $('#confirmPasswordHide').toggleClass('fa-eye-slash fa-eye');
  84. });
  85. $(".btn-outline-secondary").addClass('hidden');
  86. }
  87. register(obj) {
  88. var instance = this;
  89. $("#signupEmail").val(obj.email);
  90. $(document).bind('keypress', function (e) {
  91. if (e.keyCode == 13) {
  92. $('#btnSignUp').trigger('click');
  93. }
  94. });
  95. $("#btnSignUp").click(function () {
  96. instance.signupregister(obj.userid, obj.tenant, obj.email, obj.phonenumber);
  97. });
  98. }
  99. signupregister(unibseid, tenantid, email, phonenumber) {
  100. var instance = this;
  101. var ConfirmPassword = $(".ConfirmPassword").val().toString();
  102. var password = $(".signupPassword").val().toString();
  103. var tenantid = tenantid;
  104. var unibaseid = unibseid;
  105. var email = email;
  106. var phonenumber = phonenumber;
  107. if (password == '' || ConfirmPassword == '') {
  108. MessageHelper.Instance().showError("Password cannot be empty", "bizgaze_SpiltErrorMessages");
  109. return false;
  110. }
  111. if ($(".signupPassword").val().toString().length < 8 || $(".ConfirmPassword").val().toString().length < 8) {
  112. MessageHelper.Instance().showError("Password must be atleast 8 characters !", "bizgaze_SpiltErrorMessages");
  113. return false;
  114. }
  115. if (password != ConfirmPassword) {
  116. MessageHelper.Instance().showError("New and Confirm passwords does not match", "bizgaze_SpiltErrorMessages");
  117. return false;
  118. }
  119. var decimal = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/;
  120. var checkpassword = password.match(decimal) ? true : false;
  121. if (checkpassword == true) {
  122. var postData = {
  123. ConfirmPassword: ConfirmPassword,
  124. Password: password,
  125. UserId: unibaseid,
  126. TenantId: Number(tenantid),
  127. UserName: unibaseid,
  128. Email: email,
  129. ContactNumber: phonenumber
  130. };
  131. }
  132. else {
  133. $(".pr-password").focus();
  134. MessageHelper.Instance().showError("Please Match the Password in requested Format", "bizgaze_SpiltErrorMessages");
  135. }
  136. instance._accountManager.register(postData).then(function (response) {
  137. $("#div_CreatePswd").addClass('d-none');
  138. $("#div_SuccessMsg").removeClass('d-none');
  139. MessageHelper.Instance().showSuccess("Password Created Successfully", 'bizgaze_SpiltErrorMessages');
  140. });
  141. }
  142. static Instance() {
  143. return new MobilRegister();
  144. }
  145. }
  146. Components.MobilRegister = MobilRegister;
  147. })(Components = Compact.Components || (Compact.Components = {}));
  148. })(Compact = Themes.Compact || (Themes.Compact = {}));
  149. })(Themes = Unibase.Themes || (Unibase.Themes = {}));
  150. })(Unibase || (Unibase = {}));