From 8a7004030ef467527e54b9e281eebbe6da42e20c Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 21 Aug 2009 22:30:23 +0000 Subject: [PATCH] Use Html::input()/autofocus a bunch more places --- includes/Article.php | 8 ++++++-- includes/specials/SpecialBlockip.php | 20 ++++++++++++------- includes/specials/SpecialContributions.php | 5 ++++- .../specials/SpecialDeletedContributions.php | 5 ++++- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 75748f8287..894bf5d9eb 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2638,8 +2638,12 @@ class Article { Xml::label( wfMsg( 'deleteotherreason' ), 'wpReason' ) . " " . - 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' + ) ) . " diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index 559c6886d8..e319ba7954 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -154,11 +154,13 @@ class IPBlockForm { {$mIpaddress} " . - 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' ) ) ). " " @@ -203,8 +205,12 @@ class IPBlockForm { {$mIpbreason} " . - 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() ) ) . " diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index de2444f090..0646ccba82 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -266,7 +266,10 @@ class SpecialContributions extends SpecialPage { 'contribs', 'newbie' , 'newbie', $this->opts['contribs'] == 'newbie' ? true : false ) . '
' . 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' ) ) ) . ' '. '' . Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' . Xml::namespaceSelector( $this->opts['namespace'], '' ) . diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 3e1f7bc240..c63c446718 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -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' ) ) . -- 2.20.1