summaryrefslogtreecommitdiff
path: root/themes/default/js/user.js
blob: 06d43d159e3a61fdce1200efb0ab46c6144e2dac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function show_login(url) {
  $("#gLoginLink").hide();
  $(".gClose").show();
  $.get(url, function(data) {
    $("#gLoginFormContainer").html(data);
    ajaxify_login_form();
  });
}

function ajaxify_login_form() {
  $("form#gLoginForm").ajaxForm({
    target: "#gLoginFormContainer",
    success: function(responseText, statusText) {
      if (!responseText) {
        window.location.reload();
      } else {
        ajaxify_login_form();
      }
    },
  });
}

function close_login() {
  $("#gLoginForm").remove();
  $(".gClose").hide();
  $("#gLoginLink").show();
  $("input#gUsername").val("");
  $("input#gPassword").val("");
}