Extends
Constructor
new mw.editcheck.SourceVerificationEditCheckAction(config)
#
SourceVerificationEditCheckAction
Subclass of EditCheckAction to include information about the suggestion associated with this action
Parameters:
| Name | Type | Description |
|---|---|---|
config |
Object | Configuration options Properties: |
SourceVerificationEditCheckAction
Subclass of EditCheckAction to include information about the suggestion associated with this action
Methods
cancelComplete()
#
Cancel a previous call to #intendComplete
Used when the check was dismissed before the user finished applying the fix.
- Inherited from:
- Source:
Cancel a previous call to #intendComplete
Used when the check was dismissed before the user finished applying the fix.
complete([message])
#
Method called when the action is completed successfully
Call this before the action is removed from the action list. Then the system message is in the list when a dialog updates, and the dialog does not close.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
message |
jQuery | string | function | OO.ui.HtmlSnippet |
optional |
Message to show for this outcome that overrides the check's successResult message |
Fires:
- Inherited from:
- Source:
Method called when the action is completed successfully
Call this before the action is removed from the action list.
discarded()
#
Method called by the controller when the action is removed from the action list
Also checks if a check previously called #intendComplete on this action, in which case that completion is finished here.
- Inherited from:
- Source:
Method called by the controller when the action is removed from the action list
Also checks if a check previously called #intendComplete on this action, in which case that completion is finished here.
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
- Inherited from:
- Source:
getConfigAnchor() → {string}
#
Get the anchor of this action's row on Special:EditChecks
Returns:
- Type
- string
- Inherited from:
- Source:
getDescription() → {jQuery|string|function|OO.ui.HtmlSnippet}
#
Get a description of the check
Returns:
- Type
- jQuery | string | function | OO.ui.HtmlSnippet
- Overrides:
- Source:
getFocusSelection() → {ve.dm.Selection}
#
getHighlightSelections() → {Array.<ve.dm.Selection>}
#
Get selections to highlight for this check
Returns:
- Type
- Array.<ve.dm.Selection>
- Inherited from:
- Source:
getName() → {string}
#
Get the name of the check type
Returns:
Check type name
- Type
- string
- Inherited from:
- Source:
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
- Inherited from:
- Source:
getRuleId() → {string|null}
#
null}
#
Get the ID of the community-defined rule that produced this action
The ID has no fixed set of values, so metrics must not use it as the check name.
Returns:
Rule ID, or null if the check has no sub-rules
- Type
-
string
|
null
- Inherited from:
- Source:
Get the ID of the community-defined rule that produced this action
The ID has no fixed set of values, so metrics must not use it as the check name.
getTagName() → {string}
#
Get unique tag name for this action
Returns:
- Type
- string
- Inherited from:
- Source:
getTitle() → {jQuery|string|function|OO.ui.HtmlSnippet}
#
Get the action's title
Returns:
- Type
- jQuery | string | function | OO.ui.HtmlSnippet
- Inherited from:
- Source:
getTrackingIdSuffix() → {string}
#
Get action's id if it's configured to include it in its instrumentation
Returns:
suffix with ID, or an empty string
- Type
- string
- Inherited from:
- Source:
getType() → {string}
#
Get the type of this action ('warning', 'error', 'progressive')
Returns:
- Type
- string
- Inherited from:
- Source:
intendComplete()
#
Method called by a check when the action being discarded should indicate it's been completed
For use by checks whose own workflow can be cancelled without the check knowing.
- Inherited from:
- Source:
Method called by a check when the action being discarded should indicate it's been completed
For use by checks whose own workflow can be cancelled without the check knowing.
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:
isRevising() → {boolean}
#
Check if the user is revising the action
Only this action object is revising. Other actions in the tagged range are not, e.g. an action that replaces this one after the paragraph is split.
This always uses the fragments, also for actions with an ID, because the tag must be cleared when the selection leaves a range.
Returns:
- Type
- boolean
- Inherited from:
- Source:
Check if the user is revising the action
Only this action object is revising.
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:
isTagged(tag) → {boolean}
#
Is this action tagged?
Parameters:
| Name | Type | Description |
|---|---|---|
tag |
string |
Returns:
- Type
- boolean
- Inherited from:
- Source:
onActionClick(surface, controller, actionWidget)
#
Handle click events from an action button
Parameters:
| Name | Type | Description |
|---|---|---|
surface |
ve.ui.Surface | Surface |
controller |
Controller that shows the action |
|
actionWidget |
OO.ui.ActionWidget | Clicked action widget |
Fires:
- Inherited from:
- Source:
onActionSeen()
#
Handle seen events from an action widget
Fires:
- Inherited from:
- Source:
overlapsRanges(ranges) → {boolean}
#
Check if any of this action's fragments' ranges overlap with the given ranges
Parameters:
Returns:
True if any overlap exists
- Type
- boolean
- Inherited from:
- Source:
refreshWidget()
#
Refresh the rendered widget to reflect any changes since it was last built
Currently only updates the card description but this could be extended if other getters become stale(-able) too
- Inherited from:
- Source:
Refresh the rendered widget to reflect any changes since it was last built
Currently only updates the card description but this could be extended if other getters become stale(-able) too
render(collapsed, singleAction, surface, controller) → {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 |
controller |
Controller that shows the action |
Returns:
- Inherited from:
- Source:
select(surface, forceCollapse, [focus])
#
Select the action in the surface
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
surface |
ve.ui.Surface | |||
forceCollapse |
boolean | Whether to force the cursor to the edge of the check's range, or to only do so if outside the check range |
||
focus |
boolean |
optional |
true | Activate and focus the surface |
- Inherited from:
- Source:
setMode(mode)
#
Set the mode used by the action widget
Parameters:
| Name | Type | Description |
|---|---|---|
mode |
string |
- Inherited from:
- Source:
startRevising()
#
Start revising the action, which makes it stale
The 'revising' tag is cleared when the selection leaves the action's fragments, and this stops the revising.
- Inherited from:
- Source:
Start revising the action, which makes it stale
The 'revising' tag is cleared when the selection leaves the action's fragments, and this stops the revising.
stopRevising()
#
Stop revising the action, and accept its current text as checked
- Inherited from:
- Source:
tag(tag)
#
Tag this action
Parameters:
| Name | Type | Description |
|---|---|---|
tag |
string |
- Inherited from:
- Source:
untag(tag) → {boolean}
#
Untag this action
Parameters:
| Name | Type | Description |
|---|---|---|
tag |
string |
Returns:
Whether anything was untagged
- Type
- boolean
- Inherited from:
- Source:
updateFrom(action) → {boolean}
#
Whether widget needs to be redrawn using fresh data, without a full rerender
Called from Controller#updateForListener when a new action #equals the old one, but there is an update to some data that is displayed in the widget
Parameters:
| Name | Type | Description |
|---|---|---|
action |
mw.editcheck.EditCheckAction | the new, equivalent action |
Returns:
Whether widget needs to be redrawn
- Type
- boolean
- Overrides:
- Source:
Whether widget needs to be redrawn using fresh data, without a full rerender
Called from Controller#updateForListener when a new action #equals the old one, but there is an update to some data that is displayed in the widget
updateStale([resetText]) → {boolean}
#
Update the stale state of the action
The action is stale while the user revises it (see #startRevising), or when its text changed since the check last ran.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
resetText |
boolean |
optional |
false | The check ran again on the current text |
Returns:
The stale state changed
- Type
- boolean
- Inherited from:
- Source:
Update the stale state of the action
The action is stale while the user revises it (see #startRevising), or when its text changed since the check last ran.
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:
complete([message])
#
Fired when the action is completed successfully Unlike 'discard', this represents an actual outcome of the action, not just it being removed from the action list
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
message |
jQuery | string | function | OO.ui.HtmlSnippet |
optional |
Message to show for this outcome that overrides the check's successResult message |
- Inherited from:
- Source:
Fired when the action is completed successfully Unlike 'discard', this represents an actual outcome of the action, not just it being removed from the action list
seen(seen)
#
Fired when the action is seen by the user
Parameters:
| Name | Type | Description |
|---|---|---|
seen |
boolean | The check is seen |
- Inherited from:
- Source:
shown(shown)
#
Fired when the action is shown to the user
Parameters:
| Name | Type | Description |
|---|---|---|
shown |
boolean | The check is shown |
- Inherited from:
- Source:
stale(stale)
#
Fired when the action's stale state changes
Parameters:
| Name | Type | Description |
|---|---|---|
stale |
boolean | The check is stale |
- Inherited from:
- Source: