}
function testn(number)
{
var page = prompt("Vandalism to which article?")
var f = 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;
}
function add_testn_tabsc()
{
var c1 = document.getElementById('column-one');
var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];
// Only add for pages with "Editing User talk:" somewhere in the title
if (document.title.indexOf("User talk:") != -1)
{
tabs.appendChild(tnbaddlilinkc('javascript:testn(1)',"Test 1"));
tabs.appendChild(tnbaddlilinkc('javascript:testn(2)',"Test 2"));
tabs.appendChild(tnbaddlilinkc('javascript:testn(3)',"Test 3"));
tabs.appendChild(tnbaddlilinkc('javascript:testn(4)',"Test 4"));
}
}
addOnloadHook(add_testn_tabsc);
// Returns <li><a href="url">name</a></li>
function addlilink(url, name)
{
var na = document.createElement('a');
na.setAttribute('href', url);
var txt = document.createTextNode(name);
na.appendChild(txt);
var li = document.createElement('li');
li.appendChild(na);
return li;
}
// Adds a "blocklog" tab and fills in the username field on Special:Blockip, if a "&faketarget=username" is present.
{
var name = document.title.split(' - ')[0];
___location.href = 'http://en.wikipedia.org/w/index.php?title=' + name + '&action=edit&JScript=testn(' + number + ')\n/&autosummary=testn(' + number + ')&autoclick=wpSave";';
}
}
|