Ticket #15897: garyc40-15897.patch
| File garyc40-15897.patch, 9.1 KB (added by garyc40, 2 years ago) |
|---|
-
wp-admin/admin-ajax.php
diff --git wp-admin/admin-ajax.php wp-admin/admin-ajax.php index 5eb33e1..c740291 100644
case 'replyto-comment' : 661 661 $comment_id = wp_new_comment( $commentdata ); 662 662 $comment = get_comment($comment_id); 663 663 if ( ! $comment ) die('1'); 664 664 665 $parent = get_comment( $comment_parent ); 666 if ( ! $parent->comment_approved && ! wp_update_comment( array( 'comment_ID' => $comment_parent, 'comment_approved' => 'approve' ) ) ) { 667 die('1'); 668 } 665 669 $position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1'; 666 670 667 671 $x = new WP_Ajax_Response(); -
wp-admin/css/wp-admin.dev.css
diff --git wp-admin/css/wp-admin.dev.css wp-admin/css/wp-admin.dev.css index 1781101..0ffe20a 100644
table.fixed { 1373 1373 #comments-form .fixed .column-author { 1374 1374 width: 20%; 1375 1375 } 1376 .comments tr.focus th, .comments tr.focus td { 1377 border-top-width:1px; 1378 border-top-style:solid; 1379 } 1380 1381 .comments tr.blur th, .comments tr.blur td { 1382 border-bottom-width:0; 1383 } 1376 1384 #commentsdiv.postbox .inside { 1377 1385 line-height:1.4em; 1378 1386 margin:0; … … span.imgedit-scale-warn { 3536 3544 } 3537 3545 3538 3546 .spam-undo-inside .avatar, 3539 .trash-undo-inside .avatar { 3547 .trash-undo-inside .avatar, 3548 .replied-approved-notice-inside .avatar { 3540 3549 height: 20px; 3541 3550 width: 20px; 3542 3551 margin-right: 8px; -
wp-admin/includes/template.php
diff --git wp-admin/includes/template.php wp-admin/includes/template.php index 5f5c1c3..7af5c66 100644
function wp_comment_trashnotice() { 408 408 <div class="hidden" id="spam-undo-holder"> 409 409 <div class="spam-undo-inside"><?php printf(__('Comment by %s marked as spam.'), '<strong></strong>'); ?> <span class="undo unspam"><a href="#"><?php _e('Undo'); ?></a></span></div> 410 410 </div> 411 <div class="hidden" id="replied-approved-notice"> 412 <div class="replied-approved-notice-inside"><?php printf(__('Comment by %s replied to and approved.'), '<strong></strong>'); ?></div> 413 </div> 411 414 <?php 412 415 } 413 416 -
wp-admin/js/edit-comments.dev.js
diff --git wp-admin/js/edit-comments.dev.js wp-admin/js/edit-comments.dev.js index 177dc86..3f29a56 100644
1 var theList, theExtraList, toggleWithKeyboard = false ;1 var theList, theExtraList, toggleWithKeyboard = false, commentReply, setCommentsList; 2 2 (function($) { 3 3 4 4 setCommentsList = function() { … … setCommentsList = function() { 12 12 var c = $('#' + settings.element); 13 13 14 14 if ( c.is('.unapproved') ) 15 c.find('div.comment_status').html('0') 15 c.find('div.comment_status').html('0'); 16 16 else 17 c.find('div.comment_status').html('1') 17 c.find('div.comment_status').html('1'); 18 18 19 19 $('span.pending-count').each( function() { 20 20 var a = $(this), n, dif; … … setCommentsList = function() { 80 80 return false; 81 81 }); 82 82 } 83 84 83 return settings; 85 84 }; 86 85 … … setCommentsList = function() { 209 208 return; 210 209 } 211 210 212 theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() ); 213 214 refillTheExtraList(); 211 refillTheList(); 215 212 }; 216 213 217 214 var refillTheExtraList = function(ev) { 218 215 var args = $.query.get(), total_pages = listTable.get_total_pages(), per_page = $('input[name=_per_page]', '#comments-form').val(); 219 216 220 217 if (args.paged > total_pages) { 221 218 return; 222 219 } … … setCommentsList = function() { 237 234 theExtraList.get(0).wpList.add( response.rows ); 238 235 }); 239 236 }; 237 238 var refillTheList = function() { 239 theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() ); 240 241 refillTheExtraList(); 242 } 240 243 241 244 theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } ); 242 245 theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } ) … … setCommentsList = function() { 247 250 $('#undo-' + id).fadeIn(300, function(){ $(this).show() }); 248 251 }); 249 252 $(listTable).bind('changePage', refillTheExtraList); 253 $(commentReply).bind('repliedAndApproved', refillTheList); 250 254 }; 251 255 252 256 commentReply = { 253 257 cid : '', 254 258 act : '', 259 260 showOverlay : function(id) { 261 var c = $('#comment-' + id), 262 excluded = c.find('td, th').css('opacity', 1).add('td, th', '#replyrow'); 263 listTable.$tbody.find('td, th').not(excluded).animate({opacity:'0.2'}, 300); 264 c.addClass('focus'); 265 c.prev().addClass('blur'); 266 }, 267 268 hideOverlay : function() { 269 listTable.$tbody. 270 find('.blur').removeClass('blur').end(). 271 find('.focus').removeClass('focus'); 272 }, 255 273 256 274 init : function() { 257 275 var row = $('#replyrow'); … … commentReply = { 300 318 301 319 if ( $('#the-comment-list #replyrow').length < 1 ) 302 320 return false; 321 322 listTable.$tbody.find('th, td').animate({opacity : 1}, 300); 303 323 304 324 $('#replyrow').fadeOut('fast', function(){ 305 325 commentReply.close(); … … commentReply = { 323 343 $('input', '#edithead').val(''); 324 344 $('.error', '#replysubmit').html('').hide(); 325 345 $('.waiting', '#replysubmit').hide(); 346 this.hideOverlay(); 326 347 327 348 if ( $.browser.msie ) 328 349 $('#replycontainer, #replycontent').css('height', '120px'); … … commentReply = { 334 355 }, 335 356 336 357 open : function(id, p, a) { 337 var t = this, editRow, rowData, act, h, c = $('#comment-' + id) ;358 var t = this, editRow, rowData, act, h, c = $('#comment-' + id), replyButton; 338 359 t.close(); 339 360 t.cid = id; 340 361 … … commentReply = { 345 366 $('#action', editRow).val(act); 346 367 $('#comment_post_ID', editRow).val(p); 347 368 $('#comment_ID', editRow).val(id); 348 369 t.showOverlay(id); 370 349 371 if ( a == 'edit' ) { 350 372 $('#author', editRow).val( $('div.author', rowData).text() ); 351 373 $('#author-email', editRow).val( $('div.author-email', rowData).text() ); … … commentReply = { 366 388 $('#replyrow').fadeIn(300, function(){ $(this).show() }); 367 389 }); 368 390 } else { 391 replyButton = $('#replybtn', editRow); 369 392 $('#edithead, #savebtn', editRow).hide(); 370 393 $('#replyhead, #replybtn', editRow).show(); 371 394 c.after(editRow); 395 if (c.hasClass('unapproved')) { 396 replyButton.text(adminCommentsL10n.replyApprove); 397 } else { 398 replyButton.text(adminCommentsL10n.reply); 399 } 372 400 $('#replyrow').fadeIn(300, function(){ $(this).show() }); 373 401 } 374 402 … … commentReply = { 406 434 }, 407 435 408 436 send : function() { 409 var post = {} ;437 var post = {}, c; 410 438 411 439 $('#replysubmit .error').hide(); 412 440 $('#replysubmit .waiting').show(); … … commentReply = { 419 447 post.id = post.comment_post_ID; 420 448 post.comments_listing = this.comments_listing; 421 449 post.p = $('[name=p]').val(); 422 450 c = $('#comment-' + post.comment_ID); 423 451 $.ajax({ 424 452 type : 'POST', 425 453 url : ajaxurl, 426 454 data : post, 427 success : function(x) { commentReply.show(x); }, 455 success : function(x) { 456 var is_moderated = commentReply.comments_listing == 'moderated', id, note, n, h, author; 457 if (is_moderated) { 458 id = c.attr('id').replace(/[^0-9]+/g, ''); 459 note = $('#replied-approved-notice').html(); 460 461 c.find('.check-column :checkbox').attr('checked', ''); 462 463 if ( c.is('tr') ) { 464 n = c.children(':visible').length; 465 author = $('.author strong', c).text(); 466 h = $('<tr id="replied-approved-' + id + '" class="undo" style="display:none;"><td colspan="' + n + '">' + note + '</td></tr>'); 467 } else { 468 author = $('.comment-author', c).text(); 469 h = $('<div id="replied-approved-' + id + '" style="display:none;" class="undo">' + note + '</div>'); 470 } 471 c.before(h); 472 $('strong', '#replied-approved-' + id).text(author + ' '); 473 $('.avatar', c).clone().prependTo('#replied-approved-' + id + ' .replied-approved-notice-inside'); 474 475 c.fadeOut(350, function(){ h.fadeIn(350); }); 476 commentReply.revert(); 477 $(commentReply).trigger('repliedAndApproved'); 478 return; 479 } 480 481 if (c.hasClass('unapproved')) { 482 c.removeClass('unapproved').addClass('approved'); 483 c.find('div.comment_status').html('1'); 484 } 485 486 commentReply.show(x); 487 }, 428 488 error : function(r) { commentReply.error(r); } 429 489 }); 430 490 -
wp-includes/js/wp-lists.dev.js
diff --git wp-includes/js/wp-lists.dev.js wp-includes/js/wp-lists.dev.js index d425931..a8d32f8 100644
wpList = { 142 142 if ( !s.data._ajax_nonce ) { return true; } 143 143 144 144 element = $('#' + s.element); 145 146 145 if ( 'none' != s.delColor ) { 147 146 element.css( 'backgroundColor', s.delColor ).fadeOut( 350, function(){ 148 147 list.wpList.recolor(); -
wp-includes/script-loader.php
diff --git wp-includes/script-loader.php wp-includes/script-loader.php index 706fd0a..0df59e4 100644
function wp_default_scripts( &$scripts ) { 316 316 $scripts->add_data( 'admin-comments', 'group', 1 ); 317 317 $scripts->localize( 'admin-comments', 'adminCommentsL10n', array( 318 318 'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']), 319 'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last']) 319 'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last']), 320 'replyApprove' => __( 'Approve and Reply' ), 321 'reply' => __( 'Reply' ), 320 322 ) ); 321 323 322 324 $scripts->add( 'xfn', "/wp-admin/js/xfn$suffix.js", array('jquery'), '20100403' );
