summaryrefslogtreecommitdiff
path: root/public/javascripts/admin_interface.js
blob: 12a3ba62a9357e02d62f0d53497806a2374de676 (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
$(document).ready(function () {
  $("#metadata").attr("style", "display: none;");
  
  $("#button").click(function () {
    $("#metadata").slideToggle("slow");
    
    if ($("#button").attr("class") == "unselected") {
      $("#button").attr("class", "selected");
    }
    else {
      $("#button").attr("class", "unselected");
    }
  });
  
  jQuery.ajaxSetup({ 
    'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")}
  })
  
  jQuery.fn.submitWithAjax = function() {
    $("#flash").append("<img src='/images/ajax-loader.gif' alt='' />");
    $.post(this.attr("action"), $(this).serialize(), null, "script");
  };
  
  
  
});