Expand all

mw.editcheck.EditCheckAction

Constructor

new mw.editcheck.EditCheckAction(config) #

EditCheckAction

Parameters:

Name Type Description
config Object

Configuration options

Properties:
Name Type Attributes Default Description
check mw.editcheck.BaseEditCheck

Check which created this action

fragments Array.<ve.dm.SurfaceFragment>

Affected fragments

focusFragment ve.dm.SurfaceFragment optional

Fragment to focus

title jQuery | string | function | OO.ui.HtmlSnippet optional

Title

message jQuery | string | function | OO.ui.HtmlSnippet optional

Body message

prompt jQuery | string | function | OO.ui.HtmlSnippet optional

Prompt to show before choices

id string optional

Optional unique identifier

icon string optional

Optional icon name

type string optional
'warning'

Type of message (e.g., 'warning', 'error')

suggestion boolean optional

Whether this is a suggestion

choices Array.<Object> optional

User choices

Mixes in:
Source:
EditCheckAction

Methods

discarded() #

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

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

equals(other, allowOverlaps) → {boolean} #

Compare to another action

Parameters:

Name Type Description
other mw.editcheck.EditCheckAction

Other action

allowOverlaps boolean

Count overlaps rather than a perfect match

Source:

Returns:

Type
boolean
Compare to another action

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

Get the available choices

Source:

Returns:

Type
Array.<Object>
Get the available choices

getDescription() → {string} #

Get a description of the check

Source:

Returns:

Type
string
Get a description of the check

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

Get the selection to focus for this check

Source:

Returns:

Type
ve.dm.Selection
Get the selection to focus for this check

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

Get the action's footer, if any

Source:

Returns:

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

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

Get selections to highlight for this check

Source:

Returns:

Type
Array.<ve.dm.Selection>
Get selections to highlight for this check

getName() → {string} #

Get the name of the check type

Source:

Returns:

Check type name

Type
string
Get the name of the check type

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

Get the prompt question for the current choices

Source:

Returns:

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

getTagName() → {string} #

Get unique tag name for this action

Source:

Returns:

Type
string
Get unique tag name for this action

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

Get the action's title

Source:

Returns:

Type
jQuery | string | function | OO.ui.HtmlSnippet
Get the action's title

getType() → {string} #

Get the type of this action (e.g., 'warning', 'error')

Source:

Returns:

Type
string
Get the type of this action (e.g., 'warning', 'error')

isStale() → {boolean} #

Check whether the text has changed since this action was created

Source:

Returns:

Whether the text has changed since this action was created

Type
boolean
Check whether the text has changed since this action was created

isSuggestion() → {boolean} #

Whether this is a suggestion

Source:

Returns:

Type
boolean
Whether this is a suggestion

isTagged(tag) → {boolean} #

Is this action tagged?

Parameters:

Name Type Description
tag string
Source:

Returns:

Type
boolean
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

Source:

Fires:

Handle click events from an action button

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

Source:

Returns:

Type
mw.editcheck.EditCheckActionWidget
Render as an EditCheckActionWidget

setStale(stale) #

Force the action into a stale or not-stale state

Parameters:

Name Type Description
stale boolean
Source:
Force the action into a stale or not-stale state

tag(tag) #

Tag this action

Parameters:

Name Type Description
tag string
Source:
Tag this action

untag(tag) → {boolean} #

Untag this action

Parameters:

Name Type Description
tag string
Source:

Returns:

Whether anything was untagged

Type
boolean
Untag this action

compareStarts(a, b) → {number}static #

Compare the start offsets of two actions.

Parameters:

Source:

Returns:

Type
number
Compare the start offsets of two actions.

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

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

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

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