Add minAccGrace setting

This commit is contained in:
Otard95 2021-05-30 20:25:02 +02:00
parent 23e6239002
commit 97affb1206
3 changed files with 42 additions and 4 deletions

View file

@ -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);

View file

@ -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

View file

@ -2248,6 +2248,31 @@
/>
</div>
</div>
<div class="section minAccGrace" section="">
<h1>min accuracy grace</h1>
<div class="text">
When min accuracy is on, turning this setting on as well will
forgive a few errors at the begining of each test.
</div>
<div class="buttons">
<div
class="button"
minAccGrace="off"
tabindex="0"
onclick="this.blur();"
>
off
</div>
<div
class="button"
minAccGrace="on"
tabindex="0"
onclick="this.blur();"
>
on
</div>
</div>
</div>
<div class="section languageGroups fullWidth">
<h1>language groups</h1>
<div class="buttons"></div>
@ -2706,7 +2731,9 @@
<div class="section repeatedPace" section="">
<h1>repeated pace</h1>
<div class="text">
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.
</div>
<div class="buttons">
<div class="button off" tabindex="0" onclick="this.blur();">