From 54685e9fb8e27445aeedc58b68219e7e45679bc8 Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 15 Aug 2020 15:40:21 +0100 Subject: [PATCH] fixed randomcase not adding words --- public/js/script.js | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/public/js/script.js b/public/js/script.js index c21432769..44c1b49b8 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -587,18 +587,29 @@ function addWord() { randomWord = language[Math.floor(Math.random() * language.length)]; } } + + if (activeFunBox === "rAnDoMcAsE") { + let randomcaseword = ""; + for (let i = 0; i < randomWord.length; i++) { + if (i % 2 != 0) { + randomcaseword += randomWord[i].toUpperCase(); + } else { + randomcaseword += randomWord[i]; + } + } + randomWord = randomcaseword; + } else if (activeFunBox === "gibberish") { + randomWord = getGibberish(); + } else if (activeFunBox === "58008") { + randomWord = getNumbers(); + } else if (activeFunBox === "specials") { + randomWord = getSpecials(); + } + if (config.punctuation && config.mode != "custom") { randomWord = punctuateWord(previousWord, randomWord, wordsList.length, 0); } - if (activeFunBox === "gibberish") { - randomWord = getGibberish(); - } - if (activeFunBox === "58008") { - randomWord = getNumbers(); - } - if (activeFunBox === "specials") { - randomWord = getSpecials(); - } + wordsList.push(randomWord); let w = "
";