Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BlockCore

Module used for blocking users and/or issuing block templates.

Localisation: This class is abstract – you need to implement getBlockNoticeWikitextAndSummary. Also, the following fields may need to be customised:

Hierarchy

Index

Constructors

constructor

Properties

Window

Window: simpleWindow

blockGroups

blockGroups: quickFormElementData[]

blockGroupsPartial

blockGroupsPartial: quickFormElementData[]

blockPresetsInfo

blockPresetsInfo: Record<string, BlockPresetInfo>

blockedUserName

blockedUserName: string

currentBlockInfo

currentBlockInfo: any

defaultAnonBlockTemplate

defaultAnonBlockTemplate: string = 'uw-ablock'

Default generic block template for anonymous user blocks

defaultBlockTemplate

defaultBlockTemplate: string = 'uw-block'

Default generic block template

defaultIndefBlockTemplate

defaultIndefBlockTemplate: string = 'uw-blockindef'

Default generic block template for indefinite blocks

defaultIndefPartialBlockTemplate

defaultIndefPartialBlockTemplate: string = 'uw-pblockindef'

Default generic block template for indefinite partial blocks

defaultPartialBlockTemplate

defaultPartialBlockTemplate: string = 'uw-pblock'

Default generic block template for partial blocks

disablePartialBlockNamespaces

disablePartialBlockNamespaces: number[]

Do not allow partial blocking users for these namespaces. Special/Media namespaces don't need to be included here.

dsinfo

dsinfo: Record<string, { code: string; page?: string }>

fetchedData

fetchedData: {} = {}

Type declaration

field_block_options

field_block_options: { autoblock?: boolean; disabletalk?: boolean; expiry?: string; hardblock?: boolean; nocreate?: boolean; noemail?: boolean; reason?: string; watchuser?: string }

Type declaration

  • Optional autoblock?: boolean
  • Optional disabletalk?: boolean
  • Optional expiry?: string
  • Optional hardblock?: boolean
  • Optional nocreate?: boolean
  • Optional noemail?: boolean
  • Optional reason?: string
  • Optional watchuser?: string

field_template_options

field_template_options: { blank_duration?: boolean; block_reason?: string; nocreate_template?: boolean; noemail_template?: boolean; notalk?: boolean; template?: string; template_expiry?: string }

Type declaration

  • Optional blank_duration?: boolean
  • Optional block_reason?: string
  • Optional nocreate_template?: boolean
  • Optional noemail_template?: boolean
  • Optional notalk?: boolean
  • Optional template?: string
  • Optional template_expiry?: string

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

hasBlockLog

hasBlockLog: boolean

ipBlockExpiryDefault

ipBlockExpiryDefault: string = '31 hours'

Default expiry for IP blocks. This value must be present in the select menu.

isRegistered

isRegistered: boolean

lastBlockLogEntry

lastBlockLogEntry: LogEvent

lastBlockLogId

lastBlockLogId: number | false

Readonly menuFormattedNamespaces

menuFormattedNamespaces: Record<number, string> = ...

moduleName

moduleName: string = 'block'

portletId

portletId: string = 'twinkle-block'

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

portletName

portletName: string = 'Block'

Name displayed on the portlet

portletTooltip

portletTooltip: string = 'Block relevant user'

Tooltip shown when hovering on the portlet

prev_template_expiry

prev_template_expiry: any = null

relevantUserName

relevantUserName: string

seeAlsos

seeAlsos: any[] = []

userIsBot

userIsBot: boolean

Static moduleName

moduleName: string = 'block'

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

Methods

addMenu

  • addMenu(): void

addPreference

  • addPreference(pref: any): void

change_action

  • change_action(e: any): void
  • Called when any of the checkboxes in "type of action" or IPv6 /64 block are toggled.

    Parameters

    • e: any

    Returns void

change_block64

  • change_block64(e: any): void

change_expiry

  • change_expiry(e: any): void

change_preset

  • change_preset(e: any): void

change_template

  • change_template(e: any): void

evaluate

  • evaluate(e: any): void

filtered_block_groups

  • filtered_block_groups(group: any, show_template?: any): { label: any; list: { data: { name: string; value: any }[]; disabled: boolean; label: string; selected: boolean; value: any }[] }[]
  • Parameters

    • group: any
    • Optional show_template: any

    Returns { label: any; list: { data: { name: string; value: any }[]; disabled: boolean; label: string; selected: boolean; value: any }[] }[]

Abstract getBlockNoticeWikitextAndSummary

  • getBlockNoticeWikitextAndSummary(params: any): [string, string]
  • Returns an array with: 1st element: the block notice wikitext, and 2nd element: edit summary used when posting it.

    Parameters

    • params: any

    Returns [string, string]

issue_template

  • issue_template(formData: any): void

main

  • main(pageobj: any): void

makeWindow

  • makeWindow(): void

preview

  • preview(form: HTMLFormElement): void

processUserInfo

  • processUserInfo(userobj: User): void

saveFieldset

  • saveFieldset(fieldset: JQuery<HTMLElement> | HTMLFieldSetElement): any
  • Saves the values of form entries in a fieldset to this[fieldset_name].

    Parameters

    • fieldset: JQuery<HTMLElement> | HTMLFieldSetElement

    Returns any

toggle_see_alsos

  • toggle_see_alsos(e: QuickFormEvent): void

transformBlockPresets

  • transformBlockPresets(): void

update_form

  • update_form(e: any, data: any): void

Static userPreferences

Generated using TypeDoc