Ticket #11200: 11200.diff
File 11200.diff, 3.1 KB (added by , 15 years ago) |
---|
-
wp-admin/edit-comments.php
154 154 <?php 155 155 $status_links = array(); 156 156 $num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments(); 157 //, number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"), 158 //, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>") 157 159 158 $stati = array( 160 159 'all' => _n_noop('All', 'All'), // singular not used 160 'approved' => _n_noop('Approved <span class="count">(<span class="approved-count">%s</span>)</span>', 'Approved <span class="count">(<span class="approved-count">%s</span>)</span>'), 161 161 'moderated' => _n_noop('Pending <span class="count">(<span class="pending-count">%s</span>)</span>', 'Pending <span class="count">(<span class="pending-count">%s</span>)</span>'), 162 'approved' => _n_noop('Approved', 'Approved'), // singular not used163 162 'spam' => _n_noop('Spam <span class="count">(<span class="spam-count">%s</span>)</span>', 'Spam <span class="count">(<span class="spam-count">%s</span>)</span>'), 164 163 'trash' => _n_noop('Trash <span class="count">(<span class="trash-count">%s</span>)</span>', 'Trash <span class="count">(<span class="trash-count">%s</span>)</span>') 165 164 ); -
wp-admin/js/edit-comments.dev.js
141 141 142 142 // In admin-ajax.php, we send back the unix time stamp instead of 1 on success 143 143 delAfter = function( r, settings ) { 144 var total, pageLinks, N, untrash = $(settings.target).parent().is('span.untrash'), spam, trash;144 var total, appr, pageLinks, N, spam, trash, untrash, unapproved; 145 145 146 146 function getUpdate(s) { 147 147 if ( $(settings.target).parent().is('span.' + s) ) 148 148 return 1; 149 else if ( $('#' + settings.element).is('.' + s) ) 149 150 if ( $('#' + settings.element).is('.' + s) ) 150 151 return -1; 151 152 152 153 return 0; 153 154 } 155 156 appr = $('span.approved-count'); 157 apprN = getCount(appr); 154 158 spam = getUpdate('spam'); 155 159 trash = getUpdate('trash'); 160 untrash = $(settings.target).parent().is('span.untrash'); 161 unapproved = $('#' + settings.element).is('.unapproved'); 156 162 157 163 if ( untrash ) 158 164 trash = -1; 159 165 160 166 $('span.pending-count').each( function() { 161 var a = $(this), n = getCount(a) , unapproved = $('#' + settings.element).is('.unapproved');167 var a = $(this), n = getCount(a); 162 168 163 169 if ( $(settings.target).parent().is('span.unapprove') || ( untrash && unapproved ) ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove" 164 170 n = n + 1; 171 updateCount(appr, apprN-1); 165 172 } else if ( unapproved ) { // we deleted a formerly unapproved comment 166 173 n = n - 1; 174 updateCount(appr, apprN+1); 167 175 } 168 176 if ( n < 0 ) { n = 0; } 169 177 a.closest('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');