User:Steph physarum/wikia.js

// Add button when renaming files that fills in the reason with a link to FW:DN $(function {   if ( mw.config.get('wgCanonicalSpecialPageName') === 'Movepage' && $('#wpNewTitleNs :selected').html === 'File' ) {       $('#wpReason').after( 'Descriptive name' );

$('#fwdnbtn').click(function {           $('#wpReason').val('descriptive file name');        }); } });

// Add automatic edit summary when editing old page version $(function {   if (mw.util.getParamValue('diff') === null && mw.util.getParamValue('oldid') !== null) {        var revuser = $('#mw-revision-info .mw-userlink').text,          summary = '&summary=Reverted to r',          $info = $('#mw-revision-info').text;        summary += $info.substring(1, $info.indexOf(' by ')) + ' by ' + revuser + '';        $('#ca-edit').attr('href', $('#ca-edit').attr('href') + summary);    } });