]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - skins/common/block.js
MediaWiki 1.16.0
[autoinstallsdev/mediawiki.git] / skins / common / block.js
index 90211efa7c7c07ee5a997efe966d67fbb42ab4c0..ad04f8103be748c791616a63fde04b53ce062371 100644 (file)
@@ -1,19 +1,19 @@
-addOnloadHook(considerChangingExpiryFocus);
+addOnloadHook( considerChangingExpiryFocus );
 
 function considerChangingExpiryFocus() {
-       if (!document.getElementById) {
+       if ( !document.getElementById ) {
                return;
        }
-       var drop = document.getElementById('wpBlockExpiry');
-       if (!drop) {
+       var drop = document.getElementById( 'wpBlockExpiry' );
+       if ( !drop ) {
                return;
        }
-       var field = document.getElementById('wpBlockOther');
-       if (!field) {
+       var field = document.getElementById( 'wpBlockOther' );
+       if ( !field ) {
                return;
        }
        var opt = drop.value;
-       if (opt == 'other') {
+       if ( opt == 'other' ) {
                field.style.display = '';
        } else {
                field.style.display = 'none';
@@ -21,39 +21,36 @@ function considerChangingExpiryFocus() {
 }
 
 function updateBlockOptions() {
-       if (!document.getElementById)
+       if ( !document.getElementById ) {
                return;
+       }
 
-       var target = document.getElementById('mw-bi-target');
-       if (!target)
+       var target = document.getElementById( 'mw-bi-target' );
+       if ( !target ) {
                return;
+       }
 
        var addy = target.value;
        var isEmpty = addy.match(/^\s*$/);
        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+)?$/);
        var isIpRange = isIp && addy.match(/\/\d+$/);
 
-       var anonymousRow = document.getElementById('wpAnonOnlyRow');
+       var anonymousRow = document.getElementById( 'wpAnonOnlyRow' );
        if( anonymousRow ) {
-               anonymousRow.style.display = (!isIp && !isEmpty) ? 'none' : '';
+               anonymousRow.style.display = ( !isIp && !isEmpty ) ? 'none' : '';
        }
 
-       var autoblockRow = document.getElementById('wpEnableAutoblockRow');
+       var autoblockRow = document.getElementById( 'wpEnableAutoblockRow' );
        if( autoblockRow ) {
                autoblockRow.style.display = isIp && !isEmpty ? 'none' : '';
        }
-
-       var emailblockRow = document.getElementById('wpEnableEmailBan');
-       if( emailblockRow ) {
-               emailblockRow.style.display = isIp && !isEmpty ? 'none' : '';
-       }
        
-       var hideuserRow = document.getElementById('wpEnableHideUser');
+       var hideuserRow = document.getElementById( 'wpEnableHideUser' );
        if( hideuserRow ) {
                hideuserRow.style.display = isIp && !isEmpty ? 'none' : '';
        }
 
-       var watchuserRow = document.getElementById('wpEnableWatchUser');
+       var watchuserRow = document.getElementById( 'wpEnableWatchUser' );
        if( watchuserRow ) {
                watchuserRow.style.display = isIpRange && !isEmpty ? 'none' : '';
        }