1 addLoadEvent(function() {
2 theCommentList = new listMan('the-comment-list');
6 theExtraCommentList = new listMan('the-extra-comment-list');
7 if ( theExtraCommentList ) {
8 theExtraCommentList.showLink = 0;
9 theExtraCommentList.altOffset = 1;
10 if ( theExtraCommentList.theList && theExtraCommentList.theList.childNodes )
11 var commentNum = $A(theExtraCommentList.theList.childNodes).findAll( function(i) { return Element.visible(i) } ).length;
14 var urlQ = document.location.href.split('?');
15 var params = urlQ[1] ? urlQ[1].toQueryParams() : [];
16 var search = params['s'] ? params['s'] : '';
17 var page = params['apage'] ? params['apage'] : 1;
20 theCommentList.dimComplete = function(what,id,dimClass) {
21 var m = document.getElementById('awaitmod');
22 if ( document.getElementById(what + '-' + id).className.match(dimClass) )
23 m.innerHTML = parseInt(m.innerHTML,10) + 1;
25 m.innerHTML = parseInt(m.innerHTML,10) - 1;
28 theCommentList.delComplete = function(what,id) {
29 var m = document.getElementById('awaitmod');
30 what = what.split('-')[0];
31 if ( document.getElementById(what + '-' + id).className.match('unapproved') )
32 m.innerHTML = parseInt(m.innerHTML,10) - 1;
33 if ( theExtraCommentList && commentNum ) {
34 var theMover = theExtraCommentList.theList.childNodes[0];
35 Element.removeClassName(theMover,'alternate');
36 theCommentList.theList.appendChild(theMover);
37 theExtraCommentList.inputData += '&page=' + page;
39 theExtraCommentList.inputData += '&s=' + search; // trust the URL not the search box
40 theExtraCommentList.addComplete = function() {
41 if ( theExtraCommentList.theList.childNodes )
42 var commentNum = $A(theExtraCommentList.theList.childNodes).findAll( function(i) { return Element.visible(i) } ).length;
46 theExtraCommentList.ajaxAdder( 'comment', 'ajax-response' ); // Dummy Request
50 if ( theList ) // the post list: edit.php
51 theList.delComplete = function() {
52 var comments = document.getElementById('comments');
53 var commdel = encloseFunc(function(a){a.parentNode.removeChild(a);},comments);
54 var listdel = encloseFunc(function(a){a.parentNode.removeChild(a);},theCommentList.theList);
55 setTimeout(commdel,705);
56 setTimeout(listdel,705);