Skip to content

Commit c63dfdb

Browse files
committed
fixed a bug whera only a single line would appear in time mode
1 parent 35bacf7 commit c63dfdb

3 files changed

Lines changed: 15 additions & 10 deletions

File tree

public/js/commandline.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,28 +272,32 @@ let commandsFontSize = {
272272
id: "changeFontSize1",
273273
display: "1x",
274274
exec: () => {
275-
changeFontSize(1)
275+
changeFontSize(1);
276+
restartTest();
276277
}
277278
},
278279
{
279280
id: "changeFontSize125",
280281
display: "1.25x",
281282
exec: () => {
282-
changeFontSize(125)
283+
changeFontSize(125);
284+
restartTest();
283285
}
284286
},
285287
{
286288
id: "changeFontSize15",
287289
display: "1.5x",
288290
exec: () => {
289-
changeFontSize(15)
291+
changeFontSize(15);
292+
restartTest();
290293
}
291294
},
292295
{
293296
id: "changeFontSize2",
294297
display: "2x",
295298
exec: () => {
296-
changeFontSize(2)
299+
changeFontSize(2);
300+
restartTest();
297301
}
298302
}
299303
]
@@ -313,7 +317,6 @@ $.getJSON("themes/list.json", function(data) {
313317
},
314318
exec: () => {
315319
setTheme(theme);
316-
saveConfigToCookie();
317320
}
318321
})
319322
})

public/js/script.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ function changeCustomText() {
668668
customText = prompt("Custom text");
669669
customText = customText.replace(/[\n\r\t ]/gm, ' ');
670670
customText = customText.replace(/ +/gm, ' ');
671-
initWords();
671+
// initWords();
672672
}
673673

674674
function changeWordCount(wordCount) {
@@ -682,7 +682,6 @@ function changeWordCount(wordCount) {
682682
$("#top .config .wordCount .button[wordCount='" + wordCount + "']").addClass(
683683
"active"
684684
);
685-
restartTest();
686685
saveConfigToCookie();
687686
}
688687

@@ -695,7 +694,6 @@ function changeTimeConfig(time) {
695694
time = "custom";
696695
}
697696
$("#top .config .time .button[timeConfig='" + time + "']").addClass("active");
698-
restartTest();
699697
saveConfigToCookie();
700698
}
701699

@@ -889,6 +887,7 @@ $(document).on("click", "#top .config .wordCount .button", (e) => {
889887
}else{
890888
changeWordCount(wrd);
891889
}
890+
restartTest();
892891
});
893892

894893
$(document).on("click", "#top .config .time .button", (e) => {
@@ -901,10 +900,13 @@ $(document).on("click", "#top .config .time .button", (e) => {
901900
}else{
902901
changeTimeConfig(time);
903902
}
903+
restartTest();
904904
});
905905

906906
$(document).on("click", "#top .config .customText .button", (e) => {
907907
changeCustomText();
908+
restartTest();
909+
908910
});
909911

910912
$(document).on("click", "#top .config .punctuationMode .button", (e) => {
@@ -1176,7 +1178,7 @@ if (window.location.hostname === "localhost") {
11761178
$(document).ready(() => {
11771179
updateFavicon(32,14);
11781180
$('body').css('transition', '.25s');
1179-
// restartTest();
1181+
restartTest();
11801182
if (config.quickTab) {
11811183
$("#restartTestButton").addClass('hidden');
11821184
}

public/js/userconfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ function loadConfigFromCookie() {
4141
}
4242
config = newConfig;
4343
}
44-
restartTest();
4544
}
4645

4746
function showTestConfig() {
@@ -166,6 +165,7 @@ function setTheme(name) {
166165
}catch(e){
167166
console.log("Analytics unavailable");
168167
}
168+
saveConfigToCookie();
169169
}
170170

171171
function updateFavicon(size, curveSize) {

0 commit comments

Comments
 (0)