MediaWiki:Gadget-modrollback.js: Difference between revisions

From Porn Base Central
Jump to navigation Jump to search
m (Protected "MediaWiki:Gadget-modrollback.js" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
m (1 revision imported)
 
(No difference)

Latest revision as of 17:11, 16 August 2020

$( function($) {
	$( '.mw-rollback-link a' ).click( function(e) {
		e.preventDefault();
		var $el = $(this);
		$.ajax({
			url: $el.attr('href'),
			success: function() {	
				var user = mw.util.getParamValue( 'from', $el.attr('href') ).replace(/\+/g, '_');
				location.href = mw.util.getUrl( 'Special:Contributions/' + user );
			},
			error: function(){
				$el.text(function( i, val ) {
					return val + ' [failed]';
				} );		
			}
		});
	} );
});