User:Quarl/all diffs above here.js

// from http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts/Scripts/All_diffs_above_here

//

function openAdahLinks(kk) { var as = document.getElementsByTagName('a'); var k = 0; for (n=0; n<as.length; n++) { if (as[n].innerHTML == 'diff') { if (k <= kk) { window.open(as[n].href, '_blank'); }     k++; } } }

function addAdahLinks { if (getPname == 'My watchlist') { var as = document.getElementsByTagName('a'); var k = 0; for (n=0; n<as.length; n++) { if (as[n].innerHTML == 'diff') { var tn = document.createTextNode(') ('); var link = document.createElement('a'); link.href = 'javascript:openAdahLinks(' + (k++) + ')'; link.appendChild(document.createTextNode('adah'), null); as[n].parentNode.insertBefore(tn, as[n].nextSibling.nextSibling); as[n].parentNode.insertBefore(link, as[n].nextSibling.nextSibling); }   }  } }

if (window.addEventListener) window.addEventListener("load", addAdahLinks, false); else if (window.attachEvent) window.attachEvent("onload", addAdahLinks);

//