2007-10-10 00:49:42 +02:00
|
|
|
var list; var extra;
|
|
|
|
jQuery(function($) {
|
2007-03-27 23:20:16 +02:00
|
|
|
|
2007-10-10 00:49:42 +02:00
|
|
|
var dimAfter = function( r, settings ) {
|
2008-01-29 17:43:20 +01:00
|
|
|
$('.comment-count span').each( function() {
|
2008-01-04 12:53:15 +01:00
|
|
|
var a = $(this);
|
2008-01-03 23:24:58 +01:00
|
|
|
var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
|
|
|
|
a.html( n.toString() );
|
|
|
|
});
|
2008-01-04 12:53:15 +01: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-10 00:49:42 +02:00
|
|
|
}
|
2007-03-27 23:20:16 +02:00
|
|
|
|
2007-10-10 00:49:42 +02:00
|
|
|
var delAfter = function( r, settings ) {
|
2008-01-29 17:43:20 +01:00
|
|
|
$('.comment-count span').each( function() {
|
2008-01-04 12:53:15 +01:00
|
|
|
var a = $(this);
|
2008-01-03 23:24:58 +01: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 23:20:16 +02:00
|
|
|
|
2007-10-10 00:49:42 +02:00
|
|
|
if ( extra.size() == 0 || extra.children().size() == 0 ) {
|
|
|
|
return;
|
2006-06-06 06:14:04 +02:00
|
|
|
}
|
2007-03-27 23:20:16 +02:00
|
|
|
|
2007-10-10 00:49:42 +02: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 06:14:04 +02:00
|
|
|
|
2007-10-10 00:49:42 +02:00
|
|
|
} );
|