User:Makecat/Scripts/UndoRange.js

//Copy of zh:User:Liangent/Scripts/UndoRange.js

( function( $, mw ) { mw.loader.using( [ 'mediawiki.util' ], function { $( function {   if ( mw.config.get( 'wgAction' ) == 'history' ) {        $( '#mw-history-compare .mw-history-compareselectedversions-button' ).after( $( ' ' )               .val( 'UndoRange' ) .click( function( e ) {                   $( '#mw-history-compare input[name=diff]' ).attr( 'name', 'undo' );                    $( '#mw-history-compare input[name=oldid]' ).attr( 'name', 'undoafter' );                    $( '#mw-history-compare input[name=action]' ).val( 'edit' );                    $( '' ).val( 'Undid edits between revision ' + $( '#mw-history-compare input:checked[name=undoafter]' ).val + ' and ' + $( '#mw-history-compare input:checked[name=undo]' ).val + '.' ).insertAfter( this );               } ) );   } } ); } ); } )( jQuery, mediaWiki );