[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_7-10224-g8f25462

Marc Delisle lem9 at users.sourceforge.net
Sun Sep 19 18:29:05 CEST 2010


The branch, master has been updated
       via  8f2546271cff3a91434cefbc77f9cf56d5e42168 (commit)
      from  3159d9086707b9a84fe706b3a411deec8ce67bf2 (commit)


- Log -----------------------------------------------------------------
commit 8f2546271cff3a91434cefbc77f9cf56d5e42168
Author: Marc Delisle <marc at infomarc.info>
Date:   Sun Sep 19 12:28:14 2010 -0400

    display message when search returns zero rows

-----------------------------------------------------------------------

Summary of changes:
 js/tbl_select.js |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/js/tbl_select.js b/js/tbl_select.js
index 95c60a8..f7bd272 100644
--- a/js/tbl_select.js
+++ b/js/tbl_select.js
@@ -1,3 +1,4 @@
+/* vim: set expandtab sw=4 ts=4 sts=4: */
 /**
  * @fileoverview JavaScript functions used on tbl_select.php
  *
@@ -27,17 +28,25 @@ $(document).ready(function() {
      * @uses    PMA_ajaxShowMessage()
      */
     $("#tbl_search_form").live('submit', function(event) {
+        // jQuery object to reuse
+        $search_form = $(this);
         event.preventDefault();
 
         PMA_ajaxShowMessage(PMA_messages['strSearching']);
 
-	// add this hidden field just once 
-	if (! $(this).find('input:hidden').is('#ajax_request_hidden')) {
-        	$(this).append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
-	}
+	    // add this hidden field just once 
+	    if (! $search_form.find('input:hidden').is('#ajax_request_hidden')) {
+        	$search_form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
+	    }
 
-        $.post($(this).attr('action'), $(this).serialize(), function(data) {
-            $("#searchresults").html(data);
+        $.post($search_form.attr('action'), $search_form.serialize(), function(response) {
+            if (typeof response == 'string') {
+                // found results
+                $("#searchresults").html(response);
+            } else {
+                // error message (zero rows)
+                $("#searchresults").html(response['message']);
+            }
         })
     })
 }, 'top.frame_content'); // end $(document).ready()


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list