2 function considerChangingExpiryFocus() {
3 if (!document.getElementById) {
6 var drop = document.getElementById('wpBlockExpiry');
10 var field = document.getElementById('wpBlockOther');
16 field.style.display = '';
18 field.style.display = 'none';
22 function updateBlockOptions() {
23 if (!document.getElementById)
26 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+)?$/);
35 var anonymousCheck = document.getElementById('wpAnonOnly');
36 anonymousCheck.disabled = !isIp && !isEmpty;
38 var autoblockCheck = document.getElementById('wpEnableAutoblock');
39 autoblockCheck.disabled = isIp && !isEmpty;
42 var anonymousRow = document.getElementById('wpAnonOnlyRow');
43 anonymousRow.style.display = (!isIp && !isEmpty) ? 'none' : '';
45 var autoblockRow = document.getElementById('wpEnableAutoblockRow');
46 autoblockRow.style.display = isIp && !isEmpty ? 'none' : '';