Skip to content

Commit d89a4c0

Browse files
committed
Add help information (again), hide the replace-speech menu (again), and use noRender() as requested in review
1 parent 4ef32a6 commit d89a4c0

2 files changed

Lines changed: 29 additions & 13 deletions

File tree

ts/a11y/explorer/KeyExplorer.ts

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,16 @@ export class SpeechExplorer
129129
/**
130130
* Creates a customized help dialog
131131
*
132-
* @param {string} title The title to use for the message
133-
* @param {string} select Additional ways to select the typeset math
134-
* @returns {string} The customized message
135-
*/
136-
protected static helpMessage(title: string, select: string): string {
132+
* @param {string} title The title to use for the message
133+
* @param {string} select Additional ways to select the typeset math
134+
* @param {string} braille Additional Braille information
135+
* @returns {string} The customized message
136+
*/
137+
protected static helpMessage(
138+
title: string,
139+
select: string,
140+
braille: string
141+
): string {
137142
return `
138143
<h2 role="heading" aria-level="2">Exploring expressions ${title}</h2>
139144
@@ -222,6 +227,13 @@ export class SpeechExplorer
222227
speech and Braille will disable the expression explorer, its
223228
highlighting, and its help icon.</p>
224229
230+
<p>Support for tactile Braille devices varies across screen readers,
231+
browsers, and operative systems. If you are using a Braille output
232+
device, you may need to select the "Combine with Speech" option in the
233+
contextual menu's Braille submenu in order to obtain Nemeth or Euro
234+
Braille output rather than the speech text on your Braille
235+
device. ${braille}</p>
236+
225237
<p>The contextual menu also provides options for viewing or copying a
226238
MathML version of the expression or its original source format,
227239
creating an SVG version of the expression, and viewing various other
@@ -243,12 +255,13 @@ export class SpeechExplorer
243255
/**
244256
* Help for the different OS versions
245257
*/
246-
protected static helpData: Map<string, [string, string]> = new Map([
258+
protected static helpData: Map<string, [string, string, string]> = new Map([
247259
[
248260
'MacOS',
249261
[
250262
'on MacOS and iOS using VoiceOver',
251263
', or the VoiceOver arrow keys to select an expression',
264+
'',
252265
],
253266
],
254267
[
@@ -262,6 +275,8 @@ export class SpeechExplorer
262275
the NVDA or JAWS key plus the arrow keys to explore the expression
263276
even in browse mode, and you can use NVDA+shift+arrow keys to
264277
navigate out of an expression that has the focus in NVDA`,
278+
`NVDA users need to select this option, while JAWS users should be able
279+
to get Braille output without changing this setting.`,
265280
],
266281
],
267282
[
@@ -271,9 +286,10 @@ export class SpeechExplorer
271286
`, and Orca should enter focus mode automatically. If not, use the
272287
Orca+a key to toggle focus mode on or off. Also note that you can use
273288
Orca+arrow keys to explore expressions even in browse mode`,
289+
'',
274290
],
275291
],
276-
['unknown', ['with a Screen Reader.', '']],
292+
['unknown', ['with a Screen Reader.', '', '']],
277293
]);
278294

279295
/*
@@ -1034,10 +1050,10 @@ export class SpeechExplorer
10341050
return;
10351051
}
10361052
const CLASS = this.constructor as typeof SpeechExplorer;
1037-
const [title, select] = CLASS.helpData.get(context.os);
1053+
const [title, select, braille] = CLASS.helpData.get(context.os);
10381054
InfoDialog.post({
10391055
title: 'MathJax Expression Explorer Help',
1040-
message: CLASS.helpMessage(title, select),
1056+
message: CLASS.helpMessage(title, select, braille),
10411057
node: this.node,
10421058
adaptor: this.document.adaptor,
10431059
styles: {

ts/ui/menu/Menu.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,9 @@ export class Menu {
814814
this.submenu('Braille', '\xA0 \xA0 Braille', [
815815
this.checkbox('Generate', 'Generate', 'braille'),
816816
this.checkbox('Subtitles', 'Show Subtitles', 'viewBraille'),
817-
this.checkbox('BrailleSpeech', 'Replace Speech', 'brailleSpeech'),
817+
this.checkbox('BrailleSpeech', 'Replace Speech', 'brailleSpeech', {
818+
hidden: true,
819+
}),
818820
this.checkbox(
819821
'BrailleCombine',
820822
'Combine with Speech',
@@ -1312,9 +1314,7 @@ export class Menu {
13121314
*/
13131315
protected setBrailleSpeech(speech: boolean) {
13141316
if (speech && this.settings.speech) {
1315-
Menu.loading++; // pretend we're loading, to suppress rerendering for each variable change
1316-
this.menu.pool.lookup('speech').setValue(false);
1317-
Menu.loading--;
1317+
this.noRerender(() => this.menu.pool.lookup('speech').setValue(false));
13181318
} else {
13191319
this.enableAccessibilityItems('Speech', true);
13201320
}

0 commit comments

Comments
 (0)