The branch, master has been updated via 4d3d5eb46d43074b6690b7d6b51596f108288edd (commit) from 38390524fe7fe487772c7ef5ab45731aa22a43be (commit)
- Log ----------------------------------------------------------------- commit 4d3d5eb46d43074b6690b7d6b51596f108288edd Author: Thilanka lgtkaushalya@gmail.com Date: Sun May 15 13:07:32 2011 -0400
Patch #3256122 [search] Show/hide db search results
-----------------------------------------------------------------------
Summary of changes: ChangeLog | 1 + js/db_search.js | 43 +++++++++++++++++++++++++++++++++++++++---- js/messages.php | 2 ++ 3 files changed, 42 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 53390ba..158e330 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ + rfe #2021981 [interface] Add support for mass prefix change. + "up to date" message on main page when current version is up to date + Update to jQuery 1.6.1 ++ Patch #3256122 [search] Show/hide db search results
3.4.1.0 (not yet released) - bug #3301108 [interface] Synchronize and already configured host diff --git a/js/db_search.js b/js/db_search.js index 79c444e..33d5e17 100644 --- a/js/db_search.js +++ b/js/db_search.js @@ -51,14 +51,14 @@ function deleteResult(result_path , msg , ajaxEnable){ /** Load the deleted option to the page*/ $('#browse-results').load(result_path + " '"+'#result_query' + "'"); $('#sqlqueryform').load(result_path + " '"+'#sqlqueryform' + "'"); - $('#togglequerybox').html(PMA_messages['strHideQueryBox']); + $('#togglequerybox').html(PMA_messages['strShowQueryBox']);
/** Refresh the search results after the deletion */ document.getElementById('buttonGo'). click(); //PMA_ajaxShowMessage(PMA_messages['strDeleting']); /** Show the results of the deletion option */ $('#browse-results').show(); - $('#sqlqueryform').show(); + $('#sqlqueryform').hide(); $('#togglequerybox').show(); } else @@ -90,6 +90,31 @@ $(document).ready(function() { $('#togglequerybox').hide(); }); /** + *Prepare a div containing a link for toggle the search results + */ + $('<div id="togglesearchresultsdiv"><a id="togglesearchresultlink"></a></div>') + .insertAfter('#searchresults') + /** don't show it until we have results on-screen */ + .hide(); + + $('<br class="clearfloat" />').insertAfter("#togglesearchresultsdiv").show(); + /** Changing the displayed text according to the hide/show criteria in search result forms*/ + + $('#togglesearchresultlink') + .html(PMA_messages['strHideSearchResults']) + .bind('click', function() { + var $link = $(this); + $('#searchresults').slideToggle(); + if ($link.text() == PMA_messages['strHideSearchResults']) { + $link.text(PMA_messages['strShowSearchResults']); + } else { + $link.text(PMA_messages['strHideSearchResults']); + } + /** avoid default click action */ + return false; + }); + + /** * Prepare a div containing a link for toggle the search form, otherwise it's incorrectly displayed * after a couple of clicks */ @@ -101,7 +126,7 @@ $(document).ready(function() { /** Changing the displayed text according to the hide/show criteria in search form*/ $("#togglequerybox").hide(); $("#togglequerybox").bind('click', function() { - var $link = $(this) + var $link = $(this); $('#sqlqueryform').slideToggle("medium"); if ($link.text() == PMA_messages['strHideQueryBox']) { $link.text(PMA_messages['strShowQueryBox']); @@ -110,7 +135,7 @@ $(document).ready(function() { } /** avoid default click action */ return false; - }) + });
/** don't show it until we have results on-screen */
@@ -149,6 +174,16 @@ $(document).ready(function() { // found results $("#searchresults").html(response); $("#sqlqueryresults").trigger('appendAnchor'); + + $('#togglesearchresultlink') + // always start with the Show message + .text(PMA_messages['strHideSearchResults']) + $('#togglesearchresultsdiv') + // now it's time to show the div containing the link + .show(); + $('#searchresults').show(); + + $('#db_search_form') // workaround for Chrome problem (bug #3168569) .slideToggle() diff --git a/js/messages.php b/js/messages.php index e0102b4..6d7b0e7 100644 --- a/js/messages.php +++ b/js/messages.php @@ -81,6 +81,8 @@ $js_messages['strNo'] = __('No');
/* For db_search.js */ $js_messages['strSearching'] = __('Searching'); +$js_messages['strHideSearchResults'] = __('Hide search results'); +$js_messages['strShowSearchResults'] = __('Show search results'); //$js_messages['strBrowsing'] = __('Browsing'); //$js_messages['strDeleting'] = __('Deleting');
hooks/post-receive