Expand all

mw.editcheck.TextMatchEditCheckAction

Extends

Constructor

new mw.editcheck.TextMatchEditCheckAction(config) #

TextMatchEditCheckAction

Subclass of EditCheckAction to include information about the matchRule associated with this action

Parameters:

Name Type Description
config Object

Configuration options

Properties:
Name Type Description
matchRuleId string

ID of the matchRule that triggered the match

term string

Term that prompted the action

message string

Message for the action dialog

replacement string

Word or phrase to use as the replacement, if action allows

tagName string

Unique tag name for this matchRule+term pair

Source:

TextMatchEditCheckAction

Subclass of EditCheckAction to include information about the matchRule associated with this action

Methods

discarded() #

Method called by the controller when the action is removed from the action list

Inherited from:
Source:
Method called by the controller when the action is removed from the action list

equals(other, …args) → {boolean} #

Compare to another action

Parameters:

Name Type Attributes Description
other mw.editcheck.EditCheckAction

Other action

args any repeatable

Returns:

Type
boolean
Overrides:
Source:
Compare to another action

getChoices() → {Array.<Object>} #

Get the available choices

Returns:

Type
Array.<Object>
Inherited from:
Source:
Get the available choices

getDescription() → {jQuery|string|function|OO.ui.HtmlSnippet} #

Get a description of the check

Returns:

Type
jQuery | string | function | OO.ui.HtmlSnippet
Inherited from:
Source:
Get a description of the check

getFocusSelection() → {ve.dm.Selection} #

Get the selection to focus for this check

Returns:

Type
ve.dm.Selection
Inherited from:
Source:
Get the selection to focus for this check

getFooter() → {jQuery|string|function|OO.ui.HtmlSnippet|undefined} #

Get the action's footer, if any

Returns:

Type
jQuery | string | function | OO.ui.HtmlSnippet | undefined
Inherited from:
Source:
Get the action's footer, if any

getFooterIcon() → {string|undefined} #

Get the action's footerIcon, if any

Returns:

Type
string | undefined
Inherited from:
Source:
Get the action's footerIcon, if any

getHighlightSelections() → {Array.<ve.dm.Selection>} #

Get selections to highlight for this check

Returns:

Type
Array.<ve.dm.Selection>
Inherited from:
Source:
Get selections to highlight for this check

getName() → {string} #

Get the name of the check type

Returns:

Check type name

Type
string
Overrides:
Source:
Get the name of the check type

getPrompt() → {jQuery|string|function|OO.ui.HtmlSnippet|undefined} #

Get the prompt question for the current choices

Returns:

Type
jQuery | string | function | OO.ui.HtmlSnippet | undefined
Inherited from:
Source:
Get the prompt question for the current choices

getTagName() → {string} #

Get unique tag name for this action

Returns:

unique tag

Type
string
Overrides:
Source:
Get unique tag name for this action

getTitle() → {jQuery|string|function|OO.ui.HtmlSnippet} #

Get the action's title

Returns:

Type
jQuery | string | function | OO.ui.HtmlSnippet
Inherited from:
Source:
Get the action's title

getType() → {string} #

Get the type of this action ('warning', 'error', 'progressive')

Returns:

Type
string
Inherited from:
Source:
Get the type of this action ('warning', 'error', 'progressive')

isDismissed(tag) → {boolean} #

Check whether every range of this action has been dismissed for this check

Parameters:

Name Type Description
tag string

Returns:

Type
boolean
Inherited from:
Source:
Check whether every range of this action has been dismissed for this check

isStale() → {boolean} #

Get the stale state of the action

Users must call #updateStale first if they want to get the latest state based on the current text.

Returns:

The action is stale

Type
boolean
Inherited from:
Source:

Get the stale state of the action

Users must call #updateStale first if they want to get the latest state based on the current text.

isSuggestion() → {boolean} #

Whether this is a suggestion

Returns:

Type
boolean
Inherited from:
Source:
Whether this is a suggestion

isTagged(tag) → {boolean} #

Is this action tagged?

Parameters:

Name Type Description
tag string

Returns:

Type
boolean
Inherited from:
Source:
Is this action tagged?

onActionClick(surface, actionWidget) #

Handle click events from an action button

Parameters:

Name Type Description
surface ve.ui.Surface

Surface

actionWidget OO.ui.ActionWidget

Clicked action widget

Fires:

Inherited from:
Source:
Handle click events from an action button

onActionSeen() #

Handle seen events from an action widget

overlapsRanges(ranges) → {boolean} #

Check if any of this action's fragments' ranges overlap with the given ranges

Parameters:

Name Type Description
ranges Array.<ve.Range>

The ranges

Returns:

True if any overlap exists

Type
boolean
Inherited from:
Source:
Check if any of this action's fragments' ranges overlap with the given ranges

render(collapsed, singleAction, surface) → {mw.editcheck.EditCheckActionWidget} #

Render as an EditCheckActionWidget

Parameters:

Name Type Description
collapsed boolean

Start collapsed

singleAction boolean

This is the only action shown

surface ve.ui.Surface

Surface

Returns:

Type
mw.editcheck.EditCheckActionWidget
Inherited from:
Source:
Render as an EditCheckActionWidget

select(surface, selectFocusRange, [focus]) #

Select the action in the surface

Parameters:

Name Type Attributes Default Description
surface ve.ui.Surface
selectFocusRange boolean

Whether to select the focus range of the check, or just move the cursor to the nearest point in the selection if outside the check range

focus boolean optional
true

Activate and focus the surface

Inherited from:
Source:
Select the action in the surface

setMode(mode) #

Set the mode used by the action widget

Parameters:

Name Type Description
mode string
Inherited from:
Source:
Set the mode used by the action widget

tag(tag) #

Tag this action

Parameters:

Name Type Description
tag string
Inherited from:
Source:
Tag this action

untag(tag) → {boolean} #

Untag this action

Parameters:

Name Type Description
tag string

Returns:

Whether anything was untagged

Type
boolean
Inherited from:
Source:
Untag this action

updateStale([forceStale]) #

Update the stale state of the action based on the text, or force a specific state

Parameters:

Name Type Attributes Description
forceStale boolean optional

Force the action into a stale or not-stale state

Inherited from:
Source:
Update the stale state of the action based on the text, or force a specific state

Events

act(promise) #

Fired when the user selects an action (e.g., clicks a suggestion button).

Parameters:

Name Type Description
promise jQuery.Promise

A promise that resolves when the action is complete

Overrides:
Source:
Fired when the user selects an action (e.g., clicks a suggestion button).

seen(seen) #

Fired when the action is seen by the user

Parameters:

Name Type Description
seen boolean

The check is seen

Inherited from:
Source:
Fired when the action is seen by the user

shown(shown) #

Fired when the action is shown to the user

Parameters:

Name Type Description
shown boolean

The check is shown

Inherited from:
Source:
Fired when the action is shown to the user

stale(stale) #

Fired when the action's stale state changes

Parameters:

Name Type Description
stale boolean

The check is stale

Inherited from:
Source:
Fired when the action's stale state changes