result page now shows cpm when enabled

This commit is contained in:
corey 2020-10-30 11:02:11 -04:00
parent 63114268c4
commit 88253bd8f9

View file

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