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() → {string}
#
Get a description of the check
Returns:
- Type
- string
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}
#
Check whether the text has changed since this action was created
Returns:
Whether the text has changed since this action was created
- Type
- boolean
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:
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:
setStale(stale)
#
Force the action into a stale or not-stale state
Parameters:
| Name | Type | Description |
|---|---|---|
stale |
boolean |
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
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 |