- 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"
Jump to navigation
Jump to search
m (extra exclosing v5) |
m (revert to global vars) |
||
Line 1: | Line 1: | ||
− | (function($, ArticleComments){ | + | (function($, ArticleComments, ClosedThreads){ |
"use strict"; | "use strict"; | ||
− | console.log("Close Thread v0. | + | console.log("Close Thread v0.6"); |
− | + | ||
function ExecCloseThreads(){ | function ExecCloseThreads(){ | ||
− | $( | + | $(ClosedThreads).each(function(index, comment_id){ |
− | + | console.log("Closing: "+comment_id); | |
− | $(".article-comm-reply" | + | $("#comm-"+comment_id+" .article-comm-reply").hide(); |
}); | }); | ||
} | } | ||
$(window).load(function(){ | $(window).load(function(){ | ||
− | var realFunc = ArticleComments.addHover; | + | if(ClosedThreads.length > 0){ |
− | + | var realFunc = ArticleComments.addHover; | |
− | + | ArticleComments.addHover = function () { | |
− | + | var result = realFunc.apply(this, arguments); | |
− | + | ExecCloseThreads(); | |
− | } | + | return result; |
+ | }; | ||
+ | } | ||
}); | }); | ||
− | }(jQuery, window.ArticleComments)); | + | }(jQuery, window.ArticleComments, window.CloseThread)); |
Latest revision as of 11:15, 8 January 2015
(function($, ArticleComments, ClosedThreads){
"use strict";
console.log("Close Thread v0.6");
function ExecCloseThreads(){
$(ClosedThreads).each(function(index, comment_id){
console.log("Closing: "+comment_id);
$("#comm-"+comment_id+" .article-comm-reply").hide();
});
}
$(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));