From d91a4ef556635b5298c47df2856851f0694b2885 Mon Sep 17 00:00:00 2001 From: Klap-in Date: Tue, 29 Jan 2013 01:44:45 +0100 Subject: Add a break to ajax_qsearch() When the search input is still only a few characters, the number of matching pages is big. Browsers have heavy work to progress this whole return, better cut off so only the part that is directly displayed will be sent. --- lib/exe/ajax.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/exe/ajax.php') diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php index 9989269cf..fdc28d4f1 100644 --- a/lib/exe/ajax.php +++ b/lib/exe/ajax.php @@ -57,6 +57,7 @@ function ajax_qsearch(){ print ''.$lang['quickhits'].''; print ''; } -- cgit v1.2.3 From 48606867454b93c7d11708b8193fbc2a4368aaf9 Mon Sep 17 00:00:00 2001 From: Klap-in Date: Sun, 3 Feb 2013 19:53:11 +0100 Subject: use var and remove suggestions when needed Use variable for maximum number of suggestions for quicksearch. And hide suggestions when search field is emptied, or when no suggestion are found. --- lib/exe/ajax.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/exe/ajax.php') diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php index fdc28d4f1..9769503a7 100644 --- a/lib/exe/ajax.php +++ b/lib/exe/ajax.php @@ -45,6 +45,8 @@ function ajax_qsearch(){ global $lang; global $INPUT; + $maxnumbersuggestions = 50; + $query = $INPUT->post->str('q'); if(empty($query)) $query = $INPUT->get->str('q'); if(empty($query)) return; @@ -72,7 +74,7 @@ function ajax_qsearch(){ echo '
  • ' . html_wikilink(':'.$id,$name) . '
  • '; $counter ++; - if($counter > 50) { + if($counter > $maxnumbersuggestions) { echo '
  • ...
  • '; break; } -- cgit v1.2.3