diff --git a/public/index.html b/public/index.html
index 2b75ee7b9..fc795c5de 100644
--- a/public/index.html
+++ b/public/index.html
@@ -237,6 +237,11 @@
Shows the keybind tips at the bottom of the page.
font size
Change the font size of the test words
diff --git a/public/js/commandline.js b/public/js/commandline.js
index 31d0e7be5..a2e1af07a 100644
--- a/public/js/commandline.js
+++ b/public/js/commandline.js
@@ -42,6 +42,13 @@ let commands = {
toggleKeyTips();
}
},
+ {
+ id: "toggleFreedom",
+ display: "Toggle freedom mode",
+ exec: () => {
+ toggleFreedomMode();
+ }
+ },
{
id: "changeTheme",
display: "Change theme...",
diff --git a/public/js/script.js b/public/js/script.js
index 2166d0646..3063fdd26 100644
--- a/public/js/script.js
+++ b/public/js/script.js
@@ -1019,9 +1019,7 @@ $(document).keydown((event) => {
if (!testActive) return;
if (currentInput == "" && inputHistory.length > 0) {
if (
- inputHistory[currentWordIndex - 1] ==
- wordsList[currentWordIndex - 1] ||
- $($(".word")[currentWordIndex - 1]).hasClass("hidden")
+ (inputHistory[currentWordIndex - 1] == wordsList[currentWordIndex - 1] && !config.freedomMode) || $($(".word")[currentWordIndex - 1]).hasClass("hidden")
) {
return;
} else {
diff --git a/public/js/settings.js b/public/js/settings.js
index 28ee53201..dee79167d 100644
--- a/public/js/settings.js
+++ b/public/js/settings.js
@@ -14,6 +14,8 @@ function updateSettingsPage(){
setSettingsButton('quickTab', config.quickTab);
setSettingsButton('liveWpm', config.showLiveWpm);
setSettingsButton('keyTips', config.showKeyTips);
+ setSettingsButton('freedomMode', config.freedomMode);
+
setActiveThemeButton();
setActiveLanguageButton();
@@ -92,6 +94,20 @@ $(".pageSettings .section.liveWpm .buttons .button.off").click(e => {
setSettingsButton('liveWpm', config.showLiveWpm);
})
+//freedom mode
+$(".pageSettings .section.freedomMode .buttons .button.on").click(e => {
+ setFreedomMode(true);
+ saveConfigToCookie();
+ showNotification('Freedom mode on', 1000);
+ setSettingsButton('freedomMode', config.freedomMode);
+})
+$(".pageSettings .section.freedomMode .buttons .button.off").click(e => {
+ setFreedomMode(false);
+ saveConfigToCookie();
+ showNotification('Freedom mode off', 1000);
+ setSettingsButton('freedomMode', config.freedomMode);
+})
+
//keytips
$(".pageSettings .section.keyTips .buttons .button.on").click(e => {
setKeyTips(true);
diff --git a/public/js/userconfig.js b/public/js/userconfig.js
index 03320552c..6b8dda522 100644
--- a/public/js/userconfig.js
+++ b/public/js/userconfig.js
@@ -9,7 +9,8 @@ let config = {
time: 30,
mode: "words",
language: "english",
- fontSize: 1
+ fontSize: 1,
+ freedomMode: false
}
//cookies
@@ -33,6 +34,7 @@ function loadConfigFromCookie() {
changeMode(newConfig.mode);
changeLanguage(newConfig.language);
changeFontSize(newConfig.fontSize);
+ setFreedomMode(newConfig.freedomMode);
config = newConfig;
restartTest();
}
@@ -134,6 +136,17 @@ function togglePunctuation() {
saveConfigToCookie();
}
+//freedom
+function setFreedomMode(freedom) {
+ config.freedomMode = freedom;
+ saveConfigToCookie();
+}
+
+function toggleFreedomMode() {
+ config.freedomMode = !config.freedomMode;
+ saveConfigToCookie();
+}
+
function previewTheme(name) {
$("#currentTheme").attr("href", `themes/${name}.css`);
}