$out->allowClickjacking();
$out->addModuleStyles( [
'mediawiki.special', 'mediawiki.special.search', 'mediawiki.ui', 'mediawiki.ui.button',
- 'mediawiki.ui.input',
+ 'mediawiki.ui.input', 'mediawiki.widgets.SearchInputWidget.styles',
] );
$this->addHelpLink( 'Help:Searching' );
$num = $titleMatchesNum + $textMatchesNum;
$totalRes = $numTitleMatches + $numTextMatches;
+ $out->enableOOUI();
$out->addHTML(
# This is an awful awful ID name. It's not a table, but we
# named it poorly from when this was a table so now we're
* @return string
*/
protected function shortDialog( $term, $resultsShown, $totalNum ) {
- $out = Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() );
- $out .= Html::hidden( 'profile', $this->profile ) . "\n";
- // Term box
- $out .= Html::input( 'search', $term, 'search', [
- 'id' => $this->isPowerSearch() ? 'powerSearchText' : 'searchText',
- 'size' => '50',
+ $searchWidget = new MediaWiki\Widget\SearchInputWidget( [
+ 'id' => 'searchText',
+ 'name' => 'search',
'autofocus' => trim( $term ) === '',
- 'class' => 'mw-ui-input mw-ui-input-inline',
- // identifies the location of the search bar for tracking purposes
- 'data-search-loc' => 'content',
- ] ) . "\n";
- $out .= Html::hidden( 'fulltext', 'Search' ) . "\n";
- $out .= Html::submitButton(
- $this->msg( 'searchbutton' )->text(),
- [ 'class' => 'mw-ui-button mw-ui-progressive' ],
- [ 'mw-ui-progressive' ]
- ) . "\n";
+ 'value' => $term,
+ ] );
+
+ $out =
+ Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) .
+ Html::hidden( 'profile', $this->profile ) .
+ Html::hidden( 'fulltext', 'Search' ) .
+ $searchWidget .
+ new OOUI\ButtonInputWidget( [
+ 'type' => 'submit',
+ 'label' => $this->msg( 'searchbutton' )->text(),
+ 'flags' => [ 'progressive', 'primary' ],
+ ] );
// Results-info
if ( $totalNum > 0 && $this->offset < $totalNum ) {