Merge "(bug 43560) Initial input focus on Special:ListUsers isn't set"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 5 Feb 2013 18:04:35 +0000 (18:04 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 5 Feb 2013 18:04:35 +0000 (18:04 +0000)
1  2 
includes/specials/SpecialListusers.php

@@@ -212,17 -212,26 +212,26 @@@ class UsersPager extends AlphabeticPage
                list( $self ) = explode( '/', $this->getTitle()->getPrefixedDBkey() );
  
                # Form tag
 -              $out  = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listusers-form' ) ) .
 +              $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listusers-form' ) ) .
                        Xml::fieldset( $this->msg( 'listusers' )->text() ) .
                        Html::hidden( 'title', $self );
  
                # Username field
                $out .= Xml::label( $this->msg( 'listusersfrom' )->text(), 'offset' ) . ' ' .
-                       Xml::input( 'username', 20, $this->requestedUser, array( 'id' => 'offset' ) ) . ' ';
+                       Html::input(
+                               'username',
+                               $this->requestedUser,
+                               'text',
+                               array(
+                                       'id' => 'offset',
+                                       'size' => 20,
+                                       'autofocus' => $this->requestedUser === ''
+                               )
+                       ) . ' ';
  
                # Group drop-down list
                $out .= Xml::label( $this->msg( 'group' )->text(), 'group' ) . ' ' .
 -                      Xml::openElement('select',  array( 'name' => 'group', 'id' => 'group' ) ) .
 +                      Xml::openElement( 'select', array( 'name' => 'group', 'id' => 'group' ) ) .
                        Xml::option( $this->msg( 'group-all' )->text(), '' );
                foreach( $this->getAllGroups() as $group => $groupText )
                        $out .= Xml::option( $groupText, $group, $group == $this->requestedGroup );