diff --git a/wp-admin/js/edit-comments.js b/wp-admin/js/edit-comments.js index cf00e39b8..0fa09ed31 100644 --- a/wp-admin/js/edit-comments.js +++ b/wp-admin/js/edit-comments.js @@ -235,8 +235,23 @@ commentReply = { $(document).ready(function(){ if ( typeof QTags != 'undefined' ) ed_reply = new QTags('ed_reply', 'replycontent', 'replycontainer', 'more'); - if ( typeof $.table_hotkeys != 'undefined' ) - $.table_hotkeys($('table.widefat'), ['a', 'u', 's', 'd', 'r']); + if ( typeof $.table_hotkeys != 'undefined' ) { + var make_hotkeys_redirect = function(which) { + return function() { + var first_last = 'next' == which? 'first' : 'last'; + var l=$('.'+which+'.page-numbers'); + if (l.length) + window.location = l[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g, '')+'&hotkeys_highlight_'+first_last+'=1'; + } + } + $.table_hotkeys($('table.widefat'), ['a', 'u', 's', 'd', 'r'], + { highlight_first: adminCommentsL10n.hotkeys_highlight_first, + highlight_last: adminCommentsL10n.hotkeys_highlight_last, + prev_page_link_cb: make_hotkeys_redirect('prev'), + next_page_link_cb: make_hotkeys_redirect('next'), + } + ); + } }); -})(jQuery); +})(jQuery); \ No newline at end of file diff --git a/wp-includes/js/jquery/jquery.table-hotkeys.js b/wp-includes/js/jquery/jquery.table-hotkeys.js index 4045c7ac6..8ff517a5e 100644 --- a/wp-includes/js/jquery/jquery.table-hotkeys.js +++ b/wp-includes/js/jquery/jquery.table-hotkeys.js @@ -1,45 +1,66 @@ (function($){ + $.fn.filter_visible = function(depth) { + depth = depth || 3; + var is_visible = function() { + var p = $(this); + for(i=0; iadd( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists', 'jquery-ui-draggable', 'jquery-ui-resizable', 'quicktags'), '20080828' ); $scripts->localize( 'admin-comments', 'adminCommentsL10n', array( - 'pending' => __('%i% pending') // must look like: "# blah blah" + 'pending' => __('%i% pending'), // must look like: "# blah blah" + 'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']), + 'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last']), ) ); $scripts->add( 'admin-users', '/wp-admin/js/users.js', array('wp-lists'), '20070823' ); $scripts->add( 'admin-forms', '/wp-admin/js/forms.js', array('jquery'), '20080729');