1 addOnloadHook(considerChangingExpiryFocus
);
3 function considerChangingExpiryFocus() {
4 if (!document
.getElementById
) {
7 var drop
= document
.getElementById('wpBlockExpiry');
11 var field
= document
.getElementById('wpBlockOther');
17 field
.style
.display
= '';
19 field
.style
.display
= 'none';
23 function updateBlockOptions() {
24 if (!document
.getElementById
)
27 var target
= document
.getElementById('mw-bi-target');
31 var addy
= target
.value
;
32 var isEmpty
= addy
.match(/^\s*$/);
33 var isIp
= addy
.match(/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|:(:[0-9A-Fa-f]{1,4}){1,7}|[0-9A-Fa-f]{1,4}(:{1,2}[0-9A-Fa-f]{1,4}|::$){1,7})(\/\d+)?$/);
35 var anonymousRow
= document
.getElementById('wpAnonOnlyRow');
37 anonymousRow
.style
.display
= (!isIp
&& !isEmpty
) ? 'none' : '';
40 var autoblockRow
= document
.getElementById('wpEnableAutoblockRow');
42 autoblockRow
.style
.display
= isIp
&& !isEmpty
? 'none' : '';
45 var emailblockRow
= document
.getElementById('wpEnableEmailBan');
47 emailblockRow
.style
.display
= isIp
&& !isEmpty
? 'none' : '';
50 var hideuserRow
= document
.getElementById('wpEnableHideUser');
52 hideuserRow
.style
.display
= isIp
&& !isEmpty
? 'none' : '';