Jump to content

User:GoldenRing/generate-diffs.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by GoldenRing (talk | contribs) at 11:22, 14 October 2017. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
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.
// {{pp-template}}
$(document).ready(function() {
  // User contribution lists don't already have checkboxes
  var versions = $('ul.mw-contributions-list').find('li[data-mw-revid]');
  versions.prepend(function(i, el) {
    return '<input name="ids[' + $(this).attr('data-mw-revid') + ']" type="checkbox" value="1">';
  });

  $('div.mw-history-revisionactions').prepend('<button type="submit" name="copydiffs" value="1" class="historysubmit mw-history-copydiffs-button">Copy diffs to clipboard</button>');
});