User:Thundercraft5/BetterCommentLinks.js

$(function {	var inter = setInterval(function { var userGroups = mw.config.get('wgUserGroups'); var canBlock = /sysop|util|staff|helper|global-discussions-moderator|wiki-manager|soap/.test(userGroups.join('\n')); if ($('[class^="ReplyCreate_reply-create"]').length) { clearInterval(inter); function changeCommentLinks { // jshint ignore:line $('span[class^="EntityHeader_header-details"] > div[class^="wds-avatar EntityHeader_avatar"] > a').each(function {					var user = $(this).attr('href').replace(/\/wiki\/(User:|Special:Contributions\/)/gi, ''),						$link = $(this).parent.parent.children('a:last-of-type:not(.mw-user-anon-link)'),						$this = $(this);					$link						.attr('href', '/wiki/Special:Contributions/' + user)						.html(user);					$this.attr('href', '/wiki/Special:Contributions/' + user);					$link.after( ' (',						$('', { href: "/wiki/Message_wall:" + user, html: "wall", title: "Message_wall:" + user, class: "mw-user-anon-link", }),						canBlock ? ' &bull; ' : "",						canBlock ? $('', { href: "/wiki/Special:Block/" + user, html: "block", title: "Special:Block/" + user, class: "mw-user-anon-link", }) : "",						')'					);				});			}			changeCommentLinks; $('[class^="ReplyList_view-all-replies"]').click(function {				setTimeout(changeCommentLinks, 25);			}); }	}, 25); });