mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 13:27:49 +08:00
result page now shows cpm when enabled
This commit is contained in:
parent
63114268c4
commit
88253bd8f9
1 changed files with 4 additions and 0 deletions
|
@ -1740,6 +1740,7 @@ function showResult(difficultyFailed = false) {
|
|||
|
||||
if (config.alwaysShowDecimalPlaces) {
|
||||
if (config.alwaysShowCPM == false) {
|
||||
$("#result .stats .wpm .top").text("wpm");
|
||||
$("#result .stats .wpm .bottom").text(roundTo2(stats.wpm));
|
||||
$("#result .stats .raw .bottom").text(roundTo2(stats.wpmRaw));
|
||||
$("#result .stats .wpm .bottom").attr(
|
||||
|
@ -1747,6 +1748,7 @@ function showResult(difficultyFailed = false) {
|
|||
roundTo2(stats.wpm * 5) + " cpm"
|
||||
);
|
||||
} else {
|
||||
$("#result .stats .wpm .top").text("cpm");
|
||||
$("#result .stats .wpm .bottom").text(roundTo2(stats.wpm * 5));
|
||||
$("#result .stats .raw .bottom").text(roundTo2(stats.wpmRaw * 5));
|
||||
$("#result .stats .wpm .bottom").attr(
|
||||
|
@ -1772,6 +1774,7 @@ function showResult(difficultyFailed = false) {
|
|||
} else {
|
||||
//not showing decimal places
|
||||
if (config.alwaysShowCPM == false) {
|
||||
$("#result .stats .wpm .top").text("wpm");
|
||||
$("#result .stats .wpm .bottom").attr(
|
||||
"aria-label",
|
||||
stats.wpm + ` (${roundTo2(stats.wpm * 5)} cpm)`
|
||||
|
@ -1780,6 +1783,7 @@ function showResult(difficultyFailed = false) {
|
|||
$("#result .stats .raw .bottom").text(Math.round(stats.wpmRaw));
|
||||
$("#result .stats .raw .bottom").attr("aria-label", stats.wpmRaw);
|
||||
} else {
|
||||
$("#result .stats .wpm .top").text("cpm");
|
||||
$("#result .stats .wpm .bottom").attr(
|
||||
"aria-label",
|
||||
stats.wpm + ` (${roundTo2(stats.wpm)} wpm)`
|
||||
|
|
Loading…
Reference in a new issue