• 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
(test)
(No difference)

Revision as of 11:12, 28 December 2014

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

	function ExecCloseThreads(){
		$(ClosedThreads).each(function(index, comment_id){
			$("#comm-"+comment_id+" .article-comm-reply").hide();
			$("#comm-"+comment_id+" .tools").prepend('[Thread Closed]');
		});
	}
 
	$(window).load(function(){
		if(ClosedThreads.length > 0){
			var realFunc = ArticleComments.addHover;
			ArticleComments.addHover = function () {
				var result = realFunc.apply(this, arguments);
				ExecCloseThreads();
				return result;
			};
		}
	});
 
}(jQuery, window.ArticleComments, window.CloseThread));