Last active
March 18, 2018 02:16
-
-
Save apple502j/b5542c0c95332099af507d15ec6ba03e to your computer and use it in GitHub Desktop.
MW Username
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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