mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-09-24 02:38:16 +00:00
Merge "Move the throttle help tooltip to a message"
This commit is contained in:
commit
c8021a520a
|
@ -200,6 +200,8 @@
|
|||
"abusefilter-edit-throttle-count": "Number of actions to allow:",
|
||||
"abusefilter-edit-throttle-period": "Period of time (in seconds):",
|
||||
"abusefilter-edit-throttle-groups": "Group throttle by:",
|
||||
"abusefilter-edit-throttle-groups-help": "See $1.",
|
||||
"abusefilter-edit-throttle-groups-help-text": "the documentation on mediawiki.org",
|
||||
"abusefilter-edit-throttle-hidden-placeholder": "Split with commas to join with AND, and with linebreaks to join with OR",
|
||||
"abusefilter-edit-throttle-placeholder": "Split with commas to join with AND, and insert one by one to join with OR",
|
||||
"abusefilter-throttle-ip": "IP address",
|
||||
|
|
|
@ -234,6 +234,8 @@
|
|||
"abusefilter-edit-throttle-count": "Field label for entering the number of allowed hits before triggering the filter consequences.",
|
||||
"abusefilter-edit-throttle-period": "Field label for entering a time period in seconds.\n{{Identical|Second}}",
|
||||
"abusefilter-edit-throttle-groups": "Field label for properties to group throttle counts by (for example IP address and username). Throttling is the concept of limiting occurrences of a certain action in a given time frame.",
|
||||
"abusefilter-edit-throttle-groups-help": "Message for a help tooltip next to the throttle groups field. Parameters:\n* $1 - A help link, pointing to mediawiki.org.\n\nSee also:\n* {{msg-mw|abusefilter-edit-throttle-groups-help-text}}",
|
||||
"abusefilter-edit-throttle-groups-help-text": "Text for a help link next to the throttle groups field.\n\nSee also:\n* {{msg-mw|abusefilter-edit-throttle-groups-help}}",
|
||||
"abusefilter-edit-throttle-hidden-placeholder": "Label for a textarea where users may insert throttling criteria.",
|
||||
"abusefilter-edit-throttle-placeholder": "Label for an input field where users may insert throttling criteria.",
|
||||
"abusefilter-throttle-ip": "Throttle option. The first letter is meant to be lowercase.",
|
||||
|
|
|
@ -564,13 +564,17 @@ class AbuseFilterViewEdit extends AbuseFilterView {
|
|||
]
|
||||
);
|
||||
|
||||
$throttleConfig = [
|
||||
'values' => $throttleGroups,
|
||||
'label' => $this->msg( 'abusefilter-edit-throttle-groups' )->parse(),
|
||||
'disabled' => $readOnly
|
||||
];
|
||||
$this->getOutput()->addJsConfigVars( 'throttleConfig', $throttleConfig );
|
||||
|
||||
$groupsHelpLink = Html::element(
|
||||
'a',
|
||||
[
|
||||
'href' => 'https://www.mediawiki.org/wiki/Special:MyLanguage/' .
|
||||
'Extension:AbuseFilter/Actions#Throttling',
|
||||
'target' => '_blank'
|
||||
],
|
||||
$this->msg( 'abusefilter-edit-throttle-groups-help-text' )->text()
|
||||
);
|
||||
$groupsHelp = $this->msg( 'abusefilter-edit-throttle-groups-help' )
|
||||
->rawParams( $groupsHelpLink )->escaped();
|
||||
$hiddenGroups =
|
||||
new OOUI\FieldLayout(
|
||||
new OOUI\MultilineTextInputWidget( [
|
||||
|
@ -589,17 +593,21 @@ class AbuseFilterViewEdit extends AbuseFilterView {
|
|||
),
|
||||
'align' => 'top',
|
||||
'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>.'
|
||||
),
|
||||
'help' => new OOUI\HtmlSnippet( $groupsHelp ),
|
||||
'helpInline' => true
|
||||
]
|
||||
);
|
||||
|
||||
$throttleFields['abusefilter-edit-throttle-groups'] = $hiddenGroups;
|
||||
|
||||
$throttleConfig = [
|
||||
'values' => $throttleGroups,
|
||||
'label' => $this->msg( 'abusefilter-edit-throttle-groups' )->parse(),
|
||||
'disabled' => $readOnly,
|
||||
'help' => $groupsHelp
|
||||
];
|
||||
$this->getOutput()->addJsConfigVars( 'throttleConfig', $throttleConfig );
|
||||
|
||||
$throttleSettings .=
|
||||
Xml::tags(
|
||||
'div',
|
||||
|
|
|
@ -407,11 +407,7 @@
|
|||
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>.' );
|
||||
fieldOpts.help = new OO.ui.HtmlSnippet( config.help );
|
||||
}
|
||||
|
||||
field = new OO.ui.FieldLayout( selector, fieldOpts );
|
||||
|
|
Loading…
Reference in a new issue