Wikipedia:WikiProject User scripts/Scripts/test-n.js
Appearance
From Wikipedia, the free encyclopedia
functiontnaddlilink(url,name) { varna=document.createElement('a'); na.setAttribute('href',url); vartxt=document.createTextNode(name); na.appendChild(txt); varli=document.createElement('li'); li.appendChild(na); returnli; } functiontestn(number) { varpage=prompt("Vandalism to which article?") varf=document.editform,t=f.wpTextbox1; if(t.value.length>0) t.value+='\n'; t.value+="{{subst:"+"test"+number+"-n|"+page+"}} ~"+"~"+"~"+"~"; f.wpSummary.value="Vandalism to [["+page+"]] - warning "+number; } functionadd_testn_tabs() { varc1=document.getElementById('column-one'); vartabs=c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0]; // Only add for pages with "Editing User talk:" somewhere in the title if(document.title.indexOf("Editing User talk:")!=-1) { tabs.appendChild(tnaddlilink('javascript:testn(1)',"t1")); tabs.appendChild(tnaddlilink('javascript:testn(2)',"t2")); tabs.appendChild(tnaddlilink('javascript:testn(3)',"t3")); tabs.appendChild(tnaddlilink('javascript:testn(4)',"t4")); } } addOnloadHook(add_testn_tabs); // [[Category:Wikipedia scripts]]