@mathjax/src
    Preparing search index...

    The Menu object that handles the MathJax contextual menu and its actions

    Index

    Constructors

    Properties

    about: Info = ...

    The "About MathJax" info box

    annotationBox: SelectableInfo = ...

    The "Show As Annotation" info box

    brailleText: SelectableInfo = ...

    The "Show As Speech Text" info box

    current: HTMLElement = null

    The current element being explored

    defaultSettings: MenuSettings = null

    The original settings (with page options factored in) for use with the reset command

    The MathDocument in which we are working

    errorMessage: SelectableInfo = ...

    The "Show As Error Message" info box

    help: Info = ...

    The "MathJax Help" info box

    jax: JaxList = ...

    Instances of the various output jax that we can switch to

    mathmlCode: SelectableInfo = ...

    The "Show As MathML" info box

    menu: MJContextMenu = null

    The contextual menu object that is managed by this Menu

    MmlVisitor: MmlVisitor<HTMLElement, Text, Document> = ...

    A MathML serializer that has options corresponding to the menu settings

    options: OptionList

    The options for this menu

    originalText: SelectableInfo = ...

    The "Show As (original form)" info box

    requiredExtensions: string[] = []

    List of font extensions that were loaded via \require

    rerenderStart: number = STATE.LAST

    The minium initial state for pending rerender requests (so final rerender gets the right start)

    settings: MenuSettings = null

    The current settings for this menu (the variables attached to the menu's pool)

    speechText: SelectableInfo = ...

    The "Show As Speech Text" info box

    svgImage: SelectableInfo = ...

    The "Show As SVG Image" info box

    zoomBox: Info = ...

    The info box for zoomed expressions

    _loadingFailed: (err: Error) => void = null

    Function used to reject the _loadingPromise

    _loadingOK: () => void = null

    Function used to resolve the _loadingPromise

    _loadingPromise: Promise<void> = null

    A promise that is resolved when all components are loaded

    loading: number = 0

    The number of startup modules that are currently being loaded

    loadingPromises: Map<string, Promise<void>> = ...

    Promises for the loading components

    MENU_STORAGE: string = 'MathJax-Menu-Settings'

    The key for the localStorage for the menu settings

    OPTIONS: OptionList = ...

    The options for the menu, including the default settings, the various output jax and the list of annotation types and their encodings

    SvgCss: string = ...

    The CSS to include in SVG images

    Accessors

    • get isLoading(): boolean

      Returns boolean

      true when the menu is loading some component

    • get loadingPromise(): Promise<void>

      Returns Promise<void>

      A promise that is resolved when all pending loads are complete

    Methods

    • Create JSON for an a11y specific variable.

      Type Parameters

      • T extends string | boolean

        The type of variable being defined

      Parameters

      • name: keyof MenuSettings

        The setting for which to make a variable

      • Optionalaction: (value: T) => void

        The action to perform when the variable is updated

      Returns object

      The JSON for the variable

    • Parameters

      • math: HTMLMATHITEM

        The math to attach the context menu and zoom triggers to

      Returns void

    • Add extensions that need to be loaded when the renderer changes

      Parameters

      • extensions: string[]

        The list of extensions

      Returns void

    • Do what is needed to apply the initial user settings

      Returns void

    • Create JSON for a checkbox item

      Parameters

      • id: string

        The id for the item

      • content: string

        The content for the item

      • variable: string

        The (pool) variable to attach to this checkbox

      • other: object = {}

        Other values to include in the generated JSON object

      Returns object

      The JSON for the checkbox item

    • Check if a component is loading, and restart if it is

      Parameters

      • name: string

        The name of the component to check if it is loading

      Returns void

    • Check whether the startup and loader modules are available, and if not, disable the a11y modules (since we can't load them or know if they are available). Otherwise, check if any need to be loaded

      Returns void

    • Create JSON for a command item

      Parameters

      • id: string

        The id for the item

      • content: string

        The content for the item

      • action: () => void

        The action function for the command

      • other: object = {}

        Other values to include in the generated JSON object

      Returns object

      The JSON for the command item

    • Enable/disable an assistive submenu's items

      Parameters

      • name: string

        The name of the item

      • enable: boolean

        True to enable, false to disable

      Returns void

    • Parameters

      • text: string

        The text to be displayed in an Info box

      Returns string

      The text with HTML specials being escaped

    • Parameters

      • svg: string

        The serialzied SVG to adjust

      Returns string

      The adjusted SVG string

    • Get the the value of an a11y option

      Parameters

      • option: string

        The name of the ptions to get

      Returns any

      The value of the option

    • Create the menu object, attach the info boxes to it, and output any CSS needed for it

      Returns void

    • Set up the settings and jax objects, and transfer the output jax name and scale to the settings

      Returns void

    • Parameters

      • event: MouseEvent

        The event triggering the zoom action

      • zoom: string

        The type of event (click, dblclick) that occurred

      Returns boolean

      True if the event is the right type and has the needed modifiers

    • Create JSON for a label item

      Parameters

      • id: string

        The id for the item

      • content: string

        The content for the item

      Returns object

      The JSON for the label item

    • Attempt to load an a11y component

      Parameters

      • component: string

        The name of the a11y component to load

      Returns void

    • Attempt to load a component and perform a callback when done

      Parameters

      • name: string

        The name of the component to load

      • callback: () => void

        The callback for after loading

      Returns void

    • Load the required extensions into the new output jax

      Returns Promise<string[]>

      The promise combining all loading promises

    • Look up the saved settings from localStorage and merge them into the menu settings

      Returns void

    • Create JSON for a radio button item

      Parameters

      • id: string

        The id for the item

      • content: string

        The content for the item

      • variable: string

        The (pool) variable to attach to this radio button

      • other: object = {}

        Other values to include in the generated JSON object

      Returns object

      The JSON for the radio button item

    • Create JSON for a group of connected radio buttons

      Parameters

      • variable: string

        The (pool) variable to attach to each radio button

      • radios: string[][]

        An array of [string] or [string, string], giving the id and content for each radio button (if only one string is given it is used for both)

      Returns object[]

      An array of JSON objects for radion buttons

    • Rerender the output if we aren't in the middle of loading a new component (in which case, we will rerender in the callback performed after it is loaded)

      Parameters

      • start: number = STATE.TYPESET

        The state at which to start rerendering

      Returns void

    • Create JSON for a menu rule

      Returns object

      The JSON for the rule item

    • Save any non-default menu settings in localStorage

      Returns void

    • Request the scaling value from the user and save it in the settings

      Returns void

    • Merge menu settings into the a11y document options.

      Parameters

      • options: { [key: string]: any }

        The options.

      Returns void

    • Enable/disable assistive menus based on enrichment setting

      Returns void

    • Parameters

      • mml: boolean

        True to output hidden Mathml, false to not

      Returns void

    • Parameters

      • braille: boolean

        True to enable braille, false to not

      Returns void

    • Parameters

      • code: string

        The Braille code format (nemeth or euro)

      Returns void

    • Parameters

      • collapse: boolean

        True to enable collapsible math, false to not

      Returns void

    • Parameters

      • enrich: boolean

        True to enable enriched math, false to not

      Returns void

    • Parameters

      • value: string

        The value that highlighting should have

      Returns void

    • Parameters

      • breaks: boolean

        The new in-line break value

      Returns void

    • Parameters

      • locale: string

        The speech locale

      Returns void

    • Set up the new jax and link it to the document, load any needed extensions, and then rerender the math, if needed

      Parameters

      • jax: string

        The name of the jax to switch to

      • rerender: boolean = true

        True if the document should be rerendered

      Returns Promise<void>

      A promise that is resolved when the renderer is set and rerendering complete

    • Parameters

      • overflow: string

        The new overflow value

      Returns void

    • If the jax is already on record, just use it, otherwise load the new one

      Parameters

      • jax: string

        The name of the jax to switch to

      • rerender: boolean = true

        True if the document should be rerendered

      Returns Promise<void>

      A promise that is resolved when the renderer is set and rerendering complete

    • Rerender when the role description changes

      Returns void

    • Parameters

      • scale: string

        The new scaling value

      Returns void

    • Parameters

      • speech: boolean

        True to enable speech, false to not

      Returns void

    • Parameters

      • tab: boolean

        True for including math in the tab order, false for not

      Returns void

    • Create JSON for a submenu item

      Parameters

      • id: string

        The id for the item

      • content: string

        The content for the item

      • entries: any[] = []

        The JSON for the entries

      • disabled: boolean = false

        True if this item is diabled initially

      Returns object

      The JSON for the submenu item

    • Parameters

      • math: HTMLMATHITEM

        The MathItem to serialize as MathML

      Returns string

      The serialized version of the internal MathML

    • Parameters

      • math: HTMLMATHITEM

        The MathItem to serialize as SVG

      Returns Promise<string>

      A promise returning the serialized SVG

    • Parameters

      • math: HTMLMATHITEM

        The MathItem to serialize as SVG

      • cache: string

        The SVG font cache type

      • breaks: boolean

        True if there are inline breaks

      Returns Promise<string>

      A promise returning the serialized SVG

    • Create JSON for a variable controlling a menu setting

      Type Parameters

      • T extends string | boolean

        The type of variable being defined

      Parameters

      • name: keyof MenuSettings

        The setting for which to make a variable

      • Optionalaction: (value: T) => void

        Optional function to perform after setting the value

      Returns object

      The JSON for the variable

    • Parameters

      • event: MouseEvent

        The event triggering the zoom (or null for from a menu pick)

      • type: string

        The type of event occurring (click, dblclick)

      • math: HTMLMATHITEM

        The MathItem triggering the event

      Returns void