User:Yair rand/altformcreator.js

// Greenlinks redlinked alt forms. Currently only works with nouns. $(function{ q=document.getElementsByTagName('h3') for(i=0;i<q.length;i++) { if(q[i].lastChild.innerHTML=="Alternative forms") { qq=q[i].nextSibling;while(!(qq.nodeName.toLowerCase=="ul"||qq.nodeName.toLowerCase.match(/^h\d/i))){qq=qq.nextSibling} if(qq.nodeName.toLowerCase=="ul") { qqq=qq.getElementsByTagName('a'); for(ii=0;ii<qqq.length;ii++) { if(qqq[ii].className=="new") { qqq[ii].style.color="rgb(34, 204, 0)" qqq[ii].href+="&preloadtext=%3D%3D%7B%7Bsubst%3A"+((qqq[ii].parentNode.lang)?qqq[ii].parentNode.lang:"en")+"%7Cl%3D%7D%7D%3D%3D%0A%0A%3D%3D%3DNoun%3D%3D%3D%0A%7B%7Binfl"+((qqq[ii].parentNode.lang)?"|"+qqq[ii].parentNode.lang:"")+"%7D%7D%0A%0A%23%20%7B%7Balternative%20form%20of%7C"+wgTitle+((qqq[ii].parentNode.lang)?"|lang%3D"+qqq[ii].parentNode.lang:"")+"%7D%7D%0A%0A%7B%7Bcount%20page%7C%5B%5BWiktionary%3APage%20count%5D%5D%7D%7D&preloadminor=true" }}}}}})