MediaWiki:Common.js
From BGBM Collection Workflows
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* Any JavaScript here will be loaded for all users on every page load. */ //easy account approval for admins if(mw.config.get("wgUserGroups").includes("sysop")){ if(mw.config.get("wgPageName")=="Special:ListUsers" || mw.config.get("wgPageName")=="Special:ActiveUsers"){ var linkMenues = document.getElementById("mw-content-text").getElementsByClassName("mw-usertoollinks") for(i=0;i<linkMenues.length;i++){ var linkMenu = linkMenues[i]; var editRightsLink = linkMenu.lastElementChild.cloneNode(true); editRightsLink.href = editRightsLink.href.replace("Special:Block","Special:UserRights"); editRightsLink.title = editRightsLink.title.replace("Special:Block","Special:UserRights"); editRightsLink.innerHTML = "edit rights"; linkMenu.insertBefore(document.createTextNode(" | "), linkMenu.lastChild); linkMenu.insertBefore(editRightsLink, linkMenu.lastChild); } }else if(mw.config.get("wgNamespaceNumber")==2||mw.config.get("wgNamespaceNumber")==3){ var deleteLink = document.getElementById("ca-delete") var username = mw.config.get("wgTitle"); if(username.indexOf("/")!=-1){ username = username.substring(0,username.indexOf("/")); } mw.util.addPortletLink("p-cactions","https://wiki.bgbm.org/collectionworkflows/index.php/Special:UserRights/"+username,"Rights", "ca-user-rights","User Rights","g",deleteLink); } }