diff --git a/images/loading.gif b/images/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..240bd88c5b3ded4e5449bfb8a52180682e410780 Binary files /dev/null and b/images/loading.gif differ diff --git a/inc/html.php b/inc/html.php index 5969198bd14e9c98167fdfd3d3ea972a6576cfe2..b21ab4e574d64011913fb88e78db569e41d8e816 100644 --- a/inc/html.php +++ b/inc/html.php @@ -538,6 +538,13 @@ function html_search(){ print parsedLocale('searchpage'); flush(); + //show progressbar + print '<div align="center">'; + print '<script language="JavaScript" type="text/javascript">'; + print 'showLoadBar();'; + print '</script>'; + print '<br /></div>'; + //do quick pagesearch $data = array(); search($data,$conf['datadir'],'search_pagename',array(query => cleanID($QUERY))); @@ -571,6 +578,11 @@ function html_search(){ }else{ print '<div align="center">'.$lang['nothingfound'].'</div>'; } + + //hide progressbar + print '<script language="JavaScript" type="text/javascript">'; + print 'hideLoadBar();'; + print '</script>'; } /** diff --git a/script.js b/script.js index db22d32b151f504398c88ff39c17780bec4b43ec..996652903dfa32e7a26b987ed9cc9c4d382368f3 100644 --- a/script.js +++ b/script.js @@ -30,6 +30,29 @@ function escapeQuotes(text) { return text; } +/** + * Prints a animated gif to show the search is performed + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function showLoadBar(){ + if(document.getElementById){ + document.write('<img src="'+baseURL+'images/loading.gif" '+ + 'width="150" height="12" id="loading" />'); + } +} + +/** + * Disables the animated gif to show the search is done + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function hideLoadBar(){ + if(document.getElementById){ + document.getElementById('loading').style.display="none"; + } +} + /** * Checks if a summary was entered - if not the style is changed *