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+)?$/);
34 var isIpRange
= isIp
&& addy
.match(/\/\d+$/);
36 var anonymousRow
= document
.getElementById('wpAnonOnlyRow');
38 anonymousRow
.style
.display
= (!isIp
&& !isEmpty
) ? 'none' : '';
41 var autoblockRow
= document
.getElementById('wpEnableAutoblockRow');
43 autoblockRow
.style
.display
= isIp
&& !isEmpty
? 'none' : '';
46 var emailblockRow
= document
.getElementById('wpEnableEmailBan');
48 emailblockRow
.style
.display
= isIp
&& !isEmpty
? 'none' : '';
51 var hideuserRow
= document
.getElementById('wpEnableHideUser');
53 hideuserRow
.style
.display
= isIp
&& !isEmpty
? 'none' : '';
56 var watchuserRow
= document
.getElementById('wpEnableWatchUser');
58 watchuserRow
.style
.display
= isIpRange
&& !isEmpty
? 'none' : '';