added highlightmode off

This commit is contained in:
Jack 2021-05-08 21:54:05 +01:00
parent 9758dbb987
commit 05740dabae
3 changed files with 22 additions and 2 deletions

View file

@ -702,6 +702,13 @@ let commandsKeymapLegendStyle = {
let commandsHighlightMode = {
title: "Change highlight mode...",
list: [
{
id: "setHighlightModeOff",
display: "off",
exec: () => {
UpdateConfig.setHighlightMode("off");
},
},
{
id: "setHighlightModeLetter",
display: "letter",

View file

@ -334,6 +334,11 @@ export function updateWordElement(showError) {
charCorrect = false;
}
let correctClass = "correct";
if (Config.highlightMode == "off") {
correctClass = "";
}
let currentLetter = currentWord[i];
let tabChar = "";
let nlChar = "";
@ -346,11 +351,11 @@ export function updateWordElement(showError) {
}
if (charCorrect) {
ret += `<letter class="correct ${tabChar}${nlChar}">${currentLetter}</letter>`;
ret += `<letter class="${correctClass} ${tabChar}${nlChar}">${currentLetter}</letter>`;
} else {
if (!showError) {
if (currentLetter !== undefined) {
ret += `<letter class="correct ${tabChar}${nlChar}">${currentLetter}</letter>`;
ret += `<letter class="${correctClass} ${tabChar}${nlChar}">${currentLetter}</letter>`;
}
} else {
if (currentLetter == undefined) {

View file

@ -2839,6 +2839,14 @@
Change what is highlighted during the test.
</div>
<div class="buttons">
<div
class="button"
highlightMode="off"
tabindex="0"
onclick="this.blur();"
>
off
</div>
<div
class="button"
highlightMode="letter"