Skip to content

Instantly share code, notes, and snippets.

@apple502j
Last active March 18, 2018 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apple502j/b5542c0c95332099af507d15ec6ba03e to your computer and use it in GitHub Desktop.
Save apple502j/b5542c0c95332099af507d15ec6ba03e to your computer and use it in GitHub Desktop.
MW Username
// ==UserScript==
// @name MediaWiki Username Template
// @version 0.1
// @description Put username in MediaWiki
// @author apple502j
// @match https://en.scratch-wiki.info/w/*
// @match https://en.scratch-wiki.info/wiki/*
// @match https://ja.scratch-wiki.info/w/*
// @match https://ja.scratch-wiki.info/wiki/*
// @match https://test.scratch-wiki.info/w/*
// @match https://test.scratch-wiki.info/wiki/*
// ==/UserScript==
for (var pup in document.getElementsByClassName("x-mw-username-put-script")){
tmpUsername=mw.config.get("wgUserName");
if (tmpUsername == null){
pup.innerText = pup["data-anonymous"]?pup["data-anonymous"]:"";
} else {
pup.innerText = tmpUsername;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment