Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WarnCore

Module for sending users warnings and notice messages.

Hierarchy

Index

Constructors

constructor

Properties

dialog

dialog: Dialog

footerlinks

footerlinks: {}

Set of links shown in the bottom right of the module dialog. Object keys are labels and values are the wiki page names.

Type declaration

  • [label: string]: string

moduleName

moduleName: string = 'Warn'

portletId

portletId: string = 'twinkle-warn'

Optional ID for the portlet. This defaults to twinkle-${portletName.toLowerCase()} if unspecified

portletName

portletName: string = 'Warn'

Name displayed on the portlet

portletTooltip

portletTooltip: string = 'Warn/notify user'

Tooltip shown when hovering on the portlet

Abstract warningLevels

warningLevels: Record<string, { label: string; selected: (pref: number) => boolean; visible?: () => boolean }>

warnings

warnings: Record<string, warningLevel>

windowTitle

windowTitle: string = 'Warn/notify user'

Static moduleName

moduleName: string = 'Warn'

The name of the module, used to check if the user has the module disabled

Methods

addMenu

  • addMenu(): void

addPreference

  • addPreference(pref: any): void

changeSubcategory

  • changeSubcategory(e: any): void

customTemplateEditSummaryPrefix

  • customTemplateEditSummaryPrefix(template: any, messageData: warning): string

customiseSummaryWithInput

  • customiseSummaryWithInput(summary: string, input: string, messageData: warning): string

dateProcessing

  • dateProcessing(wikitext: string): [{ date: date; type: string }, Record<string, date>]
  • Used to determine when to warn about excessively recent, stale, or identical warnings.

    Parameters

    • wikitext: string

      The text of a user's talk page, from getPageText()

    Returns [{ date: date; type: string }, Record<string, date>]

    • Array of objects: latest contains most recent warning and date; history lists all prior warnings

evaluate

  • evaluate(e: any): void

getHistoryRegex

  • getHistoryRegex(): void | RegExp
  • Return a regex expression with 2 capturing groups:

    1. captures the name of the template (without the namespace prefix)
    2. captures the comment timestamp - it is assumed that this timestamp can be parsed by Morebits.date()

    Returns void | RegExp

getInputConfig

  • getInputConfig(template: string): quickFormElementData

getTemplateMatchRegex

  • getTemplateMatchRegex(template: string, newlevel: string): RegExp

getWarningGroups

  • getWarningGroups(): quickFormElementData[]

getWarningWikitext

  • getWarningWikitext(templateName: any, article: any, reason: any, isCustom: any): string

getWarningsInLevel

  • getWarningsInLevel(newlevel: string): quickFormElementData

main

  • main(pageobj: Page, params: any): Promise<api, any, any>

makeWindow

  • makeWindow(): void

onCategoryChange

  • onCategoryChange(e: any): void

perWarningNotices

  • perWarningNotices(template: any): JQuery<HTMLElement>
  • Add some notices for the Twinkle user when they select specific templates to use

    Parameters

    • template: any

    Returns JQuery<HTMLElement>

populateNotices

  • populateNotices(): void
  • Populate #twinkle-warn-warning-messages with any notices for the tool operator, such as for staleness and missed reverts

    Returns void

postCategoryCleanup

  • postCategoryCleanup(e: any): void

preview

  • preview(form: HTMLFormElement): void

Abstract processWarnings

  • processWarnings(): any

showPreview

  • showPreview(form: HTMLFormElement, templatename?: string): void

validateInputs

  • validateInputs(params: Record<string, any>): string | void

Static userPreferences

Generated using TypeDoc