User:DerFussi/common.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// <nowiki>
var action = mw.config.get( 'wgAction' );
if ( action === 'view' ) {
	$('ul.vector-menu-content-list li#ca-move').after( '<li id="ca-purge" class="mw-list-item"><span><a href="#" title="Diese Seite aktualisieren [Alt+Umschalt+a]" accesskey="a">Aktualisieren</a></span></li>' );
	$('ul.vector-menu-content-list li#ca-purge a').on( 'click', function (e) {
		new mw.Api().post( { action: 'purge', titles: mw.config.get( 'wgPageName' ) } ).then(function () {
			location.reload();
		}, function () {
			mw.notify( 'Purge failed', { type: 'error' } );
		});
		e.preventDefault();
	});
}

// NÜSCHT

// </nowiki>