Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TagCore

Module for tagging pages. For different types of pages, this module can be configured to behave differently. The TagMode class should be extended for each type of page (usually based on namespace).

Define the following static field:

  • modeList - which contains the array of classes you define that extend TagMode

Note that since this is a static field, it must be defined as TagCore.modeList (not Tag.modeList).

See enwiki localisation at https://github.com/wikimedia-gadgets/twinkle-enwiki/blob/master/src/tag.ts

Hierarchy

Index

Constructors

constructor

Properties

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

mode

mode: TagMode

The mode active on this current page.

moduleName

moduleName: string = 'Tag'

portletId

portletId: string = 'twinkle-tag'

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

portletName

portletName: string = 'Tag'

Name displayed on the portlet

portletTooltip

portletTooltip: string

Tooltip shown when hovering on the portlet

Static modeList

modeList: typeof TagMode[]

List of tag modes. Each tag mode is a class extending TagMode.

Static moduleName

moduleName: string = 'Tag'

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

Methods

addMenu

  • addMenu(): void

addPreference

  • addPreference(pref: any): void

makeWindow

  • makeWindow(): void

Static makeArrowLinks

  • makeArrowLinks(checkbox: HTMLInputElement): void
  • Adds a link to each template's description page

    Parameters

    • checkbox: HTMLInputElement

      associated with the template

    Returns void

Static makeEditSummary

  • makeEditSummary(addedTags: string[], removedTags?: string[], reason?: string): string
  • Generate an edit summary for the tagging and/or untagging

    Parameters

    • addedTags: string[]
    • Optional removedTags: string[]
    • Optional reason: string

    Returns string

Static userPreferences

  • userPreferences(): { preferences: Preference[]; title: string }

Generated using TypeDoc