mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-07 22:23:45 +08:00
added max confidence mode
This commit is contained in:
parent
2b0ed50100
commit
e2d78501fa
5 changed files with 70 additions and 2 deletions
|
@ -316,6 +316,14 @@
|
|||
<div class="button off" tabindex="0" onclick="this.blur();">off</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section maxConfidence">
|
||||
<h1>max confidence</h1>
|
||||
<div class="text">When enabled, you will not be able to go back to previous words to fix mistakes.</div>
|
||||
<div class="buttons">
|
||||
<div class="button on" tabindex="0" onclick="this.blur();">on</div>
|
||||
<div class="button off" tabindex="0" onclick="this.blur();">off</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section blindMode">
|
||||
<h1>blind mode</h1>
|
||||
<div class="text">No errors or incorrect words are highlighted. Helps you to focus on raw speed. If enabled, quick end is recommended.</div>
|
||||
|
|
|
@ -57,6 +57,13 @@ let commands = {
|
|||
toggleFreedomMode();
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "toggleMaxConfidence",
|
||||
display: "Toggle max confidence",
|
||||
exec: () => {
|
||||
toggleMaxConfidence();
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "toggleBlindMode",
|
||||
display: "Toggle blind mode",
|
||||
|
|
|
@ -1714,6 +1714,7 @@ $(document).keydown((event) => {
|
|||
) {
|
||||
return;
|
||||
} else {
|
||||
if(config.maxConfidence) return;
|
||||
if (event["ctrlKey"] || event["altKey"]) {
|
||||
currentInput = "";
|
||||
inputHistory.pop();
|
||||
|
|
|
@ -64,7 +64,7 @@ function updateSettingsPage(){
|
|||
setSettingsButton('flipTestColors', config.flipTestColors);
|
||||
setSettingsButton('discordDot', config.showDiscordDot);
|
||||
setSettingsButton('extraTestColor', config.extraTestColor);
|
||||
|
||||
setSettingsButton('maxConfidence', config.maxConfidence);
|
||||
|
||||
setActiveThemeButton();
|
||||
setActiveLanguageButton();
|
||||
|
@ -192,12 +192,30 @@ $(".pageSettings .section.freedomMode .buttons .button.on").click(e => {
|
|||
saveConfigToCookie();
|
||||
showNotification('Freedom mode on', 1000);
|
||||
setSettingsButton('freedomMode', config.freedomMode);
|
||||
setSettingsButton('maxConfidence', config.maxConfidence);
|
||||
})
|
||||
$(".pageSettings .section.freedomMode .buttons .button.off").click(e => {
|
||||
setFreedomMode(false);
|
||||
saveConfigToCookie();
|
||||
showNotification('Freedom mode off', 1000);
|
||||
setSettingsButton('freedomMode', config.freedomMode);
|
||||
setSettingsButton('maxConfidence', config.maxConfidence);
|
||||
})
|
||||
|
||||
//max confidence
|
||||
$(".pageSettings .section.maxConfidence .buttons .button.on").click(e => {
|
||||
setMaxConfidence(true);
|
||||
saveConfigToCookie();
|
||||
showNotification('Max confidence on', 1000);
|
||||
setSettingsButton('freedomMode', config.freedomMode);
|
||||
setSettingsButton('maxConfidence', config.maxConfidence);
|
||||
})
|
||||
$(".pageSettings .section.maxConfidence .buttons .button.off").click(e => {
|
||||
setMaxConfidence(false);
|
||||
saveConfigToCookie();
|
||||
showNotification('Max confidence off', 1000);
|
||||
setSettingsButton('freedomMode', config.freedomMode);
|
||||
setSettingsButton('maxConfidence', config.maxConfidence);
|
||||
})
|
||||
|
||||
//keytips
|
||||
|
|
|
@ -19,7 +19,8 @@ let defaultConfig = {
|
|||
caretStyle: "default",
|
||||
flipTestColors: false,
|
||||
layout:"default",
|
||||
showDiscordDot: true
|
||||
showDiscordDot: true,
|
||||
maxConfidence: false
|
||||
}
|
||||
|
||||
let config = defaultConfig;
|
||||
|
@ -58,6 +59,7 @@ function loadConfigFromCookie() {
|
|||
setFlipTestColors(newConfig.flipTestColors,true);
|
||||
setDiscordDot(newConfig.hideDiscordDot,true);
|
||||
setExtraTestColor(newConfig.extraTestColor,true);
|
||||
setMaxConfidence(newConfig.maxConfidence,true);
|
||||
if(newConfig.resultFilters == null || newConfig.resultFilters == undefined){
|
||||
newConfig.resultFilters = ["all"];
|
||||
}
|
||||
|
@ -331,14 +333,46 @@ function togglePunctuation() {
|
|||
//freedom
|
||||
function setFreedomMode(freedom, nosave) {
|
||||
config.freedomMode = freedom;
|
||||
if(config.freedomMode && config.maxConfidence){
|
||||
config.maxConfidence = false;
|
||||
}
|
||||
if(!nosave) saveConfigToCookie();
|
||||
}
|
||||
|
||||
function toggleFreedomMode() {
|
||||
config.freedomMode = !config.freedomMode;
|
||||
if(config.freedomMode && config.maxConfidence){
|
||||
config.maxConfidence = false;
|
||||
}
|
||||
saveConfigToCookie();
|
||||
}
|
||||
|
||||
//max confidence
|
||||
function toggleMaxConfidence(){
|
||||
// console.log(config.maxConfidence)
|
||||
mc = !config.maxConfidence;
|
||||
if(mc == undefined){
|
||||
mc = false;
|
||||
}
|
||||
config.maxConfidence = mc;
|
||||
if(config.freedomMode && config.maxConfidence){
|
||||
config.freedomMode = false;
|
||||
}
|
||||
// console.log(config.maxConfidence);
|
||||
saveConfigToCookie();
|
||||
}
|
||||
|
||||
function setMaxConfidence(mc, nosave){
|
||||
if(mc == undefined){
|
||||
mc = false;
|
||||
}
|
||||
config.maxConfidence = mc;
|
||||
if(config.freedomMode && config.maxConfidence){
|
||||
config.freedomMode = false;
|
||||
}
|
||||
if(!nosave) saveConfigToCookie();
|
||||
}
|
||||
|
||||
function previewTheme(name) {
|
||||
$("#currentTheme").attr("href", `themes/${name}.css`);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue