1 window
.considerChangingExpiryFocus = function() {
2 if ( !document
.getElementById
) {
5 var drop
= document
.getElementById( 'wpBlockExpiry' );
9 var field
= document
.getElementById( 'wpBlockOther' );
14 if ( opt
== 'other' ) {
15 field
.style
.display
= '';
17 field
.style
.display
= 'none';
20 window
.updateBlockOptions = function() {
21 if ( !document
.getElementById
) {
25 var target
= document
.getElementById( 'mw-bi-target' );
30 var addy
= target
.value
;
31 var isEmpty
= addy
.match(/^\s*$/);
32 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+)?$/);
33 var isIpRange
= isIp
&& addy
.match(/\/\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 hideuserRow
= document
.getElementById( 'wpEnableHideUser' );
47 hideuserRow
.style
.display
= isIp
&& !isEmpty
? 'none' : '';
50 var watchuserRow
= document
.getElementById( 'wpEnableWatchUser' );
52 watchuserRow
.style
.display
= isIpRange
&& !isEmpty
? 'none' : '';
56 addOnloadHook( considerChangingExpiryFocus
);