User:Greenrd/vector.js

importScript('User:Js/ajaxPreview.js'); // User:Js/ajaxPreview.js importScript('User:Gary King/default summary.js'); // User:Gary King/default summary.js importScript('User:Svick/SectionInput.js'); // User:Svick/SectionInput.js importScript('User:Salix alba/TDSkell.js');

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 (mw.config.get('wgCanonicalNamespace') == 'Special' && mw.config.get('wgCanonicalSpecialPageName') == '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); }   }  } }

addOnloadHook(addAdahLinks);