Constructor
new mw.editcheck.EditCheckAction(config)
#
EditCheckAction
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | Configuration options Properties:
|
- Mixes in:
- Source:
Methods
discarded()
#
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 |
Returns:
- Type
- boolean
getDescription() → {jQuery|string|function|OO.ui.HtmlSnippet}
#
getFocusSelection() → {ve.dm.Selection}
#
getHighlightSelections() → {Array.<ve.dm.Selection>}
#
getName() → {string}
#
Get the name of the check type
Returns:
Check type name
- Type
- string
getPrompt() → {jQuery|string|function|OO.ui.HtmlSnippet|undefined}
#
undefined}
#
Get the prompt question for the current choices
Returns:
- Type
-
jQuery
|
string
|
function
|
OO.ui.HtmlSnippet
|
undefined
getTagName() → {string}
#
Get unique tag name for this action
Returns:
- Type
- string
getTitle() → {jQuery|string|function|OO.ui.HtmlSnippet}
#
getType() → {string}
#
Get the type of this action (e.g., 'warning', 'error')
Returns:
- Type
- string
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
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
isTagged(tag) → {boolean}
#
Is this action tagged?
Parameters:
| Name | Type | Description |
|---|---|---|
tag |
string |
Returns:
- Type
- boolean
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:
onActionSeen()
#
Handle seen events from an action widget
Fires:
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:
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 |
setMode(mode)
#
Set the mode used by the action widget
Parameters:
| Name | Type | Description |
|---|---|---|
mode |
string |
tag(tag)
#
Tag this action
Parameters:
| Name | Type | Description |
|---|---|---|
tag |
string |
untag(tag) → {boolean}
#
Untag this action
Parameters:
| Name | Type | Description |
|---|---|---|
tag |
string |
Returns:
Whether anything was untagged
- Type
- boolean
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 |
compareStarts(a, b) → {number}static
#
Compare the start offsets of two actions.
Parameters:
| Name | Type | Description |
|---|---|---|
a |
mw.editcheck.EditCheckAction | |
b |
mw.editcheck.EditCheckAction |
Returns:
- Type
- number
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 |
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 |
seen(seen)
#
Fired when the action is seen by the user
Parameters:
| Name | Type | Description |
|---|---|---|
seen |
boolean | The check is seen |
stale(stale)
#
Fired when the action's stale state changes
Parameters:
| Name | Type | Description |
|---|---|---|
stale |
boolean | The check is stale |