User:Hersfold/autopatrol.js

// Stolen from User:Mr.Z-man - adds a [Patrol] link to Special:Newpages for quicker patrolling.

if (document.URL.indexOf('%3A') != -1) { window.location.href = document.URL.replace(/\%3A/g, ":"); }

function autopatrolclick { for (var i=0; i<document.links.length; i++) { if (document.links[i].href.indexOf('action=markpatrolled') != -1) { f=document.createElement("IFRAME"); f.src=document.links[i].href + "&printable=yes"; f.style.display = 'none'; document.body.appendChild(f); } } }

function autopatrollink { if (wgPageName == "Special:NewPages") { mw.util.addPortletLink('p-cactions', 'javascript:autopatrolclick', "autopatrol", "ca-autopatrol", "Patrol all these pages"); } } $(autopatrollink);

function checkorphansclick { for (var i in document.links) { if (document.links[i].href.toString.indexOf('Image:') != -1) { document.links[i].href = document.links[i].href + "?checkimage=true"; window.open(document.links[i].href); } } } // End autopatrolling