MediaWiki:MassRenameRevert/code.js

/*
 * Mass Rename Revert
 * @desc Opens all "revert" links on Special:Log/move that are currently ticked
 * Due to MediaWiki limitations, it is not possible to do with ?action=move in the API currently with regular user rights, so opening them all is the best we can do
 * Opens all those which are ticked
 * @author Ozuzanna
 * @TODO add check all dynamic button (possibly the same element as the uncheck one?)

if (mw.config.get('wgCanonicalSpecialPageName') === "Log" && mw.config.get('wgPageName').split('/')[1] === "move") { $('#mw-content-text').find('p').first.append(' Open Moves Uncheck All'); $('.mw-logline-move').each(function {   var newChk = ' ';    $(this).prepend(newChk);  }); $('#start-btn').click(function {   $('.mw-logline-move').each(function { var chkObject = $(this).find('input'); if (chkObject.attr('checked')) { var href = $(this).children('.mw-logevent-actionlink').find('a').attr('href'); window.open(href,'_blank'); }   });  });

$('#uncheck-btn').click(function {   $('.mw-logline-move').each(function { var chkObject = $(this).find('input'); if (chkObject.attr('checked')) chkObject.removeAttr('checked'); }); });  }