Skip to content

Commit 2dda480

Browse files
committed
Fixes the rules and preferences menu
1 parent fb70006 commit 2dda480

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

ts/a11y/explorer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ export function setA11yOption(document: HTMLDOCUMENT, option: string, value: str
383383
break;
384384
case 'locale':
385385
document.options.sre.locale = value;
386-
document.options.a11y.locale = value;
387386
break;
388387
default:
389388
document.options.a11y[option] = value;

ts/a11y/semantic-enrich.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ export function EnrichedMathDocumentMixin<N, T, D, B extends MathDocumentConstru
382382
sre: expandable({
383383
speech: 'none', // by default no speech is included
384384
locale: 'en', // switch the locale
385-
domain: 'mathspeak', // speech rules domain
385+
domain: 'clearspeak', // speech rules domain
386386
style: 'default', // speech rules style
387387
braille: 'nemeth', // TODO: Dummy switch for braille
388388
}),

ts/ui/menu/Menu.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export class Menu {
146146
speech: true,
147147
braille: true,
148148
brailleCode: 'nemeth',
149-
speechRules: 'mathspeek-default'
149+
speechRules: 'clearspeak-default'
150150
},
151151
jax: {
152152
CHTML: null,
@@ -507,11 +507,20 @@ export class Menu {
507507
this.a11yVar<boolean>('viewBraille'),
508508
this.a11yVar<boolean>('voicing'),
509509
this.a11yVar<string>('locale', locale => this.setLocale(locale)),
510-
this.a11yVar<string>('speechRules', value => {
511-
const [domain, style] = value.split('-');
512-
this.document.options.sre.domain = domain;
513-
this.document.options.sre.style = style;
514-
}),
510+
{
511+
name: 'speechRules',
512+
getter: () => {
513+
return this.settings['speechRules'];
514+
},
515+
setter: (value: string) => {
516+
const [domain, style] = value.split('-');
517+
this.settings['speechRules'] = value;
518+
this.document.options.sre.domain = domain;
519+
this.document.options.sre.style = style;
520+
this.rerender(STATE.COMPILED);
521+
this.saveUserSettings();
522+
}
523+
},
515524
this.a11yVar<string> ('magnification'),
516525
this.a11yVar<string> ('magnify'),
517526
this.a11yVar<boolean>('treeColoring'),
@@ -840,7 +849,7 @@ export class Menu {
840849
options.linebreaks.inline = settings.breakInline;
841850
if (!settings.speechRules) {
842851
const sre = this.document.options.sre;
843-
settings.speechRules = `${sre.domain || 'mathspeak'}-${sre.style || 'default'}`;
852+
settings.speechRules = `${sre.domain || 'clearspeak'}-${sre.style || 'default'}`;
844853
}
845854
});
846855
}

0 commit comments

Comments
 (0)