Ticket #13363: garyc40-13363.patch
File garyc40-13363.patch, 10.0 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 fccbed6..cf0ca7a 100644
a, 494 494 #poststuff #edButtonPreview, 495 495 #poststuff #edButtonHTML, 496 496 #the-comment-list p.comment-author strong a, 497 #the-comment-list .undo .approve a, 498 #the-comment-list .undo .unapprove a, 497 499 #media-upload a.del-link, 498 500 #media-items a.delete, 499 501 .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 1781101..c87008d 100644
span.imgedit-scale-warn { 3529 3529 border-right-width: 1px; 3530 3530 } 3531 3531 3532 .trash-undo-inside, 3533 .spam-undo-inside { 3532 .undo-inside { 3534 3533 margin: 1px 8px 1px 0; 3535 3534 line-height: 16px; 3536 3535 } 3537 3536 3538 .spam-undo-inside .avatar, 3539 .trash-undo-inside .avatar { 3537 .undo-inside .avatar { 3540 3538 height: 20px; 3541 3539 width: 20px; 3542 3540 margin-right: 8px; 3543 3541 vertical-align: middle; 3544 3542 } 3545 3543 3544 .undo-inside .approve { 3545 display:inline; 3546 } 3547 3546 3548 .stuffbox .editcomment { 3547 3549 clear: none; 3548 3550 } -
wp-admin/includes/template.php
diff --git wp-admin/includes/template.php wp-admin/includes/template.php index 5f5c1c3..a1bc7d5 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 177dc86..5e178a2 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 = $('.tablenav input[name="_total"]', '#comments-form'); 8 8 perPageInput = $('.tablenav input[name="_per_page"]', '#comments-form'); 9 9 pageInput = $('.tablenav input[name="_page"]', '#comments-form'); 10 10 11 dimAfter = function( r, settings ) { 12 var c = $('#' + settings.element); 13 14 if ( c.is('.unapproved') ) 15 c.find('div.comment_status').html('0') 16 else 17 c.find('div.comment_status').html('1') 18 19 $('span.pending-count').each( function() { 20 var a = $(this), n, dif; 21 n = a.html().replace(/[^0-9]+/g, ''); 22 n = parseInt(n,10); 23 if ( isNaN(n) ) return; 24 dif = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1; 25 n = n + dif; 26 if ( n < 0 ) { n = 0; } 27 a.closest('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); 28 updateCount(a, n); 29 dashboardTotals(); 30 }); 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; 31 45 }; 32 46 33 // Send current total, page, per_page and url 34 delBefore = function( settings, list ) { 35 var cl = $(settings.target).attr('className'), id, el, n, h, a, author, action = false; 36 37 settings.data._total = totalInput.val() || 0; 38 settings.data._per_page = perPageInput.val() || 0; 39 settings.data._page = pageInput.val() || 0; 40 settings.data._url = document.location.href; 41 42 if ( cl.indexOf(':trash=1') != -1 ) 43 action = 'trash'; 44 else if ( cl.indexOf(':spam=1') != -1 ) 45 action = 'spam'; 46 47 if ( action ) { 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 ) { 48 53 id = cl.replace(/.*?comment-([0-9]+).*/, '$1'); 49 54 el = $('#comment-' + id); 50 note = $('#' + action + '-undo-holder').html();55 note = $('#' + params.action + '-undo-holder').html(); 51 56 52 57 el.find('.check-column :checkbox').attr('checked', ''); // Uncheck the row so as not to be affected by Bulk Edits. 53 58 54 if ( el.siblings('#replyrow').length && commentReply.cid == id ) 59 if ( el.siblings('#replyrow').length && commentReply.cid == id ) { 55 60 commentReply.close(); 61 } 56 62 57 63 if ( el.is('tr') ) { 58 64 n = el.children(':visible').length; 59 65 author = $('.author strong', el).text(); 60 h = $('<tr id="undo-' + id + '" class="undo un' + action + '" style="display:none;"><td colspan="' + n + '">' + note + '</td></tr>');66 h = $('<tr id="undo-' + id + '" class="undo ' + params.undoAction + '" style="display:none;"><td colspan="' + n + '">' + note + '</td></tr>'); 61 67 } else { 62 68 author = $('.comment-author', el).text(); 63 h = $('<div id="undo-' + id + '" style="display:none;" class="undo un' + action + '">' + note + '</div>');69 h = $('<div id="undo-' + id + '" style="display:none;" class="undo ' + params.undoAction + '">' + note + '</div>'); 64 70 } 65 71 66 72 el.before(h); 67 73 68 74 $('strong', '#undo-' + id).text(author + ' '); 69 75 a = $('.undo a', '#undo-' + id); 70 a.attr('href', 'comment.php?action= un' + action + 'comment&c=' + id + '&_wpnonce=' + settings.data._ajax_nonce);71 a.attr('className', 'delete:the-comment-list:comment-' + id + ': :un' + action + '=1vim-z vim-destructive');72 $('.avatar', el).clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside');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'); 73 79 74 80 a.click(function(){ 75 81 list.wpList.del(this); 76 82 $('#undo-' + id).css( {backgroundColor:'#ceb'} ).fadeOut(350, function(){ 77 83 $(this).remove(); 78 $('#comment-' + id).css('backgroundColor', '').fadeIn(300 , function(){ $(this).show() });84 $('#comment-' + id).css('backgroundColor', '').fadeIn(300); 79 85 }); 80 86 return false; 81 87 }); 82 88 } 89 }; 90 91 dimAfter = function( r, settings ) { 92 var c = $('#' + settings.element); 93 94 if ( c.is('.unapproved') ) 95 c.find('div.comment_status').html('0'); 96 else 97 c.find('div.comment_status').html('1'); 83 98 99 $('span.pending-count').each( function() { 100 var a = $(this), n, dif; 101 n = a.html().replace(/[^0-9]+/g, ''); 102 n = parseInt(n,10); 103 if ( isNaN(n) ) return; 104 dif = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1; 105 n = n + dif; 106 if ( n < 0 ) { n = 0; } 107 a.closest('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); 108 updateCount(a, n); 109 dashboardTotals(); 110 }); 111 }; 112 113 // Send current total, page, per_page and url 114 delBefore = function( settings, list ) { 115 var cl = $(settings.target).attr('className'), id, el, n, h, a, author, action = false; 116 117 settings.data._total = totalInput.val() || 0; 118 settings.data._per_page = perPageInput.val() || 0; 119 settings.data._page = pageInput.val() || 0; 120 settings.data._url = document.location.href; 121 122 if (! $(settings.target).parent().hasClass('undo')) { 123 showUndo(settings, list); 124 } 125 84 126 return settings; 85 127 }; 86 128 … … setCommentsList = function() { 159 201 spam = -1; 160 202 161 203 $('span.pending-count').each( function() { 162 var a = $(this), n = getCount(a), unapproved = $('#' + settings.element).is('.unapproved') ;204 var a = $(this), n = getCount(a), unapproved = $('#' + settings.element).is('.unapproved') || $(settings.target).parent().is('span.approve'); 163 205 164 206 if ( $(settings.target).parent().is('span.unapprove') || ( ( untrash || unspam ) && unapproved ) ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove" 165 207 n = n + 1; … … setCommentsList = function() { 243 285 .bind('wpListDelEnd', function(e, s){ 244 286 var id = s.element.replace(/[^0-9]+/g, ''); 245 287 246 if ( s.target.className.indexOf(':trash=1') != -1 || s.target.className.indexOf(':spam=1') != -1)288 if ( getActionFromClass(s.target.className) ) 247 289 $('#undo-' + id).fadeIn(300, function(){ $(this).show() }); 248 290 }); 249 291 $(listTable).bind('changePage', refillTheExtraList);