• 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/CommentWarning.js"

From Kancolle Wiki
Jump to navigation Jump to search
m (trace article comments object)
m (attempt fix event-based prepend)
 
Line 1: Line 1:
 
(function($, ArticleComments){
 
(function($, ArticleComments){
 
"use strict";
 
"use strict";
console.log("Comment Warning v0.4");
+
console.log("Comment Warning v0.5");
console.log(ArticleComments);
 
 
 
 
$(window).load(function(){
 
$(window).load(function(){
$(".kcCommentWarning").prependTo("#article-comments");
+
if(ArticleComments){
 +
var realFunc = ArticleComments.init;
 +
ArticleComments.init= function () {
 +
var result = realFunc.apply(this, arguments);
 +
$(".kcCommentWarning").prependTo("#article-comments");
 +
$(".kcCommentWarning").show();
 +
return result;
 +
};
 +
}
 
});
 
});
 
   
 
   
 
}(jQuery, window.ArticleComments));
 
}(jQuery, window.ArticleComments));

Latest revision as of 18:18, 15 March 2015

(function($, ArticleComments){
	"use strict";
	console.log("Comment Warning v0.5");
	
	$(window).load(function(){
		if(ArticleComments){
			var realFunc = ArticleComments.init;
			ArticleComments.init= function () {
				var result = realFunc.apply(this, arguments);
				$(".kcCommentWarning").prependTo("#article-comments");
				$(".kcCommentWarning").show();
				return result;
			};
		}	
	});
 
}(jQuery, window.ArticleComments));