User:East718/block.js
//
var lang = new Array(
'Vandalism-only account',
'Three-revert rule violation',
'Edit warring',
'Abusing multiple accounts',
'{{' + 'blocked proxy}}',
'{{' + 'tor}}',
'{{' + 'zombie proxy}}',
'{{' + 'UsernameBlocked}}',
'{{' + 'UsernameHardBlocked}}'
);
function blockaux()
{
var bl = document.getElementById('wpBlockReasonList');
var be = document.getElementById('wpBlockExpiry');
switch (bl.value)
{
case lang[0]:
case lang[3]:
case lang[8]:
blockparam(true, true, true, true, false, false);
break;
case lang[1]:
case lang[2]:
var temp = prompt('On', '');
document.getElementById('mw-bi-reason').value = (temp == null ? '' : 'on ' + temp + '');
default:
blockparam(false, true, true, true, false, false);
break;
case lang[4]:
case lang[5]:
case lang[6]:
blockparam(false, false, true, true, false, true);
break;
case lang[7]:
blockparam(true, true, false, false, false, false);
break;
}
}
function blockparam(indef, ao, ac, ab, em, proxy)
{
var bo = document.getElementById('wpBlockOther');
var tp1 = '
if (indef)
{
document.getElementById('wpBlockExpiry').value = 'other';
bo.innerHTML = tp1 + 'infinite' + tp2;
}
else if (proxy)
{
document.getElementById('wpBlockExpiry').value = 'other';
bo.innerHTML = tp1 + '3 years' + tp2;
}
document.getElementById('wpAnonOnly').checked = ao;
document.getElementById('wpCreateAccount').checked = ac;
document.getElementById('wpEnableAutoblock').checked = ab;
document.getElementById('wpEmailBan').checked = em;
considerChangingExpiryFocus();
}
addOnloadHook(function()
{
if (document.getElementById('wpBlockReasonList'))
{
var bl = document.getElementById('wpBlockReasonList');
bl.parentNode.innerHTML = '';
var bl = document.getElementById('wpBlockReasonList');
var rsn = new Array(
new Array('other', 'Other reason'),
new Array('WP:VAND', 'Vandalism'),
new Array(lang[0], 'VOA'),
new Array(lang[1], '3RR'),
new Array(lang[2], 'Edit warring'),
new Array(lang[3], 'Sockpuppetry'),
new Array('Attempting to harass other users', 'Harassment'),
new Array('Creating nonsense pages', 'Creating nonsense'),
new Array('Inserting unverifiable information', 'Unveriable info'),
new Array('Spamming links to external sites', 'Spamming'),
new Array('Repeated violations of copyright policy', 'Copyvio'),
new Array('{{' + 'anonblock}}', 'Anon block'),
new Array('{{' + 'schoolblock}}', 'School'),
new Array(lang[4], 'Proxy'),
new Array(lang[5], 'Tor'),
new Array(lang[6], 'Zombie'),
new Array(lang[7], 'Username'),
new Array(lang[8], 'Username hardblock')
);
for (i = 0; i < rsn.length; i++)
{
var bl_new = document.createElement('option');
bl_new.text = rsn[i][1];
bl_new.value = rsn[i][0];
bl.add(bl_new, null);
}
}
});
//