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