Skip to content

Commit

Permalink
fix: add missing button to the settings page
Browse files Browse the repository at this point in the history
also fixes incorrect modes notice with certain config combinations
  • Loading branch information
Miodec committed Feb 13, 2024
1 parent ee3f9d4 commit c445a46
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
9 changes: 7 additions & 2 deletions frontend/src/ts/elements/modes-notice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ConfigEvent.subscribe((eventKey) => {
"layout",
"showAverage",
"typingSpeedUnit",
"quickRestart",
].includes(eventKey)
) {
void update();
Expand All @@ -50,9 +51,13 @@ export async function update(): Promise<void> {
$(".pageTest #testModesNotice").append(
`<div class="textButton noInteraction"><i class="fas fa-long-arrow-alt-right"></i>shift + tab to open commandline</div>`
);
} else {
$(".pageTest #testModesNotice").append(
`<div class="textButton noInteraction"><i class="fas fa-long-arrow-alt-right"></i>shift + tab to restart</div>`
`<div class="textButton noInteraction"><i class="fas fa-level-down-alt fa-rotate-90"></i>shift + esc to restart</div>`
);
}
if (Config.quickRestart === "tab") {
$(".pageTest #testModesNotice").append(
`<div class="textButton noInteraction"><i class="fas fa-level-down-alt fa-rotate-90"></i>shift + tab to restart</div>`
);
}
}
Expand Down
14 changes: 12 additions & 2 deletions frontend/static/html/pages/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@
<div class="text">
Press
<key>tab</key>
or
,
<key>esc</key>
to quickly restart the test, or to quickly jump to the test page. Both
or
<key>enter</key>
to quickly restart the test, or to quickly jump to the test page. These
options disable tab navigation on most parts of the website. Using the
"esc" option will move opening the commandline to the
<key>tab</key>
Expand Down Expand Up @@ -210,6 +212,14 @@
>
esc
</div>
<div
class="button"
quickRestart="enter"
tabindex="0"
onclick="this.blur();"
>
enter
</div>
</div>
</div>

Expand Down

0 comments on commit c445a46

Please sign in to comment.