$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,
$buttonLabel = $this->context->msg( $this->getSaveButtonLabel() )->text();
$attribs = [
- 'id' => 'wpSave',
+ 'id' => 'wpSaveWidget',
+ 'inputId' => 'wpSave',
'name' => 'wpSave',
'tabindex' => ++$tabindex,
] + Linker::tooltipAndAccesskeyAttribs( 'save' );
}
$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' );
// Make sure edit summary does not exceed byte limit
// TODO: Replace with this when $wgOOUIEditPage is removed:
// OO.ui.infuse( 'wpSummary' ).$input.byteLimit( 255 );
- $( 'input#wpSummary, #wpSummary > input' ).byteLimit( 255 );
+ $( '#wpSummary' ).byteLimit( 255 );
// Restore the edit box scroll state following a preview operation,
// and set up a form submission handler to remember this state.