MediaWiki:Common.js: Unterschied zwischen den Versionen
Aus Pyrathor
Faern (Diskussion | Beiträge) Die Seite wurde neu angelegt: „→Das folgende JavaScript wird für alle Benutzer geladen.: $(function () { if (!mw.config.get('wgUserRights').includes('purge')) { return; } mw.util.addPortletLink( 'p-cactions', mw.util.getUrl(mw.config.get('wgPageName'), { action: 'purge' }), 'Purge', 'ca-purge', 'Purge this page cache' ); });“ |
Faern (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
| Zeile 1: | Zeile 1: | ||
mw.user.getRights().then( function ( rights ) { | |||
if ( !rights.includes( 'purge' ) ) { | |||
if (! | |||
return; | return; | ||
} | } | ||
| Zeile 7: | Zeile 6: | ||
mw.util.addPortletLink( | mw.util.addPortletLink( | ||
'p-cactions', | 'p-cactions', | ||
mw.util.getUrl( | mw.util.getUrl( null, { action: 'purge' } ), | ||
'Purge', | 'Purge', | ||
'ca-purge', | 'ca-purge', | ||
'Purge this page | 'Purge the server cache of this page' | ||
); | ); | ||
}); | } ); | ||
