Rename CSS class 'mw-htmlform-field-autoinfuse' to fit the convention

Rename to 'mw-htmlform-autoinfuse'. This avoids the 'mw-htmlform-field-'
prefix normally only used by HTMLFormField subclasses, and matches the
'mw-htmlform-autoinfuse-lazy' class used in related code.

Bug: T278036
Change-Id: I4a73ec6d5993a7e4f10ef8523eef594a70c9abcc
This commit is contained in:
Bartosz Dziewoński 2021-06-13 15:54:17 +02:00
parent 43015c24c2
commit 0feccb0cb1
7 changed files with 8 additions and 6 deletions

View file

@ -438,6 +438,8 @@ because of Phabricator reports.
Not providing one emitted deprecation warnings since 1.36.
* Anti-lock constants ALF_PRELOAD_LINK, ALF_NO_BLOCK_LOCK, ALF_NO_LINK_LOCK
and ALF_PRELOAD_EXISTENCE have been removed. They're unused since 1.25.
* CSS class 'mw-htmlform-field-autoinfuse' used by some forms has been
renamed to 'mw-htmlform-autoinfuse'. (T278036)
* …
== Compatibility ==

View file

@ -642,7 +642,7 @@ abstract class HTMLFormField {
if ( $infusable && $this->shouldInfuseOOUI() ) {
$preloadModules = true;
$config['classes'][] = 'mw-htmlform-field-autoinfuse';
$config['classes'][] = 'mw-htmlform-autoinfuse';
}
// the element could specify, that the label doesn't need to be added

View file

@ -102,7 +102,7 @@ class HTMLNamespacesMultiselectField extends HTMLSelectNamespace {
// Make the field auto-infusable when it's used inside a legacy HTMLForm rather than OOUIHTMLForm
$params['infusable'] = true;
$params['classes'] = [ 'mw-htmlform-field-autoinfuse' ];
$params['classes'] = [ 'mw-htmlform-autoinfuse' ];
$widget = new NamespacesMultiselectWidget( $params );
$widget->setAttributes( [ 'data-mw-modules' => implode( ',', $this->getOOUIModules() ) ] );

View file

@ -109,7 +109,7 @@ class HTMLTagMultiselectField extends HTMLTextField {
// Make the field auto-infusable when it's used inside a legacy HTMLForm rather than OOUIHTMLForm
$params['infusable'] = true;
$params['classes'] = [ 'mw-htmlform-field-autoinfuse' ];
$params['classes'] = [ 'mw-htmlform-autoinfuse' ];
$widget = new TagMultiselectWidget( $params );
$widget->setAttributes( [ 'data-mw-modules' => implode( ',', $this->getOOUIModules() ) ] );

View file

@ -120,7 +120,7 @@ class HTMLTitlesMultiselectField extends HTMLTitleTextField {
// Make the field auto-infusable when it's used inside a legacy HTMLForm rather than OOUIHTMLForm
$params['infusable'] = true;
$params['classes'] = [ 'mw-htmlform-field-autoinfuse' ];
$params['classes'] = [ 'mw-htmlform-autoinfuse' ];
$widget = new TitlesMultiselectWidget( $params );
$widget->setAttributes( [ 'data-mw-modules' => implode( ',', $this->getOOUIModules() ) ] );

View file

@ -130,7 +130,7 @@ class HTMLUsersMultiselectField extends HTMLUserTextField {
// Make the field auto-infusable when it's used inside a legacy HTMLForm rather than OOUIHTMLForm
$params['infusable'] = true;
$params['classes'] = [ 'mw-htmlform-field-autoinfuse' ];
$params['classes'] = [ 'mw-htmlform-autoinfuse' ];
$widget = new UsersMultiselectWidget( $params );
$widget->setAttributes( [ 'data-mw-modules' => implode( ',', $this->getOOUIModules() ) ] );

View file

@ -7,7 +7,7 @@
mw.hook( 'htmlform.enhance' ).add( function ( $root ) {
var $oouiNodes, modules, extraModules;
$oouiNodes = $root.find( '.mw-htmlform-field-autoinfuse' );
$oouiNodes = $root.find( '.mw-htmlform-autoinfuse' );
$oouiNodes = $oouiNodes.filter( function () {
return !$( this ).closest( '.mw-htmlform-autoinfuse-lazy' ).length;