quick tab mode can now jump to the test page

This commit is contained in:
Jack 2020-06-29 21:16:01 +01:00
parent 779d9d1255
commit 54038ea427
2 changed files with 12 additions and 8 deletions

View file

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

View file

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