• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Difference between revisions of "User:Dragonjet/scripts/CloseThread.js"

From Kancolle Wiki
Jump to navigation Jump to search
m (use template instead of global vars to determine comment IDs to close)
(fix 0.4)
Line 1: Line 1:
 
(function($, ArticleComments){
 
(function($, ArticleComments){
 
"use strict";
 
"use strict";
console.log("Close Thread v0.3");
+
console.log("Close Thread v0.4");
  
 
function ExecCloseThreads(){
 
function ExecCloseThreads(){
$(ClosedThreads).each(function(index, comment_id){
+
$($(".wikiCloseCommentThread")).each(function(){
console.log("Closing: "+comment_id);
+
console.log("Closing: "+this.closest(".comment" ).attr("id"));
$(".article-comm-reply", $(".wikiCloseCommentThread").closest(".comment" )).hide();
+
$(".article-comm-reply", this.closest(".comment" )).hide();
 
});
 
});
 
}
 
}

Revision as of 11:03, 8 January 2015

(function($, ArticleComments){
	"use strict";
	console.log("Close Thread v0.4");

	function ExecCloseThreads(){
		$($(".wikiCloseCommentThread")).each(function(){
			console.log("Closing: "+this.closest(".comment" ).attr("id"));
			$(".article-comm-reply", this.closest(".comment" )).hide();
		});
	}
 
	$(window).load(function(){
		var realFunc = ArticleComments.addHover;
		ArticleComments.addHover = function () {
			var result = realFunc.apply(this, arguments);
			ExecCloseThreads();
			return result;
		};
	});
 
}(jQuery, window.ArticleComments));