}
}
- $buttonLabelKey = $this->getSaveButtonLabel();
+ $buttonLabel = $this->context->msg( $this->getSaveButtonLabel() )->text();
if ( $this->missingComment ) {
$wgOut->wrapWikiMsg( "<div id='mw-missingcommenttext'>\n$1\n</div>", 'missingcommenttext' );
if ( $this->missingSummary && $this->section != 'new' ) {
$wgOut->wrapWikiMsg(
"<div id='mw-missingsummary'>\n$1\n</div>",
- [ 'missingsummary', $buttonLabelKey ]
+ [ 'missingsummary', $buttonLabel ]
);
}
if ( $this->missingSummary && $this->section == 'new' ) {
$wgOut->wrapWikiMsg(
"<div id='mw-missingcommentheader'>\n$1\n</div>",
- [ 'missingcommentheader', $buttonLabelKey ]
+ [ 'missingcommentheader', $buttonLabel ]
);
}
if ( $this->blankArticle ) {
$wgOut->wrapWikiMsg(
"<div id='mw-blankarticle'>\n$1\n</div>",
- [ 'blankarticle', $buttonLabelKey ]
+ [ 'blankarticle', $buttonLabel ]
);
}
if ( $this->selfRedirect ) {
$wgOut->wrapWikiMsg(
"<div id='mw-selfredirect'>\n$1\n</div>",
- [ 'selfredirect', $buttonLabelKey ]
+ [ 'selfredirect', $buttonLabel ]
);
}
$this->getSummaryInputAttributes( $inputAttrs )
);
+ // For compatibility with old scripts and extensions, we want the legacy 'id' on the `<input>`
+ $inputAttrs['inputId'] = $inputAttrs['id'];
+ $inputAttrs['id'] = 'wpSummaryWidget';
+
return new OOUI\FieldLayout(
new OOUI\TextInputWidget( [
'value' => $summary,
new OOUI\CheckboxInputWidget( [
'tabIndex' => ++$tabindex,
'accessKey' => $accesskey,
- 'id' => $options['id'],
+ 'id' => $options['id'] . 'Widget',
+ 'inputId' => $options['id'],
'name' => $name,
'selected' => $options['default'],
'infusable' => true,
public function getEditButtons( &$tabindex ) {
$buttons = [];
- $buttonLabelKey = $this->getSaveButtonLabel();
+ $buttonLabel = $this->context->msg( $this->getSaveButtonLabel() )->text();
$attribs = [
- 'id' => 'wpSave',
+ 'id' => 'wpSaveWidget',
+ 'inputId' => 'wpSave',
'name' => 'wpSave',
'tabindex' => ++$tabindex,
] + Linker::tooltipAndAccesskeyAttribs( 'save' );
// Support: IE 6 – Use <input>, otherwise it can't distinguish which button was clicked
'useInputTag' => true,
'flags' => [ 'constructive', 'primary' ],
- 'label' => $this->context->msg( $buttonLabelKey )->text(),
+ 'label' => $buttonLabel,
'infusable' => true,
'type' => 'submit',
] + $saveConfig );
} else {
$buttons['save'] = Html::submitButton(
- $this->context->msg( $buttonLabelKey )->text(),
+ $buttonLabel,
$attribs,
[ 'mw-ui-progressive' ]
);
}
$attribs = [
- 'id' => 'wpPreview',
+ 'id' => 'wpPreviewWidget',
+ 'inputId' => 'wpPreview',
'name' => 'wpPreview',
'tabindex' => ++$tabindex,
] + Linker::tooltipAndAccesskeyAttribs( 'preview' );
);
}
$attribs = [
- 'id' => 'wpDiff',
+ 'id' => 'wpDiffWidget',
+ 'inputId' => 'wpDiff',
'name' => 'wpDiff',
'tabindex' => ++$tabindex,
] + Linker::tooltipAndAccesskeyAttribs( 'diff' );
protected function addExplainConflictHeader( OutputPage $out ) {
$out->wrapWikiMsg(
"<div class='mw-explainconflict'>\n$1\n</div>",
- [ 'explainconflict', $this->getSaveButtonLabel() ]
+ [ 'explainconflict', $this->context->msg( $this->getSaveButtonLabel() )->text() ]
);
}