mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-04 21:09:18 +08:00
showing cpm on leaderboards when cpm mode is enabled
This commit is contained in:
parent
9e36207a1e
commit
4cd3c80259
1 changed files with 18 additions and 4 deletions
|
@ -3,6 +3,7 @@ import * as Notifications from "./notifications";
|
|||
import * as DB from "./db";
|
||||
import axiosInstance from "./axios-instance";
|
||||
import * as Misc from "./misc";
|
||||
import Config, * as UpdateConfig from "./config";
|
||||
|
||||
let currentLeaderboard = "time_15";
|
||||
|
||||
|
@ -183,10 +184,14 @@ function fillTable(lb, prepend) {
|
|||
entry.rank === 1 ? '<i class="fas fa-fw fa-crown"></i>' : entry.rank
|
||||
}</td>
|
||||
<td>${entry.name}</td>
|
||||
<td class="alignRight">${entry.wpm.toFixed(
|
||||
2
|
||||
)}<br><div class="sub">${entry.acc.toFixed(2)}%</div></td>
|
||||
<td class="alignRight">${entry.raw.toFixed(2)}<br><div class="sub">${
|
||||
<td class="alignRight">${(Config.alwaysShowCPM
|
||||
? entry.wpm * 5
|
||||
: entry.wpm
|
||||
).toFixed(2)}<br><div class="sub">${entry.acc.toFixed(2)}%</div></td>
|
||||
<td class="alignRight">${(Config.alwaysShowCPM
|
||||
? entry.raw * 5
|
||||
: entry.raw
|
||||
).toFixed(2)}<br><div class="sub">${
|
||||
!entry.consistency || entry.consistency === "-"
|
||||
? "-"
|
||||
: entry.consistency.toFixed(2) + "%"
|
||||
|
@ -389,6 +394,15 @@ export function show() {
|
|||
"disabled"
|
||||
);
|
||||
}
|
||||
if (Config.alwaysShowCPM) {
|
||||
$("#leaderboards table thead tr td:nth-child(3)").html(
|
||||
'cpm<br><div class="sub">accuracy</div>'
|
||||
);
|
||||
} else {
|
||||
$("#leaderboards table thead tr td:nth-child(3)").html(
|
||||
'wpm<br><div class="sub">accuracy</div>'
|
||||
);
|
||||
}
|
||||
$("#leaderboardsWrapper")
|
||||
.stop(true, true)
|
||||
.css("opacity", 0)
|
||||
|
|
Loading…
Reference in a new issue