Jump to content

User:Tollens/subnetContribs.js

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Tollens (talk | contribs) at 06:14, 24 June 2024 (use tabs). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
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.
$.when(mw.loader.using(["mediawiki.util"]), $.ready).done(function () {
	var currentPage = mw.config.get("wgPageName");

	if (currentPage.startsWith("Special:Contributions/")) {
		var user = mw.config.get("wgRelevantUserName");

		if (mw.util.isIPv6Address(user)) {
			var fullAddition = document.createElement("span");
			var rangeLink = document.createElement("a");
			rangeLink.href = "https://en.wikipedia.org/wiki/" + currentPage + "/64";
			rangeLink.textContent = "/64";
			fullAddition.appendChild(document.createTextNode(" ("));
			fullAddition.appendChild(rangeLink);
			fullAddition.appendChild(document.createTextNode(")"));

			document.getElementById("firstHeading").appendChild(fullAddition);
		}
	}
});