Fix comment action links after quick editing and reloading of page on enter while quick editing.
git-svn-id: http://svn.automattic.com/wordpress/trunk@10349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1c9353ad2e
commit
598f966edc
|
@ -672,6 +672,7 @@ case 'edit-comment' :
|
||||||
$mode = ( isset($_POST['mode']) && 'single' == $_POST['mode'] ) ? 'single' : 'detail';
|
$mode = ( isset($_POST['mode']) && 'single' == $_POST['mode'] ) ? 'single' : 'detail';
|
||||||
$position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
|
$position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
|
||||||
$checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
|
$checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
|
||||||
|
$comments_listing = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';
|
||||||
|
|
||||||
if ( get_option('show_avatars') && 'single' != $mode )
|
if ( get_option('show_avatars') && 'single' != $mode )
|
||||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
add_filter( 'comment_author', 'floated_admin_avatar' );
|
||||||
|
@ -679,7 +680,7 @@ case 'edit-comment' :
|
||||||
$x = new WP_Ajax_Response();
|
$x = new WP_Ajax_Response();
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
_wp_comment_row( $comment_id, $mode, true, $checkbox );
|
_wp_comment_row( $comment_id, $mode, $comments_listing, $checkbox );
|
||||||
$comment_list_item = ob_get_contents();
|
$comment_list_item = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
|
||||||
|
|
|
@ -1287,7 +1287,9 @@ table.diff .diff-addedline ins {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* table vim shortcuts */
|
/* table vim shortcuts */
|
||||||
.vim-current {
|
.vim-current,
|
||||||
|
.vim-current th,
|
||||||
|
.vim-current td {
|
||||||
background-color: #E4F2FD !important;
|
background-color: #E4F2FD !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1287,7 +1287,9 @@ table.diff .diff-addedline ins {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* table vim shortcuts */
|
/* table vim shortcuts */
|
||||||
.vim-current {
|
.vim-current,
|
||||||
|
.vim-current th,
|
||||||
|
.vim-current td {
|
||||||
background-color: #E4F2FD !important;
|
background-color: #E4F2FD !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,14 @@ commentReply = {
|
||||||
var row = $('#replyrow');
|
var row = $('#replyrow');
|
||||||
|
|
||||||
$('a.cancel', row).click(function() { return commentReply.revert(); });
|
$('a.cancel', row).click(function() { return commentReply.revert(); });
|
||||||
$('a.save', row).click(function() { return commentReply.send(this); });
|
$('a.save', row).click(function() { return commentReply.send(); });
|
||||||
|
$('input#author, input#author-email, input#author-url', row).keypress(function(e){
|
||||||
|
if ( e.which == 13 ) {
|
||||||
|
commentReply.send();
|
||||||
|
e.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// add events
|
// add events
|
||||||
$('#the-comment-list .column-comment > p').dblclick(function(){
|
$('#the-comment-list .column-comment > p').dblclick(function(){
|
||||||
|
@ -150,6 +157,8 @@ commentReply = {
|
||||||
commentReply.close();
|
commentReply.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.comments_listing = $('#comments-form > input[name="comment_status"]').val() || '';
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
addEvents : function(r) {
|
addEvents : function(r) {
|
||||||
|
@ -272,6 +281,7 @@ commentReply = {
|
||||||
|
|
||||||
post.content = $('#replycontent').val();
|
post.content = $('#replycontent').val();
|
||||||
post.id = post.comment_post_ID;
|
post.id = post.comment_post_ID;
|
||||||
|
post.comments_listing = this.comments_listing;
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : 'POST',
|
type : 'POST',
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -183,7 +183,7 @@ function wp_default_scripts( &$scripts ) {
|
||||||
'l10n_print_after' => 'try{convertEntities(pwsL10n);}catch(e){};'
|
'l10n_print_after' => 'try{convertEntities(pwsL10n);}catch(e){};'
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090102' );
|
$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20090112' );
|
||||||
$scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
|
$scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
|
||||||
'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
|
'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
|
||||||
'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last'])
|
'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last'])
|
||||||
|
|
Loading…
Reference in New Issue