Aralot (aralot) wrote in changelog,
Aralot
aralot
changelog

[livejournal] r18408: LJSUP-7848: delete all author comments (...

Committer: szhirkov
LJSUP-7848: delete all author comments (Antispam)
U   trunk/htdocs/js/commentmanage.js
Modified: trunk/htdocs/js/commentmanage.js
===================================================================
--- trunk/htdocs/js/commentmanage.js	2011-02-25 05:12:46 UTC (rev 18407)
+++ trunk/htdocs/js/commentmanage.js	2011-02-25 07:31:26 UTC (rev 18408)
@@ -291,9 +291,10 @@
 
     var form = $('ljdelopts' + ditemid),
         todel = $('ljcmt' + ditemid),
-        opt_delthread = opt_delauthor =
-        is_deleted = is_error = false,
+        opt_delthread, opt_delauthor, is_deleted, is_error,
         pulse = 0;
+		
+	opt_delthread = opt_delauthor = is_deleted = is_error = false;		
 
     var postdata = 'confirm=1';
     if (form){ 
@@ -309,7 +310,7 @@
     	}
     }
     postdata += '&lj_form_auth=' + LJ_cmtinfo.form_auth;
-    var curJournal=(Site.currentJournal!="")?(Site.currentJournal):(LJ_cmtinfo.journal);
+    var curJournal = (Site.currentJournal !== "") ? (Site.currentJournal) : (LJ_cmtinfo.journal);
     var opts = {
         url: LiveJournal.getAjaxUrl('delcomment')+'?mode=js&journal=' + curJournal + '&id=' + ditemid,
         data: postdata,
@@ -537,6 +538,7 @@
 			if (action == 'spam') {
 				postUrl = (!isS1) ? postUrl.replace('id', 'talkid') : postUrl;
 				postParams.spam = 1;
+				postParams.delauthor = 1;
 			}
 			
 			jQuery.post(postUrl, postParams, function (json) {
@@ -548,6 +550,14 @@
 					var ids = checkRcForNoCommentsPage(json);
 					handleS2(ids);
 				}
+				
+				if (action == 'spam') {
+	                for (var item in LJ_cmtinfo) {
+	                    if (LJ_cmtinfo[item].u == LJ_cmtinfo[dItemid].u) {
+	                        removeComment(item, false, isS1);
+	                    }
+	                }					
+				}				
 			});		
 		}
 		
@@ -664,7 +674,6 @@
 				}
 			}
 			
-			return ids;
 			
 			function mapComms(id) {
 				var i = -1, newId;
@@ -676,6 +685,8 @@
 					}
 				}
 			}
+			
+			return ids;
 		}
 		
 		return false;

Tags: aralot, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments