This commit is contained in:
Jack 2020-07-25 15:32:25 +01:00
commit 77d670853d
2 changed files with 42 additions and 13 deletions

View file

@ -7,7 +7,7 @@
<title>Monkey Type</title>
<link rel="stylesheet" href="css/fa.css">
<link rel="stylesheet" href="css/balloon.css">
<link rel="stylesheet" href="css/style.css?v=43">
<link rel="stylesheet" href="css/style.css?v=44">
<link rel="stylesheet" href="themes/serika_dark.css" id="currentTheme">
<link id="favicon" rel="shortcut icon" href="fav.png">
<link rel="shortcut icon" href="fav.png">
@ -1370,17 +1370,17 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js"></script> -->
<script src="js/chart.js"></script>
<script src="js/chartjs-plugin-trendline.js?v=43"></script>
<script src="js/chartjs-plugin-trendline.js?v=44"></script>
<script src="js/chartjs-plugin-annotation.js"></script>
<script src="js/html2canvas.js"></script>
<script src="js/words.js?v=43"></script>
<script src="js/layouts.js?v=43"></script>
<script src="js/db.js?v=43"></script>
<script src="js/userconfig.js?v=43"></script>
<script src="js/commandline.js?v=43"></script>
<script src="js/leaderboards.js?v=43"></script>
<script src="js/settings.js?v=43"></script>
<script src="js/account.js?v=43"></script>
<script src="js/script.js?v=43"></script>
<script src="js/words.js?v=44"></script>
<script src="js/layouts.js?v=44"></script>
<script src="js/db.js?v=44"></script>
<script src="js/userconfig.js?v=44"></script>
<script src="js/commandline.js?v=44"></script>
<script src="js/leaderboards.js?v=44"></script>
<script src="js/settings.js?v=44"></script>
<script src="js/account.js?v=44"></script>
<script src="js/script.js?v=44"></script>
</html>

View file

@ -2651,7 +2651,20 @@ $(document).keypress(function (event) {
}
currentKeypressCount++;
if (config.stopOnError && !thisCharCorrect) return;
if (config.stopOnError && !thisCharCorrect) {
if (config.difficulty == "master") {
showResult(true);
if (!afkDetected) {
let testNow = Date.now();
let testSeconds = roundTo2((testNow - testStart) / 1000);
incompleteTestSeconds += testSeconds;
restartCount++;
}
return;
} else {
return;
}
}
currentInput += event["key"];
setFocus(true);
@ -2822,7 +2835,23 @@ $(document).keydown((event) => {
updateActiveElement();
updateCaretPosition();
currentKeypressCount++;
} else if (!config.stopOnError) {
} else {
if (config.stopOnError) {
if (
config.difficulty == "expert" ||
config.difficulty == "master"
) {
showResult(true);
if (!afkDetected) {
let testNow = Date.now();
let testSeconds = roundTo2((testNow - testStart) / 1000);
incompleteTestSeconds += testSeconds;
restartCount++;
}
return;
}
return;
}
inputHistory.push(currentInput);
highlightBadWord(currentWordElementIndex, !config.blindMode);
currentInput = "";