Difference between revisions of "MediaWiki:Common.js"
From BGBM Collection Workflows
(added easy account approval for admins) |
(adjustment of account approval script) |
||
Line 15: | Line 15: | ||
linkMenu.insertBefore(editRightsLink, linkMenu.lastChild); | linkMenu.insertBefore(editRightsLink, linkMenu.lastChild); | ||
} | } | ||
− | }else if(mw.config.get(" | + | }else if(mw.config.get("wgNamespaceNumber")==2||mw.config.get("wgNamespaceNumber")==3){ |
− | var | + | 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); | ||
} | } | ||
} | } |
Latest revision as of 09:41, 10 July 2018
/* 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); } }