MediaWiki:Common.js: Difference between revisions
From Wiki-DB
Jump to navigationJump to search
Created page with "→Any JavaScript here will be loaded for all users on every page load.: mw.loader.using('mediawiki.util', function () { var groups = mw.config.get('wgUserGroups'); if (!groups || groups.indexOf('sysop') === -1) { mw.hook('wikipage.content').add(function () { $('#p-administration').hide(); }); } });" |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
/ | // Sysop-Navigation nur für Sysops anzeigen | ||
( function () { | |||
var groups = mw.config.get('wgUserGroups'); | var groups = mw.config.get( 'wgUserGroups' ) || []; | ||
if ( | if ( groups.indexOf( 'sysop' ) === -1 ) { | ||
// Sofort ausblenden ohne auf Hook zu warten | |||
var style = document.createElement( 'style' ); | |||
style.textContent = '#p-administration { display: none !important; }'; | |||
document.head.appendChild( style ); | |||
} | } | ||
}); | }() ); | ||
Latest revision as of 22:52, 13 April 2026
// Sysop-Navigation nur für Sysops anzeigen
( function () {
var groups = mw.config.get( 'wgUserGroups' ) || [];
if ( groups.indexOf( 'sysop' ) === -1 ) {
// Sofort ausblenden ohne auf Hook zu warten
var style = document.createElement( 'style' );
style.textContent = '#p-administration { display: none !important; }';
document.head.appendChild( style );
}
}() );