Class DeputyCasePage

Handles Deputy case pages, controls UI features, among other things. This class should be able to operate both on the standard MediaWiki parser output and the Parsoid output.

Hierarchy

Constructors

  • Parameters

    • Optional pageId: number

      The page ID of the case page.

    • Optional title: Title

      The title of the page being accessed

    • Optional document: Document

      The document to be used as a reference.

    • Optional parsoid: boolean

      Whether this is a Parsoid document or not.

    • Optional lastActive: number
    • Optional lastActiveSessions: string[]

    Returns DeputyCasePage

Properties

document: Document

The document to use as a reference.

lastActive: number = ...

A timestamp of when this case page was last worked on.

lastActiveSections: string[] = []

The sections last worked on for this case page.

nCache: Map<HTMLHeadingElement, number>

The n-cache stores the n of contribution survey headings. In other words, it differentiates survey headings by giving it a number if another section on the page has a matching heading. The n-cache only contains the n of contribution survey headings, but counts all HTML headings as part of the n-cache.

pageId: number

The page ID of the case page.

parsoid: boolean

Whether this page is a Parsoid HTML5 with RDFa markup page or not.

title: Title

Title of this page.

The wikitext handler of the page.

Accessors

  • get rootPage(): Title
  • Returns Title

    the title of the case page

Methods

  • Add a section to the list of active sessions. This is used for automatic starting and for one-click continuation of past active sessions.

    Parameters

    • sectionId: string

      The ID of the section to add.

    Returns Promise<void>

  • Deletes the current page from the cache. This is generally not advised, unless the user wishes to forget the case page entirely.

    Returns Promise<void>

  • Find a contribution survey heading by section name.

    Parameters

    • sectionIdentifier: string

      The section identifier to look for, usually the section name unless useId is set to true.

    • useId: boolean = false

      Whether to use the section name instead of the ID

    Returns HTMLHeadingElement

    The <h*> element of the heading.

  • Gets all elements that are part of a contribution survey "section", that is a set of elements including the section heading and all elements succeeding the heading until (and exclusive of) the heading of the next section.

    In other words, YES: === Pages 1 to 2 === YES: * [[Page 1]] YES: * [[Page 2]] YES: NO : === Pages 3 to 4 ===

    Parameters

    • sectionHeading: HTMLElement

      The section heading to work with

    Returns Node[]

    An array of all HTMLElements covered by the section

  • Remove a section from the list of active sections. This will disable autostart for this section.

    Parameters

    • sectionId: string

      ID of the section to remove

    Returns Promise<void>

  • Gets the case name by parsing the title.

    Parameters

    • Optional title: TitleLike

      The title of the case page

    Returns string

    The case name, or null if the title was not a valid case page

  • Checks if the current page (or a supplied page) is a case page (subpage of the root page).

    Parameters

    • Optional title: TitleLike

      The title of the page to check.

    Returns boolean

    true if the page is a case page.

Generated using TypeDoc