User:Animum/moveRV.js

importScript('User:Animum/urlparameters.js'); importScript('User:Animum/formatresponse.js'); importScript('User:Animum/moveRV-movefunc.js');

function zeroPad(str) { return ("0" + str).slice(-2); }

var isSysop = /sysop/.test(mw.config.get('wgUserGroups'));

function doMoveRV { var domove = confirm("All of the moves listed on this page will be reverted" + (isSysop ? ", and the resulting redirects will be deleted" : "") + ".\n\nClick \"OK\" to proceed or \"Cancel\" to abort."); if(domove) { revertmoves; //Function contained in moveRV-movefunc.js   } else { return; } }

addOnloadHook(function {   if(mw.config.get('wgNamespaceNumber') == -1 && mw.config.get('wgCanonicalSpecialPageName') == "Log" && (UrlParameters["type"] == "move" || location.href.substring(location.href.indexOf("title=") + 6).split("/")[1] == "move" || location.href.substring(location.href.indexOf("/wiki/") + 6).split("?")[0].split("/")[1] == "move") && (UrlParameters["user"] || location.href.substring(location.href.indexOf("user=") + 5))) {        mw.util.addPortletLink("p-cactions", "javascript:doMoveRV", "pagemove", "ca-pagemove");    } });