The branch, master has been updated via 30954728f30a9e8171d799dbd6de0abc87e1f563 (commit) via 2d9ffe0fa24cfe13ae31c41198ebf6604c1c5d80 (commit) via 1674e0c6c329cff191dda7eb56f10e37e39002d0 (commit) from 75366e37e7a449000e36ad67c46d282133b67236 (commit)
- Log ----------------------------------------------------------------- commit 30954728f30a9e8171d799dbd6de0abc87e1f563 Author: Marc Delisle marc@infomarc.info Date: Wed Feb 2 07:43:28 2011 -0500
Workaround for Chrome problem on db search
commit 2d9ffe0fa24cfe13ae31c41198ebf6604c1c5d80 Author: Marc Delisle marc@infomarc.info Date: Wed Feb 2 07:40:05 2011 -0500
Remove tab characters
commit 1674e0c6c329cff191dda7eb56f10e37e39002d0 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Wed Feb 2 07:32:55 2011 -0500
Patch #3169798 Show/hide criteria on db Search
-----------------------------------------------------------------------
Summary of changes: js/db_search.js | 50 +++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 45 insertions(+), 5 deletions(-)
diff --git a/js/db_search.js b/js/db_search.js index ea7280b..41ea5e6 100644 --- a/js/db_search.js +++ b/js/db_search.js @@ -25,6 +25,28 @@ $(document).ready(function() { });
/** + * Prepare a div containing a link, otherwise it's incorrectly displayed + * after a couple of clicks + */ + $('<div id="togglesearchformdiv"><a id="togglesearchformlink"></a></div>') + .insertAfter('#db_search_form') + // don't show it until we have results on-screen + .hide(); + + $('#togglesearchformlink') + .html(PMA_messages['strShowSearchCriteria']) + .bind('click', function() { + var $link = $(this); + $('#db_search_form').slideToggle(); + if ($link.text() == PMA_messages['strHideSearchCriteria']) { + $link.text(PMA_messages['strShowSearchCriteria']); + } else { + $link.text(PMA_messages['strHideSearchCriteria']); + } + // avoid default click action + return false; + }); + /** * Ajax Event handler for retrieving the result of an SQL Query * (see $GLOBALS['cfg']['AjaxEnable']) * @@ -34,15 +56,33 @@ $(document).ready(function() { event.preventDefault();
PMA_ajaxShowMessage(PMA_messages['strSearching']); - + // jQuery object to reuse $form = $(this); - + + // add this hidden field just once if (! $form.find('input:hidden').is('#ajax_request_hidden')) { $form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />'); }
- $.get($form.attr('action'), $form.serialize() + "&submit_search=" + $("#buttonGo").val(), function(data) { - $("#searchresults").html(data); - }) // end $.get() + $.post($form.attr('action'), $form.serialize() + "&submit_search=" + $("#buttonGo").val(), function(response) { + if (typeof response == 'string') { + // found results + $("#searchresults").html(response); + $("#sqlqueryresults").trigger('appendAnchor'); + $('#db_search_form') + // workaround for Chrome problem (bug #3168569) + .slideToggle() + .hide(); + $('#togglesearchformlink') + // always start with the Show message + .text(PMA_messages['strShowSearchCriteria']) + $('#togglesearchformdiv') + // now it's time to show the div containing the link + .show(); + } else { + // error message (zero rows) + $("#sqlqueryresults").html(response['message']); + } + }) }) }, 'top.frame_content'); // end $(document).ready()
hooks/post-receive