User:Joeytje50/ChatBans.js

if (wgUserGroups.indexOf('sysop')!=-1||wgUserGroups.indexOf('chatmoderator')!=-1) {

var d = new Date $('#ChatBanAdd').html(' Add new banned user See Template:Bans for documentation and shorthand inputs. Banned user:  Banning moderator:  (default: yourself) Date of the ban:  Today   Other  Ban expiry:   Ban reason:   Other notes (optional):   Submit ')

$('#btoday').click(function {	if ($(this).is(':checked')) {		$('#bdate #bother').attr('disabled','disabled')	} else {		$('#bdate #bother').removeAttr('disabled')	} }) $('#bother').keyup(function {	if ($(this).val!='') {		$('#bdate #btoday').attr('disabled','disabled')	} else {		$('#bdate #btoday').removeAttr('disabled')	} }) var bandate = $('#bdate input[disabled]').length!=0?$('#bdate input:not([disabled])').val:'' var template = '|-
 * '+$('#buser').val+' (remove ban)
 * '+bandate+'
 * '+$('#breason').val+'
 * '+($('#bmod').val!=''?$('#bmod').val:wgUserName)+'
 * '+$('#bnotes').val+''
 * '+$('#bnotes').val+''

}