Expand all

mw.editcheck.SourceVerificationEditCheck

Constructor

new mw.editcheck.SourceVerificationEditCheck([state], [config], [includeSuggestions]) #

SourceVerificationEditCheck

Displays suggestions provided by the AI Source Verification script

Parameters:

Name Type Attributes Default Description
state Object optional

See mw.editcheck.BaseEditCheck

config Object optional
includeSuggestions boolean optional
false
Source:

SourceVerificationEditCheck

Displays suggestions provided by the AI Source Verification script

Methods

buildDialogMessage(suggestion, footnotes) → {jQuery|string} #

Build the message shown in the action card

Parameters:

Name Type Description
suggestion Object
footnotes Array.<{footnoteLabel: jQuery, url: string}>

Returns:

Type
jQuery | string
Source:
Build the message shown in the action card

followedByUrl(documentModel, expectedUrls, range) → {Object|null} #

Check if the reference node(s) that immediately follow the given range contain the expected source URL(s)

Validates one reference node per URL, in order. Returns array of matched reference nodes and the url that they matched, or the reason matching failed.

Parameters:

Name Type Description
documentModel ve.dm.Document
expectedUrls Array.<string>

Ordered list of expected source URLs

range ve.Range

Range that the expected URLs should follow

Returns:

Type
Object | null
Source:

Check if the reference node(s) that immediately follow the given range contain the expected source URL(s)

Validates one reference node per URL, in order.

insertFailedVerificationTemplate(fragment, templateToInsert) → {} #

Insert a template that indicates a source does not support a claim

Parameters:

Name Type Description
fragment ve.dm.LinearFragment

Fragment after which the template should be inserted

templateToInsert string

Name of template to insert to communicate the source doesn't support the claim

Returns:

promise that will resolve after template is inserted

Type
Source:
Insert a template that indicates a source does not support a claim

logSuggestionNotApplied(suggestion, reason)static #

Send VEFU events if suggestion could not be applied

Tracks as 'invalidated' if it had been applied in this session, otherwise 'stale' Includes suggestion id and reason it could not be applied

Parameters:

Name Type Description
suggestion Object
Properties:
Name Type Description
suggestion_id string
previouslyApplied boolean
tracked boolean
reason string
Source:

Send VEFU events if suggestion could not be applied

Tracks as 'invalidated' if it had been applied in this session, otherwise 'stale' Includes suggestion id and reason it could not be applied