source: trunk/web-app/js/application.js @ 824

Last change on this file since 824 was 824, checked in by gav, 13 years ago

Add jQuery AJAX util js and css.

File size: 694 bytes
Line 
1var Ajax;
2if (Ajax && (Ajax != null)) {
3    Ajax.Responders.register({
4    onCreate: function() {
5        if($('spinner') && Ajax.activeRequestCount>0)
6        Effect.Appear('spinner',{duration:0.5,queue:'end'});
7    },
8    onComplete: function() {
9        if($('spinner') && Ajax.activeRequestCount==0)
10        Effect.Fade('spinner',{duration:0.5,queue:'end'});
11    }
12    });
13}
14
15// jQuery AJAX utils.
16
17function getLoadingHtml() {
18    var imgSrc = getContextPath()+"/images/loading.gif";
19    return '<div class="jQueryAjaxLoading"><img src="'+imgSrc+'" />.</div>';
20}
21
22function getErrorHtml() {
23    var html =  '<div class="message_error">Could not perform operation.</div>';
24    return html;
25}
Note: See TracBrowser for help on using the repository browser.