LocalSettings.php files.
* Give Content-Length header for HTTP/1.0 clients.
* Partial support for Flash cross-domain-policy filtering.
+* Hide irrelevant block options in Special:Blockip based on whether an
+ IP address/range or username is listed. (Dynamic using JS.)
== Languages updated ==
* to ensure that client-side caches don't keep obsolete copies of global
* styles.
*/
-$wgStyleVersion = '58';
+$wgStyleVersion = '59';
# Server-side caching:
$token = htmlspecialchars( $wgUser->editToken() );
+ global $wgStylePath, $wgStyleVersion;
$wgOut->addHTML( "
+<script type=\"text/javascript\" src=\"$wgStylePath/common/block.js?$wgStyleVersion\">
+</script>
<form id=\"blockip\" method=\"post\" action=\"{$action}\">
<table border='0'>
<tr>
<td align=\"right\">{$mIpaddress}:</td>
<td align=\"left\">
" . Xml::input( 'wpBlockAddress', 40, $this->BlockAddress,
- array( 'tabindex' => '1', 'id' => 'mw-bi-target' ) ) . "
+ array(
+ 'tabindex' => '1',
+ 'id' => 'mw-bi-target',
+ 'onchange' => 'updateBlockOptions()' ) ) . "
</td>
</tr>
<tr>");
array( 'tabindex' => '3', 'id' => 'mw-bi-reason' ) ) . "
</td>
</tr>
- <tr>
+ <tr id='wpAnonOnlyRow'>
<td> </td>
<td align=\"left\">
" . wfCheckLabel( wfMsg( 'ipbanononly' ),
array( 'tabindex' => 4 ) ) . "
</td>
</tr>
- <tr>
+ <tr id='wpCreateAccountRow'>
<td> </td>
<td align=\"left\">
" . wfCheckLabel( wfMsg( 'ipbcreateaccount' ),
array( 'tabindex' => 5 ) ) . "
</td>
</tr>
- <tr>
+ <tr id='wpEnableAutoblockRow'>
<td> </td>
<td align=\"left\">
" . wfCheckLabel( wfMsg( 'ipbenableautoblock' ),
</tr>
</table>" .
Xml::hidden( 'wpEditToken', $token ) .
-"</form>\n" );
+"</form>
+<script type=\"text/javascript\">updateBlockOptions()</script>
+\n" );
$wgOut->addHtml( $this->getConvenienceLinks() );
--- /dev/null
+
+function considerChangingExpiryFocus() {
+ if (!document.getElementById) {
+ return;
+ }
+ var drop = document.getElementById('wpBlockExpiry');
+ if (!drop) {
+ return;
+ }
+ var field = document.getElementById('wpBlockOther');
+ if (!field) {
+ return;
+ }
+ var opt = drop.value;
+ if (opt == 'other') {
+ field.style.display = '';
+ } else {
+ field.style.display = 'none';
+ }
+}
+
+function updateBlockOptions() {
+ if (!document.getElementById)
+ return;
+
+ 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}(\/\d+)?$/);
+
+ /*
+ var anonymousCheck = document.getElementById('wpAnonOnly');
+ anonymousCheck.disabled = !isIp && !isEmpty;
+
+ var autoblockCheck = document.getElementById('wpEnableAutoblock');
+ autoblockCheck.disabled = isIp && !isEmpty;
+ */
+
+ var anonymousRow = document.getElementById('wpAnonOnlyRow');
+ anonymousRow.style.display = (!isIp && !isEmpty) ? 'none' : '';
+
+ var autoblockRow = document.getElementById('wpEnableAutoblockRow');
+ autoblockRow.style.display = isIp && !isEmpty ? 'none' : '';
+}
}
}
-
-function considerChangingExpiryFocus() {
- if (!document.getElementById) {
- return;
- }
- var drop = document.getElementById('wpBlockExpiry');
- if (!drop) {
- return;
- }
- var field = document.getElementById('wpBlockOther');
- if (!field) {
- return;
- }
- var opt = drop.value;
- if (opt == 'other') {
- field.style.display = '';
- } else {
- field.style.display = 'none';
- }
-}
-
function scrollEditBox() {
var editBoxEl = document.getElementById("wpTextbox1");
var scrollTopEl = document.getElementById("wpScrolltop");