Ticket #13363: 13363.2.diff
File 13363.2.diff, 9.2 KB (added by , 14 years ago) |
---|
-
wp-admin/css/colors-fresh.dev.css
diff --git wp-admin/css/colors-fresh.dev.css wp-admin/css/colors-fresh.dev.css index 6325917..2608e03 100644
a, 492 492 #poststuff #edButtonPreview, 493 493 #poststuff #edButtonHTML, 494 494 #the-comment-list p.comment-author strong a, 495 #the-comment-list .undo .approve a, 496 #the-comment-list .undo .unapprove a, 495 497 #media-upload a.del-link, 496 498 #media-items a.delete, 497 499 .plugins a.delete, -
wp-admin/css/wp-admin.dev.css
diff --git wp-admin/css/wp-admin.dev.css wp-admin/css/wp-admin.dev.css index 3165a5e..65a828d 100644
span.imgedit-scale-warn { 3535 3535 border-right-width: 1px; 3536 3536 } 3537 3537 3538 .trash-undo-inside, 3539 .spam-undo-inside { 3538 .undo-inside { 3540 3539 margin: 1px 8px 1px 0; 3541 3540 line-height: 16px; 3542 3541 } 3543 3542 3544 .spam-undo-inside .avatar, 3545 .trash-undo-inside .avatar { 3543 .undo-inside .avatar { 3546 3544 height: 20px; 3547 3545 width: 20px; 3548 3546 margin-right: 8px; 3549 3547 vertical-align: middle; 3550 3548 } 3551 3549 3550 .undo-inside .approve { 3551 display:inline; 3552 } 3553 3552 3554 .stuffbox .editcomment { 3553 3555 clear: none; 3554 3556 } -
wp-admin/includes/template.php
diff --git wp-admin/includes/template.php wp-admin/includes/template.php index b345c36..033894d 100644
function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single', 403 403 function wp_comment_trashnotice() { 404 404 ?> 405 405 <div class="hidden" id="trash-undo-holder"> 406 <div class="trash-undo-inside "><?php printf(__('Comment by %s moved to the trash.'), '<strong></strong>'); ?> <span class="undo untrash"><a href="#"><?php _e('Undo'); ?></a></span></div>406 <div class="trash-undo-inside undo-inside"><?php printf(__('Comment by %s moved to the trash.'), '<strong></strong>'); ?> <span class="undo untrash"><a href="#"><?php _e('Undo'); ?></a></span></div> 407 407 </div> 408 408 <div class="hidden" id="spam-undo-holder"> 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> 409 <div class="spam-undo-inside 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 </div> 411 <div class="hidden" id="approve-undo-holder"> 412 <div class="approve-undo-inside undo-inside"><?php printf(__('Comment by %s approved.'), '<strong></strong>'); ?> <span class="undo unapprove"><a href="#"><?php _e('Undo'); ?></a></span></div> 413 </div> 414 <div class="hidden" id="unapprove-undo-holder"> 415 <div class="unapprove-undo-inside undo-inside"><?php printf(__('Comment by %s unapproved.'), '<strong></strong>'); ?> <span class="undo approve"><a href="#"><?php _e('Undo'); ?></a></span></div> 410 416 </div> 411 417 <?php 412 418 } -
wp-admin/js/edit-comments.dev.js
diff --git wp-admin/js/edit-comments.dev.js wp-admin/js/edit-comments.dev.js index b81b397..019b82f 100644
var theList, theExtraList, toggleWithKeyboard = false; 2 2 (function($) { 3 3 4 4 setCommentsList = function() { 5 var totalInput, perPageInput, pageInput, lastConfidentTime = 0, dim After, delBefore, updateTotalCount, delAfter;5 var totalInput, perPageInput, pageInput, lastConfidentTime = 0, dimBefore, dimAfter, delBefore, updateTotalCount, delAfter, showUndo, getActionFromClass; 6 6 7 7 totalInput = $('input[name="_total"]', '#comments-form'); 8 8 perPageInput = $('input[name="_per_page"]', '#comments-form'); 9 9 pageInput = $('input[name="_page"]', '#comments-form'); 10 10 11 getActionFromClass = function(cl) { 12 var ret; 13 if ( cl.indexOf(':trash=1') != -1 ) { 14 ret = { 15 action : 'trash', 16 undoAction : 'untrash', 17 undoClass : ':untrash=1' 18 }; 19 } 20 else if ( cl.indexOf(':spam=1') != -1 ) { 21 ret = { 22 action : 'spam', 23 undoAction : 'unspam', 24 undoClass : ':unspam=1' 25 }; 26 } 27 else if ( cl.indexOf(':action=dim-comment&new=approved') != -1 ) { 28 ret = { 29 action : 'approve', 30 undoAction : 'unapprove', 31 undoClass : 'e7e7d3:action=dim-comment&new=unapproved' 32 }; 33 } 34 else if ( cl.indexOf(':action=dim-comment&new=unapproved') != -1 ) { 35 ret = { 36 action : 'unapprove', 37 undoAction : 'approve', 38 undoClass : 'e7e7d3:action=dim-comment&new=approved' 39 }; 40 } else { 41 return false; 42 } 43 44 return ret; 45 }; 46 47 showUndo = function(settings, list) { 48 var cl = $(settings.target).attr('className'), params = false, id, el, note, n, author, h, a, undoAction, undoClass; 49 50 params = getActionFromClass(cl); 51 52 if ( params ) { 53 id = cl.replace(/.*?comment-([0-9]+).*/, '$1'); 54 el = $('#comment-' + id); 55 note = $('#' + params.action + '-undo-holder').html(); 56 57 el.find('.check-column :checkbox').attr('checked', ''); // Uncheck the row so as not to be affected by Bulk Edits. 58 59 if ( el.siblings('#replyrow').length && commentReply.cid == id ) { 60 commentReply.close(); 61 } 62 63 if ( el.is('tr') ) { 64 n = el.children(':visible').length; 65 author = $('.author strong', el).text(); 66 h = $('<tr id="undo-' + id + '" class="undo ' + params.undoAction + '" style="display:none;"><td colspan="' + n + '">' + note + '</td></tr>'); 67 } else { 68 author = $('.comment-author', el).text(); 69 h = $('<div id="undo-' + id + '" style="display:none;" class="undo ' + params.undoAction + '">' + note + '</div>'); 70 } 71 72 el.before(h); 73 74 $('strong', '#undo-' + id).text(author + ' '); 75 a = $('.undo a', '#undo-' + id); 76 a.attr('href', 'comment.php?action=' + params.undoAction + 'comment&c=' + id + '&_wpnonce=' + settings.data._ajax_nonce); 77 a.attr('className', 'delete:the-comment-list:comment-' + id + ':' + params.undoClass + ' vim-z vim-destructive'); 78 $('.avatar', el).clone().prependTo('#undo-' + id + ' .' + params.action + '-undo-inside'); 79 80 a.click(function(){ 81 list.wpList.del(this); 82 $('#undo-' + id).css( {backgroundColor:'#ceb'} ).fadeOut(350, function(){ 83 $(this).remove(); 84 $('#comment-' + id).css('backgroundColor', '').fadeIn(300); 85 }); 86 return false; 87 }); 88 } 89 }; 90 11 91 dimAfter = function( r, settings ) { 12 92 var c = $('#' + settings.element); 13 93 14 94 if ( c.is('.unapproved') ) 15 c.find('div.comment_status').html('0') 95 c.find('div.comment_status').html('0'); 16 96 else 17 c.find('div.comment_status').html('1') 97 c.find('div.comment_status').html('1'); 18 98 19 99 $('span.pending-count').each( function() { 20 100 var a = $(this), n, dif; … … setCommentsList = function() { 40 120 settings.data._url = document.location.href; 41 121 settings.data.comment_status = $('input[name=comment_status]', '#comments-form').val(); 42 122 43 if ( cl.indexOf(':trash=1') != -1 ) 44 action = 'trash'; 45 else if ( cl.indexOf(':spam=1') != -1 ) 46 action = 'spam'; 47 48 if ( action ) { 49 id = cl.replace(/.*?comment-([0-9]+).*/, '$1'); 50 el = $('#comment-' + id); 51 note = $('#' + action + '-undo-holder').html(); 52 53 el.find('.check-column :checkbox').attr('checked', ''); // Uncheck the row so as not to be affected by Bulk Edits. 54 55 if ( el.siblings('#replyrow').length && commentReply.cid == id ) 56 commentReply.close(); 57 58 if ( el.is('tr') ) { 59 n = el.children(':visible').length; 60 author = $('.author strong', el).text(); 61 h = $('<tr id="undo-' + id + '" class="undo un' + action + '" style="display:none;"><td colspan="' + n + '">' + note + '</td></tr>'); 62 } else { 63 author = $('.comment-author', el).text(); 64 h = $('<div id="undo-' + id + '" style="display:none;" class="undo un' + action + '">' + note + '</div>'); 65 } 66 67 el.before(h); 68 69 $('strong', '#undo-' + id).text(author + ' '); 70 a = $('.undo a', '#undo-' + id); 71 a.attr('href', 'comment.php?action=un' + action + 'comment&c=' + id + '&_wpnonce=' + settings.data._ajax_nonce); 72 a.attr('className', 'delete:the-comment-list:comment-' + id + '::un' + action + '=1 vim-z vim-destructive'); 73 $('.avatar', el).clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside'); 74 75 a.click(function(){ 76 list.wpList.del(this); 77 $('#undo-' + id).css( {backgroundColor:'#ceb'} ).fadeOut(350, function(){ 78 $(this).remove(); 79 $('#comment-' + id).css('backgroundColor', '').fadeIn(300, function(){ $(this).show() }); 80 }); 81 return false; 82 }); 123 if (! $(settings.target).parent().hasClass('undo')) { 124 showUndo(settings, list); 83 125 } 84 126 85 127 return settings; 86 128 }; 87 129 … … setCommentsList = function() { 160 202 spam = -1; 161 203 162 204 $('span.pending-count').each( function() { 163 var a = $(this), n = getCount(a), unapproved = $('#' + settings.element).is('.unapproved') ;205 var a = $(this), n = getCount(a), unapproved = $('#' + settings.element).is('.unapproved') || $(settings.target).parent().is('span.approve'); 164 206 165 207 if ( $(settings.target).parent().is('span.unapprove') || ( ( untrash || unspam ) && unapproved ) ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove" 166 208 n = n + 1; … … setCommentsList = function() { 264 306 .bind('wpListDelEnd', function(e, s){ 265 307 var id = s.element.replace(/[^0-9]+/g, ''); 266 308 267 if ( s.target.className.indexOf(':trash=1') != -1 || s.target.className.indexOf(':spam=1') != -1)309 if ( getActionFromClass(s.target.className) ) 268 310 $('#undo-' + id).fadeIn(300, function(){ $(this).show() }); 269 311 }); 270 312 // $(listTable).bind('changePage', refillTheExtraList);