comparison gpp/shoutbox/static/js/shoutbox.js @ 427:85d7b62d5c17

Added a global method to change the cursor to an hourglass when an AJAX request fires.
author Brian Neal <bgneal@gmail.com>
date Tue, 26 Apr 2011 02:11:00 +0000
parents c3d3d7114749
children
comparison
equal deleted inserted replaced
426:c8148cf11a79 427:85d7b62d5c17
19 if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) { 19 if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {
20 // Only send the token to relative URLs i.e. locally. 20 // Only send the token to relative URLs i.e. locally.
21 xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); 21 xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
22 } 22 }
23 } 23 }
24 });
25
26 $("html").bind("ajaxStart", function() {
27 $(this).addClass('busy');
28 }).bind("ajaxStop", function() {
29 $(this).removeClass('busy');
24 }); 30 });
25 31
26 var numShouts = $('#shoutbox-shout-container > p').size(); 32 var numShouts = $('#shoutbox-shout-container > p').size();
27 var sbBox = $('#shoutbox-shout-container'); 33 var sbBox = $('#shoutbox-shout-container');
28 34