When the page is visited without a user in context, there is a user
input field which now has autofocus and autocomplete
Change-Id: I31e08b7f950fbdb02e5617e3acf9a136bcdef50b
* @return string Form asking for user name.
*/
protected function userForm( $name ) {
* @return string Form asking for user name.
*/
protected function userForm( $name ) {
+ $this->getOutput()->addModules( 'mediawiki.userSuggest' );
$string = Xml::openElement(
'form',
array( 'method' => 'get', 'action' => wfScript(), 'id' => 'askusername' )
$string = Xml::openElement(
'form',
array( 'method' => 'get', 'action' => wfScript(), 'id' => 'askusername' )
'target',
'emailusertarget',
30,
'target',
'emailusertarget',
30,
+ $name,
+ array(
+ 'class' => 'mw-autocomplete-user', // used by mediawiki.userSuggest
+ 'autofocus' => true,
+ )
) .
' ' .
Xml::submitButton( $this->msg( 'emailusernamesubmit' )->text() ) .
) .
' ' .
Xml::submitButton( $this->msg( 'emailusernamesubmit' )->text() ) .