User:Mr.Z-man/moverevert3.js

if (mw.config.get('wgPageName') == "Special:Log" || mw.config.get('wgPageName') == "Special:Block" || mw.config.get('wgNamespaceNumber') ==2 || mw.config.get('wgNamespaceNumber') == 3) {

function addmoveRevertTab { mw.util.addPortletLink('p-cactions', 'javascript:moverevert3_main', "Revert moves", "ca-moverevert", "Revert"); } $(addmoveRevertTab);

function moverevert3_main { if (mw.config.get('wgPageName') == "Special:Log" && document.URL.indexOf('&page=') != -1) { var user = document.URL.substring(document.URL.indexOf('&user=')+6,document.URL.indexOf('&page=')); } else if (mw.config.get('wgPageName') == "Special:Log"){ var user = document.URL.substring(document.URL.indexOf('&user=')+6); } else if (mw.config.get('wgNamespaceNumber') > 0) { var user = encodeURIComponent(mw.config.get('wgTitle')); } else { var user = document.URL.substring(document.URL.indexOf('Special:Block/')+14); } window.open("http://localhost/cgi-bin/moverv.py?user="+user); } }