Use Html::input()/autofocus a bunch more places
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 21 Aug 2009 22:30:23 +0000 (22:30 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 21 Aug 2009 22:30:23 +0000 (22:30 +0000)
includes/Article.php
includes/specials/SpecialBlockip.php
includes/specials/SpecialContributions.php
includes/specials/SpecialDeletedContributions.php

index 75748f8..894bf5d 100644 (file)
@@ -2638,8 +2638,12 @@ class Article {
                                        Xml::label( wfMsg( 'deleteotherreason' ), 'wpReason' ) .
                                "</td>
                                <td class='mw-input'>" .
-                                       Xml::input( 'wpReason', 60, $reason, array( 'type' => 'text', 'maxlength' => '255',
-                                               'tabindex' => '2', 'id' => 'wpReason' ) ) .
+                               Html::input( 'wpReason', $reason, 'text', array(
+                                       'maxlength' => '255',
+                                       'tabindex' => '2',
+                                       'id' => 'wpReason',
+                                       'autofocus'
+                               ) ) .
                                "</td>
                        </tr>
                        <tr>
index 559c688..e319ba7 100644 (file)
@@ -154,11 +154,13 @@ class IPBlockForm {
                                        {$mIpaddress}
                                </td>
                                <td class='mw-input'>" .
-                                       Xml::input( 'wpBlockAddress', 45, $this->BlockAddress,
-                                               array(
-                                                       'tabindex' => '1',
-                                                       'id' => 'mw-bi-target',
-                                                       'onchange' => 'updateBlockOptions()' ) ). "
+                                       Html::input( 'wpBlockAddress', $this->BlockAddress, 'text', array(
+                                               'tabindex' => '1',
+                                               'id' => 'mw-bi-target',
+                                               'onchange' => 'updateBlockOptions()',
+                                               'size' => '45',
+                                               'required' => ''
+                                       ) + ( $this->BlockAddress ? array() : array( 'autofocus' ) ) ). "
                                </td>
                        </tr>
                        <tr>"
@@ -203,8 +205,12 @@ class IPBlockForm {
                                        {$mIpbreason}
                                </td>
                                <td class='mw-input'>" .
-                                       Xml::input( 'wpBlockReason', 45, $this->BlockReason,
-                                               array( 'tabindex' => '5', 'id' => 'mw-bi-reason', 'maxlength'=> '200' ) ) . "
+                               Html::input( 'wpBlockReason', $this->BlockReason, 'text', array(
+                                       'tabindex' => '5',
+                                       'id' => 'mw-bi-reason',
+                                       'maxlength' => '200',
+                                       'size' => '45'
+                               ) + ( $this->BlockAddress ? array( 'autofocus' ) : array() ) ) . "
                                </td>
                        </tr>
                        <tr id='wpAnonOnlyRow'>
index de2444f..0646ccb 100644 (file)
@@ -266,7 +266,10 @@ class SpecialContributions extends SpecialPage {
                                'contribs', 'newbie' , 'newbie', $this->opts['contribs'] == 'newbie' ? true : false ) . '<br />' .
                        Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parsemag' ) ), 
                                'contribs' , 'user', 'user', $this->opts['contribs'] == 'user' ? true : false ) . ' ' .
-                       Xml::input( 'target', 20, $this->opts['target']) . ' '.
+                       Html::input( 'target', $this->opts['target'], 'text', array(
+                               'size' => '20',
+                               'required' => ''
+                       ) + ( $this->opts['target'] ? array() : array( 'autofocus' ) ) ) . ' '.
                        '<span style="white-space: nowrap">' .
                        Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
                        Xml::namespaceSelector( $this->opts['namespace'], '' ) .
index 3e1f7bc..c63c446 100644 (file)
@@ -418,7 +418,10 @@ class DeletedContributionsPage extends SpecialPage {
                $f .=  Xml::openElement( 'fieldset' ) .
                        Xml::element( 'legend', array(), wfMsg( 'sp-contributions-search' ) ) .
                        Xml::tags( 'label', array( 'for' => 'target' ), wfMsgExt( 'sp-contributions-username', 'parseinline' ) ) . ' ' .
-                       Xml::input( 'target', 20, $options['target']) . ' '.
+                       Html::input( 'target', $options['target'], 'text', array(
+                               'size' => '20',
+                               'required' => ''
+                       ) + ( $options['target'] ? array() : array( 'autofocus' ) ) ) . ' '.
                        Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
                        Xml::namespaceSelector( $options['namespace'], '' ) . ' ' .
                        Xml::submitButton( wfMsg( 'sp-contributions-submit' ) ) .