aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/static/new/javascript/login.js
blob: 2fe9ba3c05f209fe82c9a6747abb301deec5122d (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
30
31
32
33
34
35
36
37
38
39
40
41
// Generated by CoffeeScript 1.8.0
$(function() {
  var form_success, modalize, submit_form;
  modalize = function(event) {
    event.preventDefault();
    console.log("in modal_replace:", $(this).attr("href"));
    return $.colorbox({
      open: true,
      href: this.href,
      onComplete: function() {
        return $(".focused").focus();
      }
    });
  };
  $(document).one("click", ".modalize", modalize);
  console.log("Modalized click!!!");
  form_success = function(data) {
    return $.colorbox({
      open: true,
      html: data,
      onComplete: function() {
        return $("form").on("submit", submit_form);
      }
    });
  };
  submit_form = function(event) {
    var data, submit_to;
    event.preventDefault();
    submit_to = $(this).attr('action');
    data = $(this).serialize();
    console.log("submit_to is:", submit_to);
    return $.ajax({
      type: "POST",
      url: submit_to,
      data: data,
      dataType: "html",
      success: form_success
    });
  };
  return $("#colorbox form").on("submit", submit_form);
});