MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 311: | Line 311: | ||
// ── Init ──────────────────────────────────────────────────────── | // ── Init ──────────────────────────────────────────────────────── | ||
function init() { | function init() { | ||
/* Remove appearance panel + watchlist overflow from DOM entirely | |||
* so they cannot be toggled open even by JS. CSS display:none is | |||
* enough for most cases but DOM removal prevents any JS re-showing. */ | |||
[ '#vector-appearance', | |||
'#vector-appearance-pinned-container', | |||
'#vector-appearance-unpinned-container', | |||
'.mw-portlet-appearance', | |||
'.mw-portlet-vector-user-menu-overflow', | |||
'#p-vector-user-menu-overflow', | |||
].forEach( function ( sel ) { | |||
document.querySelectorAll( sel ).forEach( function ( el ) { | |||
el.parentNode && el.parentNode.removeChild( el ); | |||
} ); | |||
} ); | |||
/* Remove the appearance toggle BUTTON (aria-controls="vector-appearance") */ | |||
document.querySelectorAll( '[aria-controls="vector-appearance"]' ).forEach( function ( el ) { | |||
el.parentNode && el.parentNode.removeChild( el ); | |||
} ); | |||
var content = document.querySelector( '.mw-parser-output' ); | var content = document.querySelector( '.mw-parser-output' ); | ||
var alreadyTagged = content && content.querySelector( '[data-deva]' ); | var alreadyTagged = content && content.querySelector( '[data-deva]' ); | ||