1 function considerChangingExpiryFocus() {
2 if (!document.getElementById) {
5 var drop = document.getElementById('wpBlockExpiry');
9 var field = document.getElementById('wpBlockOther');
15 field.style.display = '';
17 field.style.display = 'none';
21 function updateBlockOptions() {
22 if (!document.getElementById)
25 var target = document.getElementById('mw-bi-target');
29 var addy = target.value;
30 var isEmpty = addy.match(/^\s*$/);
31 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 anonymousRow = document.getElementById('wpAnonOnlyRow');
35 anonymousRow.style.display = (!isIp && !isEmpty) ? 'none' : '';
38 var autoblockRow = document.getElementById('wpEnableAutoblockRow');
40 autoblockRow.style.display = isIp && !isEmpty ? 'none' : '';
43 var emailblockRow = document.getElementById('wpEnableEmailBan');
45 emailblockRow.style.display = isIp && !isEmpty ? 'none' : '';
48 var hideuserRow = document.getElementById('wpEnableHideUser');
50 hideuserRow.style.display = isIp && !isEmpty ? 'none' : '';