Merge "Add help links for throttle groups"

This commit is contained in:
jenkins-bot 2019-03-17 09:59:25 +00:00 committed by Gerrit Code Review
commit 001a83272d
2 changed files with 22 additions and 10 deletions

View file

@ -588,7 +588,13 @@ class AbuseFilterViewEdit extends AbuseFilterView {
$this->msg( 'abusefilter-edit-throttle-groups' )->parse()
),
'align' => 'top',
'id' => 'mw-abusefilter-hidden-throttle'
'id' => 'mw-abusefilter-hidden-throttle',
'help' => new OOUI\HtmlSnippet(
'See <a href="https://www.mediawiki.org/wiki/Special:MyLanguage/' .
'Extension:AbuseFilter/Actions#Throttling" target="_blank">' .
'mediawiki.org</a>.'
),
'helpInline' => true
]
);

View file

@ -389,7 +389,7 @@
var $container = $( '#mw-abusefilter-' + action + '-parameters' ),
// Character used to separate elements in the textarea.
separator = action === 'throttle' ? '\n' : ',',
selector, field, hiddenField;
selector, field, fieldOpts, hiddenField;
selector =
new OO.ui.TagMultiselectWidget( {
@ -401,14 +401,20 @@
placeholder: OO.ui.msg( 'abusefilter-edit-' + action + '-placeholder' ),
disabled: config.disabled
} );
field =
new OO.ui.FieldLayout(
selector,
{
label: $( $.parseHTML( config.label ) ),
align: 'top'
}
);
fieldOpts = {
label: $( $.parseHTML( config.label ) ),
align: 'top'
};
if ( action === 'throttle' ) {
fieldOpts.help =
new OO.ui.HtmlSnippet(
'See <a href="https://www.mediawiki.org/wiki/Special:MyLanguage/' +
'Extension:AbuseFilter/Actions#Throttling" target="_blank">' +
'mediawiki.org</a>.' );
}
field = new OO.ui.FieldLayout( selector, fieldOpts );
// mw-abusefilter-hidden-throttle-field, mw-abusefilter-hidden-tag-field
hiddenField = OO.ui.infuse( $( '#mw-abusefilter-hidden-' + action + '-field' ) );