Jump to content

User:Nyakase/Scripts/mossXP.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.
if(mw.config.get("wgPageName").startsWith("Wikipedia:Typo_Team/moss/")) {
	let wiktionaryLinks = Array.from(document.querySelectorAll(".extiw")).filter(link => link.href.includes(".wiktionary.org") && link.textContent.startsWith("wikt:"));
	wiktionaryLinks.forEach(wiktionaryLink => {
		wiktionaryLink.textContent = wiktionaryLink.textContent.substr(5);
	});
	
	$(".mw-parser-output > ul > li > a").on("click",function(e){ 
        e.preventDefault();  
        window.open(this.href + "?veaction=edit", "_blank");
    });
}

if(mw.config.get("wgPageName") == "Wikipedia:Typo_Team/moss" && document.location.search == "?autobest") {
	document.querySelector(".mw-parser-output p i b a").click();
}

mw.util.addPortletLink(
	'p-tb',
	'https://en.wikipedia.org/wiki/Wikipedia:Typo_Team/moss?autobest',
	'Fix moss typos'
);