[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_0BETA3-1580-g3400ddd

Marc Delisle lem9 at users.sourceforge.net
Tue Mar 1 14:10:33 CET 2011


The branch, master has been updated
       via  3400dddadd34963b0322646022cafb5855260d23 (commit)
       via  0d77b5084c517956adad1b3d8bc250ee6fad261b (commit)
      from  0c30ed069af362b0e703b8de71527b310db6bafa (commit)


- Log -----------------------------------------------------------------
commit 3400dddadd34963b0322646022cafb5855260d23
Author: Marc Delisle <marc at infomarc.info>
Date:   Tue Mar 1 08:08:40 2011 -0500

    Cache jQuery object to avoid unneeded DOM traversal

commit 0d77b5084c517956adad1b3d8bc250ee6fad261b
Author: Ravindra Nath kakarla <ravindhranath at users.sourceforge.net>
Date:   Tue Mar 1 08:04:09 2011 -0500

    Patch #3194824 Partial list of users and new users

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

Summary of changes:
 js/server_privileges.js |   34 ++++++++++++++++++++--------------
 server_privileges.php   |    2 +-
 2 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/js/server_privileges.js b/js/server_privileges.js
index 5fe8398..8160066 100644
--- a/js/server_privileges.js
+++ b/js/server_privileges.js
@@ -85,25 +85,31 @@ function appendNewUser(new_user_string, new_user_initial, new_user_initial_strin
     //Append the newly retrived user to the table now
 
     //Calculate the index for the new row
-    var curr_last_row = $("#usersForm").find('tbody').find('tr:last');
-    var curr_last_row_index_string = $(curr_last_row).find('input:checkbox').attr('id').match(/\d+/)[0];
+    var $curr_last_row = $("#usersForm").find('tbody').find('tr:last');
+    var $curr_first_row = $("#usersForm").find('tbody').find('tr:first');
+    var first_row_initial = $curr_first_row.find('label').html().substr(0, 1).toUpperCase();
+    var curr_shown_initial = $curr_last_row.find('label').html().substr(0, 1).toUpperCase();
+    var curr_last_row_index_string = $curr_last_row.find('input:checkbox').attr('id').match(/\d+/)[0];
     var curr_last_row_index = parseFloat(curr_last_row_index_string);
     var new_last_row_index = curr_last_row_index + 1;
     var new_last_row_id = 'checkbox_sel_users_' + new_last_row_index;
+    var is_show_all = (first_row_initial != curr_shown_initial) ? true : false;
 
     //Append to the table and set the id/names correctly
-    $(new_user_string)
-    .insertAfter($(curr_last_row))
-    .find('input:checkbox')
-    .attr('id', new_last_row_id)
-    .val(function() {
-        //the insert messes up the &27; part. let's fix it
-        return $(this).val().replace(/&/,'&');
-    })
-    .end()
-    .find('label')
-    .attr('for', new_last_row_id)
-    .end();
+    if((curr_shown_initial == new_user_initial) || is_show_all) {
+        $(new_user_string)
+        .insertAfter($curr_last_row)
+        .find('input:checkbox')
+        .attr('id', new_last_row_id)
+        .val(function() {
+            //the insert messes up the &27; part. let's fix it
+            return $(this).val().replace(/&/,'&');
+        })
+        .end()
+        .find('label')
+        .attr('for', new_last_row_id)
+        .end();
+    }
 
     //Let us sort the table alphabetically
     $("#usersForm").find('tbody').PMA_sort_table('label');
diff --git a/server_privileges.php b/server_privileges.php
index 499fea6..c863d12 100644
--- a/server_privileges.php
+++ b/server_privileges.php
@@ -1430,7 +1430,7 @@ if( $GLOBALS['is_ajax_request'] && !isset($_REQUEST['export']) && !isset($_REQUE
          */
         $new_user_initial = strtoupper(substr($username, 0, 1));
         $new_user_initial_string = '<a href="server_privileges.php?' . $GLOBALS['url_query'] . '&initial=' . $new_user_initial
-            .'>' . $new_user_initial . '</a>';
+            .'">' . $new_user_initial . '</a>';
         $extra_data['new_user_initial'] = $new_user_initial;
         $extra_data['new_user_initial_string'] = $new_user_initial_string;
     }


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list