mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-24 23:07:25 +08:00
added highlightmode off
This commit is contained in:
parent
9758dbb987
commit
05740dabae
3 changed files with 22 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue