MediaWiki:Common.js: Difference between revisions
From PC Gaming Shelter
No edit summary |
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. */ | ||
if (mw.config.get('wgUserName') !== null) { | $(function() { | ||
managePersonalIconVis(); | |||
}); | |||
function managePersonalIconVis(){ | |||
if (mw.config.get('wgUserName') !== null) { | |||
const personal = document.getElementById('p-personal'); | const personal = document.getElementById('p-personal'); | ||
document.querySelector('#pane4').appendChild(personal); | document.querySelector('#pane4').appendChild(personal); | ||
} else { | } else { | ||
const personalIcon = document.querySelector('personal-tools-icon'); | const personalIcon = document.querySelector('personal-tools-icon'); | ||
if (personalIcon) { | if (personalIcon) { | ||
personalIcon.remove(); | personalIcon.remove(); | ||
} | } | ||
} | |||
} | } | ||
Revision as of 01:21, 17 March 2026
/* Any JavaScript here will be loaded for all users on every page load. */
$(function() {
managePersonalIconVis();
});
function managePersonalIconVis(){
if (mw.config.get('wgUserName') !== null) {
const personal = document.getElementById('p-personal');
document.querySelector('#pane4').appendChild(personal);
} else {
const personalIcon = document.querySelector('personal-tools-icon');
if (personalIcon) {
personalIcon.remove();
}
}
}
