2008-02-28 01:50:25 -05:00
|
|
|
var theList; var theExtraList;
|
2007-10-09 18:49:42 -04:00
|
|
|
jQuery(function($) {
|
2007-03-27 17:20:16 -04:00
|
|
|
|
2007-10-09 18:49:42 -04:00
|
|
|
var dimAfter = function( r, settings ) {
|
2008-02-27 18:36:24 -05:00
|
|
|
$('li span.comment-count').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
|
2008-02-27 18:36:24 -05:00
|
|
|
$('.post-com-count span.comment-count').each( function() {
|
2008-01-04 06:53:15 -05:00
|
|
|
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-02-26 17:45:46 -05:00
|
|
|
$('span.comment-count').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
|
|
|
|
2008-02-28 01:50:25 -05:00
|
|
|
if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 ) {
|
2007-10-09 18:49:42 -04:00
|
|
|
return;
|
2006-06-06 00:14:04 -04:00
|
|
|
}
|
2007-03-27 17:20:16 -04:00
|
|
|
|
2008-02-28 01:50:25 -05:00
|
|
|
theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() );
|
2007-10-09 18:49:42 -04:00
|
|
|
$('#get-extra-comments').submit();
|
|
|
|
}
|
|
|
|
|
2008-02-28 01:50:25 -05:00
|
|
|
theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
|
|
|
|
theList = $('#the-comment-list').wpList( { alt: '', dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } );
|
2006-06-06 00:14:04 -04:00
|
|
|
|
2007-10-09 18:49:42 -04:00
|
|
|
} );
|