Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A11y tree explorer #327

Merged
merged 2 commits into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions mathjax3-ts/a11y/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ export function ExplorerMathItemMixin<B extends Constructor<HTMLMATHITEM>>(
let lastKeyExplorer = null;
for (let explorer of this.attached) {
if (!(explorer instanceof ke.AbstractKeyExplorer)) continue;
if (lastKeyExplorer) {
lastKeyExplorer.stoppable = false;
}
explorer.stoppable = false;
lastKeyExplorer = explorer;
lastKeyExplorer.stoppable = true;
}
if (lastKeyExplorer) {
lastKeyExplorer.stoppable = true;
}
}

Expand Down Expand Up @@ -245,14 +245,14 @@ export function ExplorerMathDocumentMixin<B extends MathDocumentConstructor<HTML
infoPrefix: false,
infoRole: false,
infoType: false,
keymagnifier: false,
keyMagnifier: false,
magnification: 'None',
magnify: 500,
mousemagnifier: false,
mouseMagnifier: false,
speech: true,
subtitles: true,
treecoloring: true,
viewbraille: false
treeColoring: true,
viewBraille: false
}
};

Expand Down Expand Up @@ -384,12 +384,12 @@ let allExplorers: {[options: string]: ExplorerInit} = {
doc, doc.explorerRegions.brailleRegion, node, ...rest) as ke.SpeechExplorer;
explorer.speechGenerator.setOptions({locale: 'nemeth', domain: 'default',
style: 'default', modality: 'braille'});
explorer.showRegion = 'viewbraille';
explorer.showRegion = 'viewBraille';
return explorer;
},
keymagnifier: (doc: ExplorerMathDocument, node: HTMLElement, ...rest: any[]) =>
keyMagnifier: (doc: ExplorerMathDocument, node: HTMLElement, ...rest: any[]) =>
ke.Magnifier.create(doc, doc.explorerRegions.magnifier, node, ...rest),
mousemagnifier: (doc: ExplorerMathDocument, node: HTMLElement, ...rest: any[]) =>
mouseMagnifier: (doc: ExplorerMathDocument, node: HTMLElement, ...rest: any[]) =>
me.ContentHoverer.create(doc, doc.explorerRegions.magnifier, node,
(x: HTMLElement) => x.hasAttribute('data-semantic-type'),
(x: HTMLElement) => x),
Expand All @@ -409,7 +409,7 @@ let allExplorers: {[options: string]: ExplorerInit} = {
(x: HTMLElement) => x.getAttribute('data-semantic-prefix')),
flame: (doc: ExplorerMathDocument, node: HTMLElement, ...rest: any[]) =>
FlameColorer.create(doc, null, node),
treecoloring: (doc: ExplorerMathDocument, node: HTMLElement, ...rest: any[]) =>
treeColoring: (doc: ExplorerMathDocument, node: HTMLElement, ...rest: any[]) =>
TreeColorer.create(doc, null, node, ...rest)
};

Expand Down Expand Up @@ -444,7 +444,7 @@ export function setA11yOptions(document: HTMLDOCUMENT, options: {[key: string]:
}
}
// Reinit explorers
for (let item of document.math ) {
for (let item of document.math) {
(item as ExplorerMathItem).attachExplorers(document as ExplorerMathDocument);
}
}
Expand All @@ -462,18 +462,18 @@ export function setA11yOption(document: HTMLDOCUMENT, option: string, value: str
switch (value) {
case 'None':
document.options.a11y.magnifier = value;
document.options.a11y.keymagnifier = false;
document.options.a11y.mousemagnifier = false;
document.options.a11y.keyMagnifier = false;
document.options.a11y.mouseMagnifier = false;
break;
case 'Keyboard':
document.options.a11y.magnifier = value;
document.options.a11y.keymagnifier = true;
document.options.a11y.mousemagnifier = false;
document.options.a11y.keyMagnifier = true;
document.options.a11y.mouseMagnifier = false;
break;
case 'Mouse':
document.options.a11y.magnifier = value;
document.options.a11y.keymagnifier = false;
document.options.a11y.mousemagnifier = true;
document.options.a11y.keyMagnifier = false;
document.options.a11y.mouseMagnifier = true;
break;
}
break;
Expand Down
36 changes: 18 additions & 18 deletions mathjax3-ts/ui/menu/Menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ export interface MenuSettings {
magnification: string;
magnify: string;
speech: boolean;
speechrules: string;
speechRules: string;
subtitles: boolean;
treecoloring: boolean;
viewbraille: boolean;
treeColoring: boolean;
viewBraille: boolean;
}

export type HTMLMATHITEM = MathItem<HTMLElement, Text, Document>;
Expand Down Expand Up @@ -119,8 +119,8 @@ export class Menu {
scale: 1,
autocollapse: false,
collapsible: false,
inTabOrder: true
explorer: false,
inTabOrder: true,
explorer: false
},
jax: {
CHTML: null,
Expand Down Expand Up @@ -401,16 +401,16 @@ export class Menu {
this.setA11y({'subtitles': subtitles})),
this.variable<boolean>('braille', (braille: boolean) =>
this.setA11y({'braille': braille})),
this.variable<boolean>('viewbraille', (viewbraille: boolean) =>
this.setA11y({'viewbraille': viewbraille})),
this.variable<string> ('speechrules', (speechrules: string) =>
this.setA11y({'speechrules': speechrules})),
this.variable<boolean>('viewBraille', (viewBraille: boolean) =>
this.setA11y({'viewBraille': viewBraille})),
this.variable<string> ('speechRules', (speechRules: string) =>
this.setA11y({'speechRules': speechRules})),
this.variable<string> ('magnification', (magnification: string) =>
this.setA11y({'magnification': magnification})),
this.variable<string> ('magnify', (magnify: string) =>
this.setA11y({'magnify': magnify})),
this.variable<boolean>('treecoloring', (treecoloring: boolean) =>
this.setA11y({'treecoloring': treecoloring})),
this.variable<boolean>('treeColoring', (treeColoring: boolean) =>
this.setA11y({'treeColoring': treeColoring})),
this.variable<boolean>('infoType', (infoType: boolean) =>
this.setA11y({'infoType': infoType})),
this.variable<boolean>('infoRole', (infoRole: boolean) =>
Expand Down Expand Up @@ -464,19 +464,19 @@ export class Menu {
this.checkbox('Activate', 'Activate', 'explorer'),
this.submenu('Speech', 'Speech', [
this.checkbox('Speech', 'Speech Output', 'speech'),
this.checkbox('Subtitles', 'Subtities', 'subtitles'),
this.checkbox('Braille', 'Braille', 'braille'),
this.checkbox('View Braille', 'View Braille', 'viewbraille'),
this.checkbox('Subtitles', 'Speech Subtities', 'subtitles'),
this.checkbox('Braille', 'Braille Output', 'braille'),
this.checkbox('View Braille', 'Braille Subtitles', 'viewBraille'),
this.rule(),
this.submenu('Mathspeak', 'Mathspeak Rules', this.radioGroup('speechrules', [
this.submenu('Mathspeak', 'Mathspeak Rules', this.radioGroup('speechRules', [
['mathspeak-default', 'Verbose'],
['mathspeak-brief', 'Brief'],
['mathspeak-sbrief', 'Superbrief']
])),
this.submenu('Clearspeak', 'Clearspeak Rules', this.radioGroup('speechrules', [
this.submenu('Clearspeak', 'Clearspeak Rules', this.radioGroup('speechRules', [
['clearspeak-default', 'Standard']
])),
this.submenu('ChromeVox', 'ChromeVox Rules', this.radioGroup('speechrules', [
this.submenu('ChromeVox', 'ChromeVox Rules', this.radioGroup('speechRules', [
['chromvox-default', 'Verbose'],
['chromevox-short', 'Short'],
['chromevox-alternative', 'Alternative']
Expand All @@ -494,7 +494,7 @@ export class Menu {
['None'], ['Hover'], ['Flame']
]),
this.rule(),
this.checkbox('TreeColoring', 'Tree Coloring', 'treecoloring')
this.checkbox('TreeColoring', 'Tree Coloring', 'treeColoring')
]),
this.submenu('Magnification', 'Magnification', [
this.radioGroup('magnification', [
Expand Down