Fix Shift-X toggling of comments on Edit Comments

git-svn-id: https://develop.svn.wordpress.org/trunk@10063 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2008-12-05 07:15:31 +00:00
parent ca3acca0fb
commit 0c1161d915
3 changed files with 16 additions and 10 deletions

View File

@ -199,16 +199,21 @@ jQuery(document).ready( function($) {
lastClicked = this;
return true;
} );
$( 'thead :checkbox, tfoot :checkbox' ).click( function(e) {
var c = $(this).attr('checked');
$(this).parents( 'form:first' ).find( 'table tbody:visible, table thead:visible, table tfoot:visible').find( '.check-column :checkbox' ).attr( 'checked', function() {
if ( e.shiftKey )
var toggle = e.shiftKey || toggleWithKeyboard;
$(this).parents( 'form:first' ).find( 'table tbody:visible').find( '.check-column :checkbox' ).attr( 'checked', function() {
if ( toggle )
return $(this).attr( 'checked' ) ? '' : 'checked';
else if (c)
return 'checked';
return '';
});
$(this).parents( 'form:first' ).find( 'table thead:visible, table tfoot:visible').find( '.check-column :checkbox' ).attr( 'checked', function() {
if ( toggle )
return '';
else if (c)
return 'checked';
return '';
});
});

View File

@ -278,7 +278,7 @@ commentReply = {
}
};
toggleWithKeyboard = false;
$(document).ready(function(){
columns.init('edit-comments');
commentReply.init();
@ -299,9 +299,10 @@ $(document).ready(function(){
window.location = $('span.edit a', current_row).attr('href');
};
var toggle_all = function() {
toggleWithKeyboard = true;
var master_checkbox = $('form#comments-form .check-column :checkbox:first');
master_checkbox.attr('checked', master_checkbox.attr('checked')? '' : 'checked');
checkAll('form#comments-form');
master_checkbox.click().attr('checked', '');
toggleWithKeyboard = false;
}
var make_bulk = function(value) {
return function(event, _) {

View File

@ -41,7 +41,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->base_url = $guessurl;
$scripts->default_version = get_bloginfo( 'version' );
$scripts->add( 'common', '/wp-admin/js/common.js', array('jquery', 'hoverIntent'), '20081203' );
$scripts->add( 'common', '/wp-admin/js/common.js', array('jquery', 'hoverIntent'), '20081205' );
$scripts->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
$scripts->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '20081103' );
@ -156,7 +156,7 @@ function wp_default_scripts( &$scripts ) {
'good' => _c('Medium|password strength'),
'strong' => __('Strong')
) );
$scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20081124' );
$scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20081205' );
$scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last'])