mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-10 06:01:28 +08:00
quick tab mode can now jump to the test page
This commit is contained in:
parent
779d9d1255
commit
54038ea427
2 changed files with 12 additions and 8 deletions
|
|
@ -292,7 +292,7 @@
|
|||
</div>
|
||||
<div class="section quickTab">
|
||||
<h1>quick tab mode</h1>
|
||||
<div class="text">Press <key>tab</key> to quickly restart the test. This function disables tab navigation on some parts of the website.</div>
|
||||
<div class="text">Press <key>tab</key> to quickly restart the test, or to quickly jump to the test page. This function disables tab navigation on the website.</div>
|
||||
<div class="buttons">
|
||||
<div class="button on" tabindex="0" onclick="this.blur();">on</div>
|
||||
<div class="button off" tabindex="0" onclick="this.blur();">off</div>
|
||||
|
|
|
|||
|
|
@ -1832,15 +1832,19 @@ $(document).keydown((event) => {
|
|||
//tab
|
||||
|
||||
if (event["keyCode"] == 9) {
|
||||
if (config.quickTab && $(".pageTest").hasClass("active")) {
|
||||
if (config.quickTab) {
|
||||
event.preventDefault();
|
||||
if (testActive && !afkDetected) {
|
||||
let testNow = Date.now();
|
||||
let testSeconds = roundTo2((testNow - testStart) / 1000);
|
||||
incompleteTestSeconds += testSeconds;
|
||||
restartCount++;
|
||||
if($(".pageTest").hasClass("active")){
|
||||
if (testActive && !afkDetected) {
|
||||
let testNow = Date.now();
|
||||
let testSeconds = roundTo2((testNow - testStart) / 1000);
|
||||
incompleteTestSeconds += testSeconds;
|
||||
restartCount++;
|
||||
}
|
||||
restartTest();
|
||||
}else{
|
||||
changePage('test');
|
||||
}
|
||||
restartTest();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue