made sure all _ are replaced

This commit is contained in:
Jack 2020-07-22 21:23:25 +01:00
parent bf3064e750
commit c556abf1ca
3 changed files with 6 additions and 6 deletions

View file

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

View file

@ -1424,7 +1424,7 @@ function showResult(difficultyFailed = false) {
testType += " " + config.words;
}
if (config.mode != "custom") {
testType += "<br>" + config.language.replace("_", " ");
testType += "<br>" + config.language.replace(/_/g, " ");
}
if (config.punctuation) {
testType += "<br>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(
{

View file

@ -4,7 +4,7 @@ function updateSettingsPage() {
themesEl.append(
`<div class="theme button" theme='${theme.name}' style="color:${
theme.textColor
};background:${theme.bgColor}">${theme.name.replace("_", " ")}</div>`
};background:${theme.bgColor}">${theme.name.replace(/_/g, " ")}</div>`
);
});