Accept options in addition to the MathDocument, and set up the menu based on the defaults, the passed options, and the user's saved settings.
The MathDcument where this menu will post
The options for the menu
ProtectedaboutThe "About MathJax" info box
ProtectedannotationThe "Show As Annotation" info box
ProtectedbrailleThe "Show As Speech Text" info box
The current element being explored
The original settings (with page options factored in) for use with the reset command
ProtecteddocumentThe MathDocument in which we are working
ProtectederrorThe "Show As Error Message" info box
ProtectedhelpThe "MathJax Help" info box
ProtectedjaxInstances of the various output jax that we can switch to
ProtectedmathmlThe "Show As MathML" info box
The contextual menu object that is managed by this Menu
A MathML serializer that has options corresponding to the menu settings
The options for this menu
ProtectedoriginalThe "Show As (original form)" info box
List of font extensions that were loaded via \require
ProtectedrerenderThe minium initial state for pending rerender requests (so final rerender gets the right start)
The current settings for this menu (the variables attached to the menu's pool)
ProtectedspeechThe "Show As Speech Text" info box
ProtectedsvgThe "Show As SVG Image" info box
ProtectedzoomThe info box for zoomed expressions
Protected Static_Function used to reject the _loadingPromise
Protected Static_Function used to resolve the _loadingPromise
Protected Static_A promise that is resolved when all components are loaded
Protected StaticloadingThe number of startup modules that are currently being loaded
Protected StaticloadingPromises for the loading components
StaticMENU_The key for the localStorage for the menu settings
StaticOPTIONSThe options for the menu, including the default settings, the various output jax and the list of annotation types and their encodings
StaticSvgThe CSS to include in SVG images
true when the menu is loading some component
A promise that is resolved when all pending loads are complete
Create JSON for an a11y specific variable.
The type of variable being defined
The setting for which to make a variable
Optionalaction: (value: T) => voidThe action to perform when the variable is updated
The JSON for the variable
The math to attach the context menu and zoom triggers to
Add extensions that need to be loaded when the renderer changes
The list of extensions
ProtectedapplyDo what is needed to apply the initial user settings
ProtectedattachThe menu to attach
Create JSON for a checkbox item
The id for the item
The content for the item
The (pool) variable to attach to this checkbox
Other values to include in the generated JSON object
The JSON for the checkbox item
Check if a component is loading, and restart if it is
The name of the component to check if it is loading
ProtectedcheckCheck 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
Clear the information about stored context menus
Create JSON for a command item
The id for the item
The content for the item
The action function for the command
Other values to include in the generated JSON object
The JSON for the command item
ProtectedcopyCopy the speech text to the clipboard
ProtectedcopyCopy the error message to the clipboard
ProtectedcopyCopy the serialzied MathML to the clipboard
ProtectedcopyCopy the original form to the clipboard
ProtectedcopyCopy the speech text to the clipboard
ProtectedcopyCopy the SVG image to the clipboard
ProtectedenableEnable/disable an assistive submenu's items
The name of the item
True to enable, false to disable
ProtectedformatThe text to be displayed in an Info box
The text with HTML specials being escaped
ProtectedformatThe serialzied SVG to adjust
The adjusted SVG string
ProtectedgetGet the the value of an a11y option
The name of the ptions to get
The value of the option
ProtectedinitCreate the menu object, attach the info boxes to it, and output any CSS needed for it
ProtectedinitSet up the settings and jax objects, and transfer the output jax name and scale to the settings
ProtectedisThe event triggering the zoom action
The type of event (click, dblclick) that occurred
True if the event is the right type and has the needed modifiers
Create JSON for a label item
The id for the item
The content for the item
The JSON for the label item
Attempt to load an a11y component
The name of the a11y component to load
ProtectedloadAttempt to load a component and perform a callback when done
The name of the component to load
The callback for after loading
ProtectedloadLoad the required extensions into the new output jax
The promise combining all loading promises
ProtectedmergeLook up the saved settings from localStorage and merge them into the menu settings
Get the SVG image and post it
Create JSON for a radio button item
The id for the item
The content for the item
The (pool) variable to attach to this radio button
Other values to include in the generated JSON object
The JSON for the radio button item
Create JSON for a group of connected radio buttons
The (pool) variable to attach to each radio button
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)
An array of JSON objects for radion buttons
ProtectedrerenderRerender 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)
The state at which to start rerendering
ProtectedresetReset all menu settings to the (page) defaults
Create JSON for a menu rule
The JSON for the rule item
ProtectedsaveSave any non-default menu settings in localStorage
ProtectedscaleRequest the scaling value from the user and save it in the settings
ProtectedsetMerge menu settings into the a11y document options.
The options.
ProtectedsetEnable/disable assistive menus based on enrichment setting
ProtectedsetTrue to output hidden Mathml, false to not
ProtectedsetTrue to enable braille, false to not
ProtectedsetThe Braille code format (nemeth or euro)
ProtectedsetTrue to enable collapsible math, false to not
ProtectedsetTrue to enable enriched math, false to not
ProtectedsetThe value that highlighting should have
ProtectedsetThe new in-line break value
ProtectedsetThe speech locale
ProtectedsetSet up the new jax and link it to the document, load any needed extensions, and then rerender the math, if needed
The name of the jax to switch to
True if the document should be rerendered
A promise that is resolved when the renderer is set and rerendering complete
ProtectedsetThe new overflow value
ProtectedsetIf the jax is already on record, just use it, otherwise load the new one
The name of the jax to switch to
True if the document should be rerendered
A promise that is resolved when the renderer is set and rerendering complete
ProtectedsetRerender when the role description changes
ProtectedsetThe new scaling value
ProtectedsetTrue to enable speech, false to not
ProtectedsetTrue for including math in the tab order, false for not
Create JSON for a submenu item
The id for the item
The content for the item
The JSON for the entries
True if this item is diabled initially
The JSON for the submenu item
ProtectedtoThe MathItem to serialize as MathML
The serialized version of the internal MathML
ProtectedtoThe MathItem to serialize as SVG
A promise returning the serialized SVG
ProtectedtransferThe original document whose list is to be transferred
ProtectedtypesetThe MathItem to serialize as SVG
The SVG font cache type
True if there are inline breaks
A promise returning the serialized SVG
Create JSON for a variable controlling a menu setting
The type of variable being defined
The setting for which to make a variable
Optionalaction: (value: T) => voidOptional function to perform after setting the value
The JSON for the variable
ProtectedzoomThe event triggering the zoom (or null for from a menu pick)
The type of event occurring (click, dblclick)
The MathItem triggering the event
The Menu object that handles the MathJax contextual menu and its actions