MediaWiki:Common.js: Difference between revisions
From PigBoats.COM
Pbc captain (talk | contribs) No edit summary |
Pbc captain (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
console.log('Common.js is loading...'); | |||
document.addEventListener("DOMContentLoaded", function () { | document.addEventListener("DOMContentLoaded", function () { | ||
var userGroups = mw.config.get('wgUserGroups'); | var userGroups = mw.config.get('wgUserGroups'); |
Revision as of 19:11, 1 July 2025
/* Any JavaScript here will be loaded for all users on every page load. */
console.log('Common.js is loading...');
document.addEventListener("DOMContentLoaded", function () {
var userGroups = mw.config.get('wgUserGroups');
// If the user is NOT an admin, hide the page tools and wiki tools
if (userGroups.indexOf('sysop') === -1) {
var pageTools = document.getElementById('page-tools');
if (pageTools) {
pageTools.style.display = 'none';
}
var wikiTools = document.getElementById('p-tb');
if (wikiTools) {
wikiTools.style.display = 'none';
}
}
});