Jump to content

User:Mr.Z-man/newpages.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr.Z-man (talk | contribs) at 00:52, 8 November 2008 (test). 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.
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 (document.getElementById('mw-np-username').value) {
    button = document.createElement('input');
    button.type = 'button';
    button.value = 'Autopatrol';
    button.onclick = 'javascript:autopatrolclick()';
    addPortletLink('p-cactions', 'javascript:autopatrolclick()', "autopatrol", "ca-autopatrol", "Patrol all these pages");
    document.getElementById('mw-np-username').appendChild(button);
  }
}
addOnloadHook(autopatrollink);
// End autopatrolling

showbydefault = true;
importScript('User:Mr.Z-man/patrollinkstest.js');