User:Paine Ellsworth/common.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
importScript('User:MusikAnimal/confirmationRollback.js'); // Linkback: [[User:MusikAnimal/confirmationRollback.js]]

mw.loader.using( [ 'mediawiki.api' ], function () {
	if ( mw.config.get( 'wgAction' ) !== 'purge' ) {
		return;
	}
	new mw.Api().post( {
		action: 'purge',
		titles: mw.config.get( 'wgPageName' )
	} ).then( function () {
		location.replace( 
			location.pathname +
			location.search
				.replace( /(?:\?|&)action=purge$/ , '' )
				.replace( /(\?|&)action=purge&/ , '$1' ) +
			location.hash
		);
	}, function ( e ) {
		console.log( 'Purge failed', e );
	} );
} );
mw.loader.load( '//en.wikipedia.org/w/index.php?title=User:Plastikspork/massmove.js&action=raw&ctype=text/javascript' ); //[[User:Plastikspork/massmove.js]]
mw.util.addPortletLink("p-tb", "//en.wikipedia.org/wiki/Special:Massmove", "Mass move", "p-massmove", "Mass move");