From c556abf1ca13c011832db8af4fd51c6c6e80ffae Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 22 Jul 2020 21:23:25 +0100 Subject: [PATCH] made sure all _ are replaced --- public/js/commandline.js | 6 +++--- public/js/script.js | 4 ++-- public/js/settings.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/js/commandline.js b/public/js/commandline.js index 895fd124c..ee2b6e0af 100644 --- a/public/js/commandline.js +++ b/public/js/commandline.js @@ -603,7 +603,7 @@ $.getJSON("themes/list.json", function (data) { data.forEach((theme) => { commandsThemes.list.push({ id: "changeTheme" + capitalizeFirstLetter(theme.name), - display: theme.name.replace("_", " "), + display: theme.name.replace(/_/g, " "), hover: () => { previewTheme(theme.name); }, @@ -640,7 +640,7 @@ if (Object.keys(words).length > 0) { if (language === "english_10k") return; commandsLanguages.list.push({ id: "changeLanguage" + capitalizeFirstLetter(language), - display: language.replace("_", " "), + display: language.replace(/_/g, " "), exec: () => { changeLanguage(language); restartTest(); @@ -676,7 +676,7 @@ if (Object.keys(layouts).length > 0) { Object.keys(layouts).forEach((layout) => { commandsLayouts.list.push({ id: "changeLayout" + capitalizeFirstLetter(layout), - display: layout.replace("_", " "), + display: layout.replace(/_/g, " "), exec: () => { changeLayout(layout); restartTest(); diff --git a/public/js/script.js b/public/js/script.js index 53dc6eefa..f9954df72 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -1424,7 +1424,7 @@ function showResult(difficultyFailed = false) { testType += " " + config.words; } if (config.mode != "custom") { - testType += "
" + config.language.replace("_", " "); + testType += "
" + config.language.replace(/_/g, " "); } if (config.punctuation) { testType += "
punctuation"; @@ -1554,7 +1554,7 @@ function restartTest(withSameWordset = false) { if (resultVisible) { if (config.randomTheme) { randomiseTheme(); - showNotification(config.theme.replace("_", " "), 1500); + showNotification(config.theme.replace(/_/g, " "), 1500); } $("#words").stop(true, true).animate( { diff --git a/public/js/settings.js b/public/js/settings.js index 7aa6634cc..6da64fbaa 100644 --- a/public/js/settings.js +++ b/public/js/settings.js @@ -4,7 +4,7 @@ function updateSettingsPage() { themesEl.append( `
${theme.name.replace("_", " ")}
` + };background:${theme.bgColor}">${theme.name.replace(/_/g, " ")}` ); });