diff --git a/public/js/commandline.js b/public/js/commandline.js index a2e1af07a..376d72e2f 100644 --- a/public/js/commandline.js +++ b/public/js/commandline.js @@ -272,28 +272,32 @@ let commandsFontSize = { id: "changeFontSize1", display: "1x", exec: () => { - changeFontSize(1) + changeFontSize(1); + restartTest(); } }, { id: "changeFontSize125", display: "1.25x", exec: () => { - changeFontSize(125) + changeFontSize(125); + restartTest(); } }, { id: "changeFontSize15", display: "1.5x", exec: () => { - changeFontSize(15) + changeFontSize(15); + restartTest(); } }, { id: "changeFontSize2", display: "2x", exec: () => { - changeFontSize(2) + changeFontSize(2); + restartTest(); } } ] @@ -313,7 +317,6 @@ $.getJSON("themes/list.json", function(data) { }, exec: () => { setTheme(theme); - saveConfigToCookie(); } }) }) diff --git a/public/js/script.js b/public/js/script.js index 08e70e7ba..eb41843d2 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -668,7 +668,7 @@ function changeCustomText() { customText = prompt("Custom text"); customText = customText.replace(/[\n\r\t ]/gm, ' '); customText = customText.replace(/ +/gm, ' '); - initWords(); + // initWords(); } function changeWordCount(wordCount) { @@ -682,7 +682,6 @@ function changeWordCount(wordCount) { $("#top .config .wordCount .button[wordCount='" + wordCount + "']").addClass( "active" ); - restartTest(); saveConfigToCookie(); } @@ -695,7 +694,6 @@ function changeTimeConfig(time) { time = "custom"; } $("#top .config .time .button[timeConfig='" + time + "']").addClass("active"); - restartTest(); saveConfigToCookie(); } @@ -889,6 +887,7 @@ $(document).on("click", "#top .config .wordCount .button", (e) => { }else{ changeWordCount(wrd); } + restartTest(); }); $(document).on("click", "#top .config .time .button", (e) => { @@ -901,10 +900,13 @@ $(document).on("click", "#top .config .time .button", (e) => { }else{ changeTimeConfig(time); } + restartTest(); }); $(document).on("click", "#top .config .customText .button", (e) => { changeCustomText(); + restartTest(); + }); $(document).on("click", "#top .config .punctuationMode .button", (e) => { @@ -1176,7 +1178,7 @@ if (window.location.hostname === "localhost") { $(document).ready(() => { updateFavicon(32,14); $('body').css('transition', '.25s'); - // restartTest(); + restartTest(); if (config.quickTab) { $("#restartTestButton").addClass('hidden'); } diff --git a/public/js/userconfig.js b/public/js/userconfig.js index caa5dfc27..248556c2a 100644 --- a/public/js/userconfig.js +++ b/public/js/userconfig.js @@ -41,7 +41,6 @@ function loadConfigFromCookie() { } config = newConfig; } - restartTest(); } function showTestConfig() { @@ -166,6 +165,7 @@ function setTheme(name) { }catch(e){ console.log("Analytics unavailable"); } + saveConfigToCookie(); } function updateFavicon(size, curveSize) {