Bartosz Dziewoński has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354653 )
Change subject: EditPage: Restore the old 'id' attributes in OOUI mode ...................................................................... EditPage: Restore the old 'id' attributes in OOUI mode For compatibility with old scripts and extensions, we want the legacy 'id' on the `<input>` elements. There is really no good justification for breaking all of them when we can easily support it. The actual `<input>` elements have their ids back: 'wpSummary', 'wpSave', 'wpPreview', 'wpDiff', 'wpMinoredit', 'wpWatchthis'. The widgets (wrapped `<div>`s) now use ids with 'Widget' appended. Bug: T165854 Change-Id: I4d23f57fd0cda4b8539ffb17a2a19ecd822e077a --- M includes/EditPage.php M resources/src/mediawiki.action/mediawiki.action.edit.js 2 files changed, 13 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/53/354653/1 diff --git a/includes/EditPage.php b/includes/EditPage.php index 098ffbf..36d2385 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3119,6 +3119,10 @@ $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, @@ -4268,7 +4272,8 @@ new OOUI\CheckboxInputWidget( [ 'tabIndex' => ++$tabindex, 'accessKey' => $accesskey, - 'id' => $options['id'], + 'id' => $options['id'] . 'Widget', + 'inputId' => $options['id'], 'name' => $name, 'selected' => $options['default'], 'infusable' => true, @@ -4330,7 +4335,8 @@ $buttonLabelKey = $this->getSaveButtonLabel(); $attribs = [ - 'id' => 'wpSave', + 'id' => 'wpSaveWidget', + 'inputId' => 'wpSave', 'name' => 'wpSave', 'tabindex' => ++$tabindex, ] + Linker::tooltipAndAccesskeyAttribs( 'save' ); @@ -4354,7 +4360,8 @@ } $attribs = [ - 'id' => 'wpPreview', + 'id' => 'wpPreviewWidget', + 'inputId' => 'wpPreview', 'name' => 'wpPreview', 'tabindex' => ++$tabindex, ] + Linker::tooltipAndAccesskeyAttribs( 'preview' ); @@ -4374,7 +4381,8 @@ ); } $attribs = [ - 'id' => 'wpDiff', + 'id' => 'wpDiffWidget', + 'inputId' => 'wpDiff', 'name' => 'wpDiff', 'tabindex' => ++$tabindex, ] + Linker::tooltipAndAccesskeyAttribs( 'diff' ); diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.js b/resources/src/mediawiki.action/mediawiki.action.edit.js index f6a9c54..4911fb9 100644 --- a/resources/src/mediawiki.action/mediawiki.action.edit.js +++ b/resources/src/mediawiki.action/mediawiki.action.edit.js @@ -22,7 +22,7 @@ // 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. -- To view, visit https://gerrit.wikimedia.org/r/354653 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4d23f57fd0cda4b8539ffb17a2a19ecd822e077a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński <matma....@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits