Jump to content

User:AmandaNP/mod-culog-links.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//Stolen from: [[User:ST47/cu-log-links.js]]
if (window.location.href.indexOf("Special:CheckUserLog") > -1) {
	mw.loader.using('mediawiki.util', function() {
		$('a.mw-anonuserlink').each(function() {
		    var addr = $(this).text();
		    var pattern = /^((\d{1,3}\.){3}\d{1,3}|([\da-f]{0,4}:){1,7}[\da-f]{0,4})(\/\d{1,3})?$/i;
		    if (pattern.test(addr)) {
		        var append = ' (<a href="https://en.wikipedia.org/wiki/Special:Contributions/'+addr+'">contribs</a> | <a href="https://whois.domaintools.com/'+addr+'">WHOIS</a>/<a href="https://tools.wmflabs.org/whois-referral/gateway.py?lookup=true&ip='+addr+'">alt</a> | <a href="https://whatismyipaddress.com/'+addr+'">Geolocate</a> | <a href="https://rangeblockfinder.toolforge.org/?ip='+addr+'&excludelow=yes">RBF</a>)';
		        $($.parseHTML(append)).insertAfter($(this));
		    }
		});
	});
}