You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
998 B

  1. $(function () {
  2. function submitForm() {
  3. var base = document.getElementById("base-url").getAttribute("href").slice(0, -1);
  4. var email = $("#signup-email").val();
  5. try {
  6. var tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
  7. } catch(err) {
  8. var tz = "UTC";
  9. }
  10. $("#signup-go").prop("disabled", true);
  11. $.ajax({
  12. url: base + "/accounts/signup/",
  13. type: "post",
  14. data: {"identity": email, "tz": tz},
  15. success: function(data) {
  16. $("#signup-result").html(data).show();
  17. $("#signup-go").prop("disabled", false);
  18. }
  19. });
  20. return false;
  21. }
  22. $("#signup-go").on("click", submitForm);
  23. $("#signup-email").keypress(function (e) {
  24. if (e.which == 13) {
  25. return submitForm();
  26. }
  27. });
  28. $("#signup-modal").on('shown.bs.modal', function () {
  29. $("#signup-email").focus()
  30. })
  31. });