diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2015-06-18 15:42:21 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2015-06-18 15:42:21 +0200 |
commit | 22b0f08821ebe5a37dbdeac5de834132adc12ece (patch) | |
tree | 7f95f8bc879fa672c7208a9d1896ce03c1cc76a8 /src/index.html | |
parent | e1da1118b2899ad40793a0a6b06e145899a92ee1 (diff) | |
download | biruda-22b0f08821ebe5a37dbdeac5de834132adc12ece.tar.gz biruda-22b0f08821ebe5a37dbdeac5de834132adc12ece.tar.bz2 |
added images for jQuery UI in web interface
some error handling when retrieving the status via AJAX
Diffstat (limited to 'src/index.html')
-rw-r--r-- | src/index.html | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/index.html b/src/index.html index c6ab63a..4372efa 100644 --- a/src/index.html +++ b/src/index.html @@ -7,14 +7,38 @@ <script src="/web/jquery-ui.js"></script> <script> + function sleep(milliseconds) { + var start = new Date().getTime(); + for (var i = 0; i < 1e7; i++) { + if ((new Date().getTime() - start) > milliseconds){ + break; + } + } + } + $( function( ) { - $( "#tabs" ).tabs( ); + $( "#tabs" ).tabs({ + cache: false, + beforeLoad: function( event, ui ) { + ui.panel.html( "Loading, please wait..." ); + ui.jqXHR.fail( function( ) { + ui.panel.html( + "Couldn't load status of biruda. Check if biruda is running and the webserver is enabled." ); + }); + } + }); }); $(document).ready( function( ) { refresh_status( ); }); + //~ $('#tabs').tabs({ + //~ beforeLoad: function( event, ui ) { + //~ + //~ } + //~ }); + function refresh_status( ) { $('#tabs').tabs( 'load', 0 ); } |