2007-10-09 18:49:42 -04:00
|
|
|
var list; var extra;
|
|
|
|
jQuery(function($) {
|
2007-03-27 17:20:16 -04:00
|
|
|
|
2007-10-09 18:49:42 -04:00
|
|
|
var dimAfter = function( r, settings ) {
|
2008-01-29 11:43:20 -05:00
|
|
|
$('.comment-count span').each( function() {
|
2008-01-04 06:53:15 -05:00
|
|
|
var a = $(this);
|
2008-01-03 17:24:58 -05:00
|
|
|
var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
|
|
|
|
a.html( n.toString() );
|
|
|
|
});
|
2008-01-04 06:53:15 -05:00
|
|
|
// we need to do the opposite for this guy, TODO: update title
|
|
|
|
$('.post-com-count').each( function() {
|
|
|
|
var a = $(this);
|
|
|
|
var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? -1 : 1 );
|
|
|
|
a.html( n.toString() );
|
|
|
|
});
|
2007-10-09 18:49:42 -04:00
|
|
|
}
|
2007-03-27 17:20:16 -04:00
|
|
|
|
2007-10-09 18:49:42 -04:00
|
|
|
var delAfter = function( r, settings ) {
|
2008-01-29 11:43:20 -05:00
|
|
|
$('.comment-count span').each( function() {
|
2008-01-04 06:53:15 -05:00
|
|
|
var a = $(this);
|
2008-01-03 17:24:58 -05:00
|
|
|
if ( a.parent('.current').size() || $('#' + settings.element).is('.unapproved') && parseInt(a.html(),10) > 0 ) {
|
|
|
|
var n = parseInt(a.html(),10) - 1;
|
|
|
|
a.html( n.toString() );
|
|
|
|
}
|
|
|
|
});
|
2007-03-27 17:20:16 -04:00
|
|
|
|
2007-10-09 18:49:42 -04:00
|
|
|
if ( extra.size() == 0 || extra.children().size() == 0 ) {
|
|
|
|
return;
|
2006-06-06 00:14:04 -04:00
|
|
|
}
|
2007-03-27 17:20:16 -04:00
|
|
|
|
2007-10-09 18:49:42 -04:00
|
|
|
list[0].wpList.add( extra.children(':eq(0)').remove().clone() );
|
|
|
|
$('#get-extra-comments').submit();
|
|
|
|
}
|
|
|
|
|
|
|
|
extra = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
|
|
|
|
list = $('#the-comment-list').wpList( { dimAfter : dimAfter, delAfter : delAfter, addColor: 'none' } );
|
2006-06-06 00:14:04 -04:00
|
|
|
|
2007-10-09 18:49:42 -04:00
|
|
|
} );
|