fixed a bug whera only a single line would appear in time mode

This commit is contained in:
Jack 2020-05-26 00:31:03 +01:00
parent 35bacf7b0d
commit c63dfdb6bc
3 changed files with 15 additions and 10 deletions

View file

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

View file

@ -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');
}

View file

@ -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) {