From: robin Date: Mon, 17 Sep 2012 00:52:55 +0000 (+0200) Subject: Use number input type for year in dateMenu X-Git-Tag: 1.31.0-rc.0~22349^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=7405ad3999c633d31ba3e06e8c66c11d9b907933;p=lhc%2Fweb%2Fwiklou.git Use number input type for year in dateMenu Use the HTML5 number input type for the year input field in the dateMenu (used on e.g. history pages), since a year is always a number :) (There was once a year type proposed, but that didn't make it into HTML5) Patchset 2: use Html::input instead of Xml::input (and change the other Xml's to self::) Change-Id: If9ad28566abfc02a164367d7cdd6992939169c0a --- diff --git a/includes/Xml.php b/includes/Xml.php index 120312dd96..4a55d5e7ce 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -198,10 +198,11 @@ class Xml { } else { $encYear = ''; } - return Xml::label( wfMessage( 'year' )->text(), 'year' ) . ' '. - Xml::input( 'year', 4, $encYear, array('id' => 'year', 'maxlength' => 4) ) . ' '. - Xml::label( wfMessage( 'month' )->text(), 'month' ) . ' '. - Xml::monthSelector( $encMonth, -1 ); + $inputAttribs = array( 'id' => 'year', 'maxlength' => 4, 'size' => 7 ); + return self::label( wfMessage( 'year' )->text(), 'year' ) . ' '. + Html::input( 'year', $encYear, 'number', $inputAttribs ) . ' '. + self::label( wfMessage( 'month' )->text(), 'month' ) . ' '. + self::monthSelector( $encMonth, -1 ); } /**