From 97affb1206d29dd134a99c717de826e13312e7c2 Mon Sep 17 00:00:00 2001 From: Otard95 Date: Sun, 30 May 2021 20:25:02 +0200 Subject: [PATCH] Add minAccGrace setting --- src/js/config.js | 16 +++++++++++++--- src/js/settings.js | 1 + static/index.html | 29 ++++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/js/config.js b/src/js/config.js index 0fc1284f2..1e88ecd64 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -112,6 +112,7 @@ let defaultConfig = { strictSpace: false, minAcc: "off", minAccCustom: 90, + minAccGrace: "off", showLiveAcc: false, monkey: false, repeatQuotes: "off", @@ -561,6 +562,14 @@ export function setMinAccCustom(val, nosave) { if (!nosave) saveToLocalStorage(); } +export function setMinAccGrace(val, nosave) { + if (val !== "on") { + val = "off"; + } + config.minAccGrace = val; + if (!nosave) saveToLocalStorage(); +} + //always show words history export function setAlwaysShowWordsHistory(val, nosave) { if (val == undefined) { @@ -858,9 +867,9 @@ export function setHighlightMode(mode, nosave) { } config.highlightMode = mode; // if(TestLogic.active){ - try{ - if (!nosave) TestUI.updateWordElement(config.blindMode); - }catch{} + try { + if (!nosave) TestUI.updateWordElement(config.blindMode); + } catch {} // } if (!nosave) saveToLocalStorage(); } @@ -1547,6 +1556,7 @@ export function apply(configObj) { setMinWpmCustomSpeed(configObj.minWpmCustomSpeed, true); setMinAcc(configObj.minAcc, true); setMinAccCustom(configObj.minAccCustom, true); + setMinAccGrace(configObj.minAccGrace, true); setNumbers(configObj.numbers, true); setPunctuation(configObj.punctuation, true); setHighlightMode(configObj.highlightMode, true); diff --git a/src/js/settings.js b/src/js/settings.js index a3c03a8a2..d1418a580 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -217,6 +217,7 @@ async function initGroups() { $(".pageSettings .section.minAcc input.customMinAcc").addClass("hidden"); } }); + groups.minAcc = new SettingsGroup("minAccGrace", UpdateConfig.setMinAccGrace); groups.smoothLineScroll = new SettingsGroup( "smoothLineScroll", UpdateConfig.setSmoothLineScroll diff --git a/static/index.html b/static/index.html index 348059ea7..c1dc89486 100644 --- a/static/index.html +++ b/static/index.html @@ -2248,6 +2248,31 @@ /> +
+

min accuracy grace

+
+ When min accuracy is on, turning this setting on as well will + forgive a few errors at the begining of each test. +
+
+
+ off +
+
+ on +
+
+

language groups

@@ -2706,7 +2731,9 @@

repeated pace

- When repeating a test, a pace caret will automatically be enabled for one test with the speed of your previous test. It does not override the pace caret if it's already enabled. + When repeating a test, a pace caret will automatically be + enabled for one test with the speed of your previous test. It + does not override the pace caret if it's already enabled.