Changeset 7236
- Timestamp:
- 03/11/2008 08:55:57 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/js/edit-comments.js
r7200 r7236 5 5 $('li span.comment-count').each( function() { 6 6 var a = $(this); 7 var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 ); 7 var n = parseInt(a.html(),10); 8 n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 ); 9 if ( n < 0 ) { n = 0; } 8 10 a.html( n.toString() ); 11 $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); 9 12 }); 10 13 $('.post-com-count span.comment-count').each( function() { … … 19 22 t = t - 1; 20 23 } 24 if ( n < 0 ) { n = 0; } 25 if ( t < 0 ) { t = 0; } 21 26 if ( t >= 0 ) { a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) ); } 22 27 if ( 0 === t ) { a.parents('strong:first').replaceWith( a.parents('strong:first').html() ); } … … 28 33 $('li span.comment-count').each( function() { 29 34 var a = $(this); 30 if ( parseInt(a.html(),10) < 1 ) { return; } 31 // on ?edit-comments.php?comment_status=moderated tab 32 // or the comment is unapproved 33 if ( a.parent('.current').size() || $('#' + settings.element).is('.unapproved') ) { 34 var n = parseInt(a.html(),10) - 1; 35 a.html( n.toString() ); 36 ( 0 < n ) ? $('#awaiting-mod').each(function() { $(this).show(); $(this).removeClass('count-0') }) : $('#awaiting-mod').hide(); 37 } 35 var n = parseInt(a.html(),10); 36 n = n + ( $('#' + settings.element).is('.unapproved') ? -1 : 1 ); 37 if ( n < 0 ) { n = 0; } 38 a.html( n.toString() ); 39 $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); 38 40 }); 39 41 $('.post-com-count span.comment-count').each( function() { -
trunk/wp-includes/script-loader.php
r7227 r7236 123 123 'strong' => __('Strong') 124 124 ) ); 125 $this->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists'), '200803 04' );125 $this->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists'), '20080311' ); 126 126 $this->localize( 'admin-comments', 'adminCommentsL10n', array( 127 127 'pending' => __('%i% pending') // must look like: "# blah blah"
Note: See TracChangeset
for help on using the changeset viewer.