Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312289

Change subject: Use core HTMLDateTimeField
......................................................................

Use core HTMLDateTimeField

Bug: T146340
Change-Id: I6558775e7759aaac5b0ec05a87d95b68f0afb747
Depends-On: Iaa8b5892b6c3a1f3698cef59684cc3cdc9d483ea
---
M SpecialApiFeatureUsage.php
M extension.json
D htmlform/HTMLDateField.php
D htmlform/HTMLDateRangeField.php
D htmlform/ext.apifeatureusage.htmlform.js
M i18n/en.json
M i18n/qqq.json
M phpcs.xml
8 files changed, 23 insertions(+), 438 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ApiFeatureUsage 
refs/changes/89/312289/1

diff --git a/SpecialApiFeatureUsage.php b/SpecialApiFeatureUsage.php
index 26a90c3..d965053 100644
--- a/SpecialApiFeatureUsage.php
+++ b/SpecialApiFeatureUsage.php
@@ -10,23 +10,13 @@
                $this->setHeaders();
                $this->checkPermissions();
 
-               /** @todo These should be migrated to core, once the jquery.ui
-                * objectors write their own date picker. */
-               if ( !isset( HTMLForm::$typeMappings['date'] ) ||
-                       !isset( HTMLForm::$typeMappings['daterange'] )
-               ) {
-                       HTMLForm::$typeMappings['date'] = 
'ApiFeatureUsage_HTMLDateField';
-                       HTMLForm::$typeMappings['daterange'] = 
'ApiFeatureUsage_HTMLDateRangeField';
-                       $this->getOutput()->addModules( 
'ext.apifeatureusage.htmlform' );
-               }
-
                $request = $this->getRequest();
 
                $conf = ConfigFactory::getDefaultInstance()->makeConfig( 
'ApiFeatureUsage' );
                $this->engine = ApiFeatureUsageQueryEngine::getEngine( $conf );
                list( $start, $end ) = $this->engine->suggestDateRange();
 
-               $form = new HTMLForm( [
+               $form = HTMLForm::factory( 'ooui', [
                        'agent' => [
                                'type' => 'text',
                                'default' => '',
@@ -34,17 +24,17 @@
                                'required' => true,
                        ],
 
-                       'dates' => [
-                               'type' => 'daterange',
-                               'label-message' => 
'apifeatureusage-dates-label',
-                               'layout-message' => 
'apifeatureusage-dates-layout',
-                               'absolute' => true,
+                       'startdate' => [
+                               'type' => 'date',
+                               'label-message' => 
'apifeatureusage-startdate-label',
                                'required' => true,
-                               'allow-sameday' => true,
-                               'default' => [
-                                       $start->format( 'Y-m-d' ),
-                                       $end->format( 'Y-m-d' ),
-                               ],
+                               'default' => $start->format( 'Y-m-d' ),
+                       ],
+                       'enddate' => [
+                               'type' => 'date',
+                               'label-message' => 
'apifeatureusage-enddate-label',
+                               'required' => true,
+                               'default' => $end->format( 'Y-m-d' ),
                        ],
                ], $this->getContext() );
                $form->setMethod( 'get' );
@@ -54,7 +44,9 @@
                $form->setSubmitTextMsg( 'apifeatureusage-submit' );
 
                $form->prepareForm();
-               if ( $request->getCheck( 'wpagent' ) || $request->getCheck( 
'wpdates' ) ) {
+               if ( $request->getCheck( 'wpagent' ) || $request->getCheck( 
'wpstartdate' ) ||
+                       $request->getCheck( 'wpenddate' )
+               ) {
                        $status = $form->trySubmit();
                } else {
                        $status = false;
@@ -121,8 +113,8 @@
 
        public function onSubmit( $data, $form ) {
                $agent = $data['agent'];
-               $start = new MWTimestamp( $data['dates'][0] . 'T00:00:00Z' );
-               $end = new MWTimestamp( $data['dates'][1] . 'T23:59:59Z' );
+               $start = new MWTimestamp( $data['startdate'] . 'T00:00:00Z' );
+               $end = new MWTimestamp( $data['enddate'] . 'T23:59:59Z' );
 
                return $this->engine->execute( $agent, $start, $end );
        }
diff --git a/extension.json b/extension.json
index 2c00f19..bdefccf 100644
--- a/extension.json
+++ b/extension.json
@@ -31,19 +31,12 @@
                "ApiQueryFeatureUsage": "ApiQueryFeatureUsage.php",
                "ApiFeatureUsageQueryEngine": "ApiFeatureUsageQueryEngine.php",
                "ApiFeatureUsageQueryEngineElastica": 
"ApiFeatureUsageQueryEngineElastica.php",
-               "ApiFeatureUsageQueryEngineElasticaConnection": 
"ApiFeatureUsageQueryEngineElastica.php",
-               "ApiFeatureUsage_HTMLDateField": "htmlform/HTMLDateField.php",
-               "ApiFeatureUsage_HTMLDateRangeField": 
"htmlform/HTMLDateRangeField.php"
+               "ApiFeatureUsageQueryEngineElasticaConnection": 
"ApiFeatureUsageQueryEngineElastica.php"
        },
        "ResourceModules": {
                "ext.apifeatureusage": {
                        "styles": "ext.apifeatureusage.css",
                        "position": "top"
-               },
-               "ext.apifeatureusage.htmlform": {
-                       "localBasePath": "htmlform",
-                       "remoteExtPath": "ApiFeatureUsage/htmlform",
-                       "scripts": "ext.apifeatureusage.htmlform.js"
                }
        },
        "ResourceFileModulePaths": {
diff --git a/htmlform/HTMLDateField.php b/htmlform/HTMLDateField.php
deleted file mode 100644
index e9a098b..0000000
--- a/htmlform/HTMLDateField.php
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-
-/**
- * A field that will contain a date
- *
- * Currently recognizes only YYYY-MM-DD formatted dates.
- *
- * Besides the parameters recognized by HTMLTextField, additional recognized
- * parameters in the field descriptor array include:
- *  min - The minimum date to allow, in any recognized format.
- *  max - The maximum date to allow, in any recognized format.
- *  placeholder - The default comes from the htmlform-date-placeholder message.
- *
- * The result is a formatted date.
- *
- *  @todo These should be migrated to core, once the jquery.ui objectors write
- *  their own date picker.
- */
-class ApiFeatureUsage_HTMLDateField extends HTMLTextField {
-       function getSize() {
-               return isset( $this->mParams['size'] ) ? $this->mParams['size'] 
: 10;
-       }
-
-       public function getAttributes( array $list ) {
-               $parentList = array_diff( $list, array( 'min', 'max' ) );
-               $ret = parent::getAttributes( $parentList );
-
-               if ( in_array( 'placeholder', $list ) && !isset( 
$ret['placeholder'] ) ) {
-                       $ret['placeholder'] = $this->msg( 
'apifeatureusage-htmlform-date-placeholder' )->text();
-               }
-
-               if ( in_array( 'min', $list ) && isset( $this->mParams['min'] ) 
) {
-                       $min = $this->parseDate( $this->mParams['min'] );
-                       if ( $min ) {
-                               $ret['min'] = $this->formatDate( $min );
-                               // Because Html::expandAttributes filters it out
-                               $ret['data-min'] = $ret['min'];
-                       }
-               }
-               if ( in_array( 'max', $list ) && isset( $this->mParams['max'] ) 
) {
-                       $max = $this->parseDate( $this->mParams['max'] );
-                       if ( $max ) {
-                               $ret['max'] = $this->formatDate( $max );
-                               // Because Html::expandAttributes filters it out
-                               $ret['data-max'] = $ret['max'];
-                       }
-               }
-
-               $ret['type'] = 'date';
-
-               return $ret;
-       }
-
-       function loadDataFromRequest( $request ) {
-               if ( !$request->getCheck( $this->mName ) ) {
-                       return $this->getDefault();
-               }
-
-               $value = $request->getText( $this->mName );
-               $date = $this->parseDate( $value );
-               return $date ? $this->formatDate( $date ) : $value;
-       }
-
-       function validate( $value, $alldata ) {
-               $p = parent::validate( $value, $alldata );
-
-               if ( $p !== true ) {
-                       return $p;
-               }
-
-               if ( $value === '' ) {
-                       // required was already checked by parent::validate
-                       return true;
-               }
-
-               $date = $this->parseDate( $value );
-               if ( !$date ) {
-                       return $this->msg( 
'apifeatureusage-htmlform-date-invalid' )->parseAsBlock();
-               }
-
-               if ( isset( $this->mParams['min'] ) ) {
-                       $min = $this->parseDate( $this->mParams['min'] );
-                       if ( $min && $date < $min ) {
-                               return $this->msg( 
'apifeatureusage-htmlform-date-toolow', $this->formatDate( $min ) )
-                                       ->parseAsBlock();
-                       }
-               }
-
-               if ( isset( $this->mParams['max'] ) ) {
-                       $max = $this->parseDate( $this->mParams['max'] );
-                       if ( $max && $date > $max ) {
-                               return $this->msg( 
'apifeatureusage-htmlform-date-toohigh', $this->formatDate( $max ) )
-                                       ->parseAsBlock();
-                       }
-               }
-
-               return true;
-       }
-
-       protected function parseDate( $value ) {
-               $value = trim( $value );
-
-               /* @todo: Language should probably provide a "parseDate" method 
of some sort. */
-               try {
-                       $date = new DateTime( "$value T00:00:00+0000", new 
DateTimeZone( 'GMT' ) );
-                       return $date->getTimestamp();
-               } catch ( Exception $ex ) {
-                       return 0;
-               }
-       }
-
-       protected function formatDate( $value ) {
-               // For now just use Y-m-d. At some point someone may want to 
add a
-               // config option.
-               return gmdate( 'Y-m-d', $value );
-       }
-
-}
diff --git a/htmlform/HTMLDateRangeField.php b/htmlform/HTMLDateRangeField.php
deleted file mode 100644
index 7cb81dd..0000000
--- a/htmlform/HTMLDateRangeField.php
+++ /dev/null
@@ -1,212 +0,0 @@
-<?php
-
-/**
- * A field that will contain a date range
- *
- * Besides the parameters recognized by HTMLDateField, additional recognized
- * parameters in the field descriptor array include:
- *   absolute - Boolean, whether to select the end date absolutely rather
- *     than as a number of days offset from the start date.
- *   options - If specified, the "number of days" field is displayed as a
- *     <select>. Otherwise it's an 'int' textbox.
- *   min-days - If the "number of days" field is a textbox, this is the minimum
- *     allowed. If less than 1, 1 is used.
- *   max-days - If the "number of days" field is a textbox, this is the maximum
- *     allowed.
- *   layout-message - The starting date field (as $1) and "number of days" or
- *     ending date field (as $2) are layed out using this message. Default is
- *     'apifeatureusage-htmlform-daterange-relative-layout' or
- *     'apifeatureusage-htmlform-daterange-absolute-layout', depending on 
'absolute'.
- *   allow-sameday - If true, allows start and end to be the same
- *
- * The result is an empty array or an array with two values, the first being
- * the starting date and the second being either the number of days or the
- * ending date.
- *
- *  @todo These should be migrated to core, once the jquery.ui objectors write
- *  their own date picker.
- */
-class ApiFeatureUsage_HTMLDateRangeField extends ApiFeatureUsage_HTMLDateField 
{
-       function loadDataFromRequest( $request ) {
-               $absolute = !empty( $this->mParams['absolute'] );
-               if ( !$request->getCheck( $this->mName ) ||
-                       !$request->getCheck( $this->mName . ( $absolute ? 
'-end' : '-days' ) )
-               ) {
-                       return $this->getDefault();
-               }
-
-               $value1 = $request->getText( $this->mName );
-               if ( $value1 !== '' ) {
-                       $startDate = $this->parseDate( $value1 );
-                       $value1 = $startDate ? $this->formatDate( $startDate ) 
: $value1;
-               }
-
-               if ( $absolute ) {
-                       $value2 = $request->getText( $this->mName . '-end' );
-                       if ( $value2 !== '' ) {
-                               $endDate = $this->parseDate( $value2 );
-                               $value2 = $endDate ? $this->formatDate( 
$endDate ) : $value2;
-                       }
-               } else {
-                       $value2 = $request->getText( $this->mName . '-days' );
-               }
-
-               if ( $value1 === '' && ( !$absolute || $value2 === '' ) ) {
-                       return array();
-               }
-
-               return array( $value1, $value2 );
-       }
-
-       function validate( $value, $alldata ) {
-               if ( $this->isHidden( $alldata ) ) {
-                       return true;
-               }
-
-               if ( $value === array() ) {
-                       if ( isset( $this->mParams['required'] ) && 
$this->mParams['required'] !== false ) {
-                               return $this->msg( 'htmlform-required' 
)->parse();
-                       }
-                       return true;
-               }
-
-               $p = parent::validate( $value[0], $alldata );
-               if ( $p !== true ) {
-                       return $p;
-               }
-
-               if ( !empty( $this->mParams['absolute'] ) ) {
-                       if ( $value[0] === '' || $value[1] === '' ) {
-                               return $this->msg( 
'apifeatureusage-htmlform-daterange-error-partial' )->parse();
-                       }
-
-                       $endDate = $value[1];
-                       if ( $this->parseDate( $value[0] ) > $this->parseDate( 
$value[1] ) ) {
-                               return $this->msg( 
'apifeatureusage-htmlform-daterange-end-before-start' )->parseAsBlock();
-                       }
-                       if ( empty( $this->mParams['allow-sameday'] ) &&
-                               $this->parseDate( $value[0] ) == 
$this->parseDate( $value[1] )
-                       ) {
-                               return $this->msg( 
'apifeatureusage-htmlform-daterange-end-equals-start' )->parseAsBlock();
-                       }
-               } else {
-                       $opts = $this->getOptions();
-                       if ( $opts ) {
-                               if ( !in_array( $value[1], $opts ) ) {
-                                       return $this->msg( 
'apifeatureusage-htmlform-daterange-days-badoption' )->parseAsBlock();
-                               }
-                       } else {
-                               if ( !preg_match( '/^(\+|\-)?\d+$/', trim( 
$value[1] ) ) ) {
-                                       return $this->msg( 
'apifeatureusage-htmlform-daterange-days-invalid' )->parseAsBlock();
-                               }
-
-                               if ( isset( $this->mParams['min-days'] ) ) {
-                                       $min = max( 1, 
$this->mParams['min-days'] );
-                               } else {
-                                       $min = 1;
-                               }
-                               if ( $min > $value[1] ) {
-                                       return $this->msg( 
'apifeatureusage-htmlform-daterange-days-toolow' )->numParams( $min )
-                                               ->parseAsBlock();
-                               }
-
-                               if ( isset( $this->mParams['max-days'] ) ) {
-                                       $max = $this->mParams['max-days'];
-
-                                       if ( $max < $value[1] ) {
-                                               return $this->msg( 
'apifeatureusage-htmlform-daterange-days-toohigh' )->numParams( $max )
-                                                       ->parseAsBlock();
-                                       }
-                               }
-                       }
-
-                       $endDate = $this->formatDate( $this->parseDate( 
$value[0] ) + $value[1] * 86400 );
-               }
-
-               $p = parent::validate( $endDate, $alldata );
-               if ( $p !== true ) {
-                       return $p;
-               }
-
-               return true;
-       }
-
-       function getInputHTML( $value ) {
-               if ( $value === array() ) {
-                       $value = array( '', '' );
-               }
-
-               $startpicker = parent::getInputHTML( $value[0] );
-
-               if ( !empty( $this->mParams['absolute'] ) ) {
-                       $msg = 
'apifeatureusage-htmlform-daterange-absolute-layout';
-                       $oldName = $this->mName;
-                       $oldID= $this->mID;
-                       $this->mName .= '-end';
-                       $this->mID .= '-end';
-                       $endpicker = parent::getInputHTML( $value[1] );
-                       $this->mName = $oldName;
-                       $this->mID = $oldID;
-               } else {
-                       $msg = 
'apifeatureusage-htmlform-daterange-relative-layout';
-                       $opts = $this->getOptions();
-                       if ( $opts ) {
-                               $select = new XmlSelect(
-                                       $this->mName . '-days', $this->mID . 
'-days', strval( $value[1] )
-                               );
-
-                               if ( !empty( $this->mParams['disabled'] ) ) {
-                                       $select->setAttribute( 'disabled', 
'disabled' );
-                               }
-
-                               if ( isset( $this->mParams['tabindex'] ) ) {
-                                       $select->setAttribute( 'tabindex', 
$this->mParams['tabindex'] );
-                               }
-
-                               if ( $this->mClass !== '' ) {
-                                       $select->setAttribute( 'class', 
$this->mClass );
-                               }
-
-                               $select->addOptions( $this->getOptions() );
-
-                               $endpicker = $select->getHTML();
-                       } else {
-                               $textAttribs = array(
-                                       'id' => $this->mID . '-days',
-                                       'size' => $this->getSize(),
-                                       'min' => 1,
-                               );
-
-                               if ( $this->mClass !== '' ) {
-                                       $textAttribs['class'] = $this->mClass;
-                               }
-
-                               $allowedParams = array(
-                                       'required',
-                                       'autofocus',
-                                       'disabled',
-                                       'tabindex'
-                               );
-
-                               $textAttribs += $this->getAttributes( 
$allowedParams );
-
-                               if ( isset( $this->mParams['min-days'] ) ) {
-                                       $textAttribs['min'] = max( 1, 
$this->mParams['min-days'] );
-                               }
-
-                               if ( isset( $this->mParams['max-days'] ) ) {
-                                       $textAttribs['max'] = 
$this->mParams['max-days'];
-                               }
-
-                               $endpicker = Html::input( $this->mName . 
'-days', $value[1], 'number', $textAttribs );
-                       }
-               }
-
-               if ( isset( $this->mParams['layout-message'] ) ) {
-                       $msg = $this->mParams['layout-message'];
-               }
-
-               return $this->msg( $msg )->rawParams( $startpicker, $endpicker 
)->parse();
-       }
-
-}
diff --git a/htmlform/ext.apifeatureusage.htmlform.js 
b/htmlform/ext.apifeatureusage.htmlform.js
deleted file mode 100644
index 212d70a..0000000
--- a/htmlform/ext.apifeatureusage.htmlform.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Utility functions for HTMLForm date picker
- */
-( function ( mw, $ ) {
-
-       mw.hook( 'htmlform.enhance' ).add( function ( $root ) {
-               var inputs, i;
-
-               inputs = $root.find( 'input[type=date]' );
-               if ( inputs.length === 0 ) {
-                       return;
-               }
-
-               // Assume that if the browser implements validation for <input 
type=date>
-               // (so it rejects "bogus" as a value) then it supports a date 
picker too.
-               i = document.createElement( 'input' );
-               i.setAttribute( 'type', 'date' );
-               i.value = 'bogus';
-               if ( i.value === 'bogus' ) {
-                       mw.loader.using( 'jquery.ui.datepicker', function () {
-                               inputs.each( function () {
-                                       var $i = $( this );
-                                       // Reset the type, Just In Case
-                                       $i.prop( 'type', 'text' );
-                                       $i.datepicker( {
-                                               dateFormat: 'yy-mm-dd',
-                                               constrainInput: true,
-                                               showOn: 'focus',
-                                               changeMonth: true,
-                                               changeYear: true,
-                                               showButtonPanel: true,
-                                               minDate: $i.data( 'min' ),
-                                               maxDate: $i.data( 'max' ),
-                                       } );
-                               } );
-                       } );
-               }
-       } );
-
-}( mediaWiki, jQuery ) );
diff --git a/i18n/en.json b/i18n/en.json
index d054745..aca2aae 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -10,8 +10,8 @@
        "apifeatureusage-legend": "API feature usage",
        "apifeatureusage-text": "",
        "apifeatureusage-agent-label": "User agent:",
-       "apifeatureusage-dates-label": "Date range:",
-       "apifeatureusage-dates-layout": "$1 – $2",
+       "apifeatureusage-startdate-label": "Start date:",
+       "apifeatureusage-enddate-label": "End date:",
        "apifeatureusage-submit": "Fetch data",
        "apifeatureusage-no-indexes": "No data is available for the specified 
date range.",
        "apifeatureusage-missing-indexes": "No data is available for part of 
the specified date range.",
@@ -24,20 +24,5 @@
        "apihelp-query+featureusage-param-end": "End of date range to query.",
        "apihelp-query+featureusage-param-agent": "User agent to query. If not 
specified, the agent in the request will be queried.",
        "apihelp-query+featureusage-param-features": "If specified, return 
details on only these features.",
-       "apihelp-query+featureusage-example-simple": "Query feature usage for 
the current user agent",
-
-       "apifeatureusage-htmlform-date-placeholder": "YYYY-MM-DD",
-       "apifeatureusage-htmlform-date-invalid": "The value you specified is 
not a recognized date. Try using YYYY-MM-DD format.",
-       "apifeatureusage-htmlform-date-toolow": "The value you specified is 
before the earliest allowed date of $1.",
-       "apifeatureusage-htmlform-date-toohigh": "The value you specified is 
after the latest allowed date of $1.",
-       "apifeatureusage-htmlform-daterange-relative-layout": "Start on $1 and 
run for $2 days",
-       "apifeatureusage-htmlform-daterange-absolute-layout": "Start on $1 and 
end on $2",
-       "apifeatureusage-htmlform-daterange-days-badoption": "The value you 
specified for the number of days to run is not a valid option.",
-       "apifeatureusage-htmlform-daterange-days-invalid": "The value you 
specified for the number of days to run is not an integer.",
-       "apifeatureusage-htmlform-daterange-days-toolow": "The value you 
specified for the number of days to run is below the minimum of 
{{PLURAL:$1|$1}}.",
-       "apifeatureusage-htmlform-daterange-days-toohigh": "The value you 
specified for the number of days to run is above the maximum of 
{{PLURAL:$1|$1}}.",
-       "apifeatureusage-htmlform-daterange-end-before-start": "The end date 
given is before the start date.",
-       "apifeatureusage-htmlform-daterange-end-equals-start": "The end date 
given is the same as the start date.",
-       "apifeatureusage-htmlform-daterange-error-partial": "Both date fields 
must be filled or left empty.",
-       "apifeatureusage-htmlform-radiorange-missing-message": "Please specify 
a value for column $1"
+       "apihelp-query+featureusage-example-simple": "Query feature usage for 
the current user agent"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 91e9c53..8de6a2c 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -15,8 +15,8 @@
        "apifeatureusage-legend": "Used as a fieldset legend on 
[[Special:ApiFeatureUsage]].",
        "apifeatureusage-text": "{{ignore}} Displayed above the form on 
[[Special:ApiFeatureUsage]].",
        "apifeatureusage-agent-label": "Form field label on 
[[Special:ApiFeatureUsage]].\n\nSee definition of [[w:User agent|user agent]] 
on Wikipedia.\n{{Identical|User agent}}",
-       "apifeatureusage-dates-label": "Form field label on 
[[Special:ApiFeatureUsage]]. The user can enter two dates to restrict the 
search to the interval of time between those dates.\n{{Identical|Date range}}",
-       "apifeatureusage-dates-layout": "{{optional}} Used to lay out the text 
fields for the date range input on 
[[Special:ApiFeatureUsage]].\n\nParameters:\n* $1 - HTML for the starting date 
control.\n* $2 - HTML for the second date control.\nSee also:\n* 
{{msg-mw|apifeatureusage-htmlform-daterange-absolute-layout}}",
+       "apifeatureusage-startdate-label": "Form field label on 
[[Special:ApiFeatureUsage]].",
+       "apifeatureusage-enddate-label": "Form field label on 
[[Special:ApiFeatureUsage]].",
        "apifeatureusage-submit": "Submit button label on 
[[Special:ApiFeatureUsage]].",
        "apifeatureusage-no-indexes": "Used as a warning message.",
        "apifeatureusage-missing-indexes": "Used as a warning message.",
@@ -29,19 +29,5 @@
        "apihelp-query+featureusage-param-end": 
"{{doc-apihelp-param|query+featureusage|end}}",
        "apihelp-query+featureusage-param-agent": 
"{{doc-apihelp-param|query+featureusage|agent|info=See definition of [[w:User 
agent|user agent]] on Wikipedia.}}",
        "apihelp-query+featureusage-param-features": 
"{{doc-apihelp-param|query+featureusage|features}}",
-       "apihelp-query+featureusage-example-simple": 
"{{doc-apihelp-example|query+featureusage|info=See definition of [[w:User 
agent|user agent]] on Wikipedia.}}",
-       "apifeatureusage-htmlform-date-placeholder": "Used as initial 
placeholder text in \"date\" input boxes. This date MUST be formatted in the 
https://en.wikipedia.org/wiki/ISO_8601 format. You can localise the letters to 
your language or script, but you should not change the format.",
-       "apifeatureusage-htmlform-date-invalid": "Used as error message in HTML 
forms. This date MUST be formatted in the 
https://en.wikipedia.org/wiki/ISO_8601 format. You can localise the letters to 
your language or script, but you should not change the format.\n\n* 
{{msg-mw|Htmlform-invalid-input}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-placeholder}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-toolow}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-toohigh}}\n* 
{{msg-mw|Htmlform-required}}",
-       "apifeatureusage-htmlform-date-toolow": "Used as error message in HTML 
forms. Parameters:\n* $1 - minimum date\nSee also:\n* 
{{msg-mw|Htmlform-invalid-input}}\n* {{msg-mw|Htmlform-required}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-invalid}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-toohigh}}",
-       "apifeatureusage-htmlform-date-toohigh": "Used as error message in HTML 
forms. Parameters:\n* $1 - maximum date\nSee also:\n* 
{{msg-mw|Htmlform-invalid-input}}\n* {{msg-mw|Htmlform-required}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-invalid}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-toolow}}",
-       "apifeatureusage-htmlform-daterange-relative-layout": "Used to give 
context to the form fields in an HTML form date-range element.\n* $1 - HTML for 
the starting date control\n* $2 - HTML for the number-of-days control. This is 
an input field to be added by the user and the number is not shown initially, 
so \"days\" should be translated as a generic plural of an unknown number.",
-       "apifeatureusage-htmlform-daterange-absolute-layout": "Used to give 
context to the form fields in an HTML form date-range element.\n* $1 - HTML for 
the starting date control\n* $2 - HTML for the ending date control",
-       "apifeatureusage-htmlform-daterange-days-badoption": "Used as error 
message in HTML forms.\n\n* {{msg-mw|Htmlform-invalid-input}}\n* 
{{msg-mw|Htmlform-required}}\n* {{msg-mw|Htmlform-int-invalid}}\n* 
{{msg-mw|Htmlform-int-toolow}}\n* {{msg-mw|Htmlform-int-toohigh}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-invalid}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-toolow}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-toohigh}}\n* 
{{msg-mw|Apifeatureusage-htmlform-daterange-invalid}}\n* 
{{msg-mw|Apifeatureusage-htmlform-daterange-toolow}}\n* 
{{msg-mw|Apifeatureusage-htmlform-daterange-toohigh}}",
-       "apifeatureusage-htmlform-daterange-days-invalid": "Used as error 
message in HTML forms.\n\n* {{msg-mw|Htmlform-invalid-input}}\n* 
{{msg-mw|Htmlform-required}}\n* {{msg-mw|Htmlform-int-invalid}}\n* 
{{msg-mw|Htmlform-int-toolow}}\n* {{msg-mw|Htmlform-int-toohigh}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-invalid}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-toolow}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-toohigh}}\n* 
{{msg-mw|Apifeatureusage-htmlform-daterange-badoption}}\n* 
{{msg-mw|Apifeatureusage-htmlform-daterange-toolow}}\n* 
{{msg-mw|Apifeatureusage-htmlform-daterange-toohigh}}",
-       "apifeatureusage-htmlform-daterange-days-toolow": "Used as error 
message in HTML forms. Parameters:\n* $1 - minimum value\nSee also:\n* 
{{msg-mw|Htmlform-invalid-input}}\n* {{msg-mw|Htmlform-required}}\n* 
{{msg-mw|Htmlform-int-invalid}}\n* {{msg-mw|Htmlform-int-toolow}}\n* 
{{msg-mw|Htmlform-int-toohigh}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-invalid}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-toolow}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-toohigh}}\n* 
{{msg-mw|Apifeatureusage-htmlform-daterange-badoption}}\n* 
{{msg-mw|Apifeatureusage-htmlform-daterange-invalid}}\n* 
{{msg-mw|Apifeatureusage-htmlform-daterange-toohigh}}",
-       "apifeatureusage-htmlform-daterange-days-toohigh": "Used as error 
message in HTML forms. Parameters:\n* $1 - maximum value\nSee also:\n* 
{{msg-mw|Htmlform-invalid-input}}\n* {{msg-mw|Htmlform-required}}\n* 
{{msg-mw|Htmlform-int-invalid}}\n* {{msg-mw|Htmlform-int-toolow}}\n* 
{{msg-mw|Htmlform-int-toohigh}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-invalid}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-toolow}}\n* 
{{msg-mw|Apifeatureusage-htmlform-date-toohigh}}\n* 
{{msg-mw|Apifeatureusage-htmlform-daterange-badoption}}\n* 
{{msg-mw|Apifeatureusage-htmlform-daterange-invalid}}\n* 
{{msg-mw|Apifeatureusage-htmlform-daterange-toolow}}",
-       "apifeatureusage-htmlform-daterange-end-before-start": "Used as error 
message in HTML forms.",
-       "apifeatureusage-htmlform-daterange-end-equals-start": "Used as error 
message in HTML forms.",
-       "apifeatureusage-htmlform-daterange-error-partial": "Used as error 
message in HTML forms.",
-       "apifeatureusage-htmlform-radiorange-missing-message": "Used as error 
message in HTML forms. Parameters:\n* $1 - Column number"
+       "apihelp-query+featureusage-example-simple": 
"{{doc-apihelp-example|query+featureusage|info=See definition of [[w:User 
agent|user agent]] on Wikipedia.}}"
 }
diff --git a/phpcs.xml b/phpcs.xml
index 9c09ce9..d81a292 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -5,5 +5,4 @@
        <arg name="extensions" value="php,php5,inc"/>
        <arg name="encoding" value="utf8"/>
        <exclude-pattern>vendor</exclude-pattern>
-       <exclude-pattern>htmlform</exclude-pattern>
 </ruleset>

-- 
To view, visit https://gerrit.wikimedia.org/r/312289
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6558775e7759aaac5b0ec05a87d95b68f0afb747
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ApiFeatureUsage
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to