User:Enterprisey/rc-thanks.js

if( mw.config.get( "wgPageName" ) === "Special:RecentChanges" ) { mw.loader.using( [ "mediawiki.util" ], function {        function go {            $( "table[data-mw-revid],tr[data-mw-revid] td.mw-enhanced-rc-nested" )                .filter( function( idx, el ) { return !el.querySelector( "a.mw-thanks-thank-link" ); } )                .each( function ( idx, el ) { var revid = el.dataset.mwRevid || el.parentNode.dataset.mwRevid; var el = $( el ); var thanksSpan = $( " " ).append( " (", $( "" ) .addClass( "mw-thanks-thank-link" ) .attr( "href", mw.util.getUrl( "Special:Thanks/" + revid ) ) .text( "thank" ), ")" ); var rollbackLink = el.find( "span.mw-rollback-link" ); if( rollbackLink.length ) { rollbackLink.after( thanksSpan ); } else { el.append( thanksSpan ); }               } );        }

// The hook will already run go; no need to run it again mw.hook( "wikipage.content" ).add( go ); } ); }