cirandas.net

ref: master

public/javascripts/report-abuse.js


 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
jQuery(function($) {
  $('.report-abuse-action').live('click', function() {
    if($(this).attr('href'))
      noosfero.modal.url($(this).attr('href'));

    return false;
  });

  $('#report-abuse-submit-button').live('click', function(e) {
    e.preventDefault();
    loading_for_button(this);
    form = $(this).parents('form');
    $.post(form.attr("action"), form.serialize(), function(data) {
      data = $.parseJSON(data);
      $(this).parents('#colorbox').colorbox.close();
      if(data.ok) {
        display_notice(data.message);
      } else {
        display_notice(data.error.message);
      }
    });
  });

});