summaryrefslogtreecommitdiff
path: root/src/webserver.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-06-21 19:16:50 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2015-06-21 19:16:50 +0200
commitca2ca055e6281ee2b95285199f6ee2d8c1f46889 (patch)
tree841c5008a8b4e67c34affa0572e72a76d8118da1 /src/webserver.c
parentfa55b7f146bceed4a85637f7747877a9c9ceebc6 (diff)
downloadbiruda-ca2ca055e6281ee2b95285199f6ee2d8c1f46889.tar.gz
biruda-ca2ca055e6281ee2b95285199f6ee2d8c1f46889.tar.bz2
added waiting indicators in web interface buttons
Diffstat (limited to 'src/webserver.c')
-rw-r--r--src/webserver.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/webserver.c b/src/webserver.c
index 331dfd9..68c23e6 100644
--- a/src/webserver.c
+++ b/src/webserver.c
@@ -30,6 +30,8 @@
#include "ui-icons_454545_256x240-png.h"
#include "ui-icons_888888_256x240-png.h"
#include "ui-icons_cd0a0a_256x240-png.h"
+#include "loading-gif.h"
+#include "jquery.ui.waitbutton.js.h"
static struct MHD_Daemon *d;
@@ -203,6 +205,15 @@ static int handle_request( void *cls, struct MHD_Connection *connection,
memcpy( biruda_msg, images_ui_icons_cd0a0a_256x240_png, images_ui_icons_cd0a0a_256x240_png_len );
content_type = CONTENT_TYPE_IMAGE_PNG;
biruda_msg_len = images_ui_icons_cd0a0a_256x240_png_len;
+ } else if( strcmp( url, "/web/images/loading.gif" ) == 0 ) {
+ memcpy( biruda_msg, images_loading_gif, images_loading_gif_len );
+ content_type = CONTENT_TYPE_IMAGE_PNG;
+ biruda_msg_len = images_loading_gif_len;
+ } else if( strcmp( url, "/web/jquery.ui.waitbutton.js" ) == 0 ) {
+ strncpy( biruda_msg, (char *)jquery_ui_waitbutton_js, jquery_ui_waitbutton_js_len );
+ biruda_msg[jquery_ui_waitbutton_js_len] = '\0';
+ content_type = CONTENT_TYPE_TEXT_JS;
+ biruda_msg_len = strlen( biruda_msg );
} else {
strcat( biruda_msg, "<html><body><p>This is biruda, the REST api. You can access the web interface <a href=\"/web\">here</a>.</p></body></html>" );
biruda_msg_len = strlen( biruda_msg );