diff --git a/gulpfile.js b/gulpfile.js
index e73ad8398..3d68988be 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -40,7 +40,7 @@ let eslintConfig = {
"no-dupe-else-if": "warn",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
- "no-empty": "warn",
+ "no-empty": ["warn", { allowEmptyCatch: true }],
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-ex-assign": "error",
@@ -72,7 +72,7 @@ let eslintConfig = {
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unused-labels": "error",
- "no-unused-vars": "warn",
+ "no-unused-vars": ["warn", { argsIgnorePattern: "e|event" }],
"no-use-before-define": "warn",
"no-useless-catch": "error",
"no-useless-escape": "error",
diff --git a/src/js/account.js b/src/js/account.js
index a471a0520..f3af1bf86 100644
--- a/src/js/account.js
+++ b/src/js/account.js
@@ -98,7 +98,7 @@ function linkWithGoogle() {
});
}
-let dontCheckUserName = false;
+// let dontCheckUserName = false;
function signUp() {
$(".pageLogin .register .button").addClass("disabled");
@@ -135,7 +135,7 @@ function signUp() {
.createUserWithEmailAndPassword(email, password)
.then((user) => {
// Account has been created here.
- dontCheckUserName = true;
+ // dontCheckUserName = true;
let usr = user.user;
usr
.updateProfile({
@@ -257,12 +257,12 @@ firebase.auth().onAuthStateChanged(function (user) {
accountIconLoading(true);
getAccountDataAndInit();
var displayName = user.displayName;
- var email = user.email;
- var emailVerified = user.emailVerified;
- var photoURL = user.photoURL;
- var isAnonymous = user.isAnonymous;
- var uid = user.uid;
- var providerData = user.providerData;
+ // var email = user.email;
+ // var emailVerified = user.emailVerified;
+ // var photoURL = user.photoURL;
+ // var isAnonymous = user.isAnonymous;
+ // var uid = user.uid;
+ // var providerData = user.providerData;
$(".pageLogin .preloader").addClass("hidden");
$("#menu .icon-button.account .text").text(displayName);
@@ -562,10 +562,10 @@ var resultHistoryChart = new Chart($(".pageAccount #resultHistoryChart"), {
return label;
},
- label: function (tooltipItem, data) {
+ label: function () {
return;
},
- afterLabel: function (tooltipItem, data) {
+ afterLabel: function () {
return;
},
},
@@ -684,7 +684,7 @@ let activityChart = new Chart($(".pageAccount #activityChart"), {
return `Average Wpm: ${Misc.roundTo2(resultData.y)}`;
}
},
- label: function (tooltipItem, data) {
+ label: function () {
return;
},
},
@@ -1225,23 +1225,23 @@ function showActiveFilters() {
refreshAccountPage();
}
-function showChartPreloader() {
- $(".pageAccount .group.chart .preloader").stop(true, true).animate(
- {
- opacity: 1,
- },
- 125
- );
-}
+// function showChartPreloader() {
+// $(".pageAccount .group.chart .preloader").stop(true, true).animate(
+// {
+// opacity: 1,
+// },
+// 125
+// );
+// }
-function hideChartPreloader() {
- $(".pageAccount .group.chart .preloader").stop(true, true).animate(
- {
- opacity: 0,
- },
- 125
- );
-}
+// function hideChartPreloader() {
+// $(".pageAccount .group.chart .preloader").stop(true, true).animate(
+// {
+// opacity: 0,
+// },
+// 125
+// );
+// }
$(".pageAccount .topFilters .button.allFilters").click((e) => {
Object.keys(ResultFilters.getFilters()).forEach((group) => {
@@ -2146,26 +2146,16 @@ function refreshAccountPage() {
let minWpmChartVal = Math.min(...wpms);
let maxWpmChartVal = Math.max(...wpms);
- let accuracies = accChartData.map((r) => r.y);
- let minAccuracyChartVal = Math.min(...accuracies);
- let maxAccuracyChartVal = Math.max(...accuracies);
-
+ // let accuracies = accChartData.map((r) => r.y);
resultHistoryChart.options.scales.yAxes[0].ticks.max =
Math.floor(maxWpmChartVal) + (10 - (Math.floor(maxWpmChartVal) % 10));
- // resultHistoryChart.options.scales.yAxes[1].ticks.max = Math.ceil(
- // maxAccuracyChartVal
- // );
if (!config.startGraphsAtZero) {
resultHistoryChart.options.scales.yAxes[0].ticks.min = Math.floor(
minWpmChartVal
);
- // resultHistoryChart.options.scales.yAxes[1].ticks.min = Math.floor(
- // minAccuracyChartVal
- // );
} else {
resultHistoryChart.options.scales.yAxes[0].ticks.min = 0;
- // resultHistoryChart.options.scales.yAxes[1].ticks.min = 0;
}
if (chartData == [] || chartData.length == 0) {
@@ -2331,11 +2321,11 @@ function hideResultEditTagsPanel() {
}
}
-$(".pageAccount .toggleAccuracyOnChart").click((params) => {
+$(".pageAccount .toggleAccuracyOnChart").click((e) => {
toggleChartAccuracy();
});
-$(".pageAccount .toggleChartStyle").click((params) => {
+$(".pageAccount .toggleChartStyle").click((e) => {
toggleChartStyle();
});
@@ -2381,9 +2371,9 @@ function updateActiveResultEditTagsPanelButtons(active) {
});
}
-$("#resultEditTagsPanel .confirmButton").click((f) => {
+$("#resultEditTagsPanel .confirmButton").click((e) => {
let resultid = $("#resultEditTagsPanel").attr("resultid");
- let oldtags = JSON.parse($("#resultEditTagsPanel").attr("tags"));
+ // let oldtags = JSON.parse($("#resultEditTagsPanel").attr("tags"));
let newtags = [];
$.each($("#resultEditTagsPanel .buttons .button"), (index, obj) => {
diff --git a/src/js/db.js b/src/js/db.js
index 194bfd313..c54c4a9ee 100644
--- a/src/js/db.js
+++ b/src/js/db.js
@@ -197,7 +197,6 @@ export async function db_getUserAverageWpm10(
function cont() {
let wpmSum = 0;
let count = 0;
- let i = 0;
// You have to use every so you can break out of the loop
dbSnapshot.results.every((result) => {
if (
diff --git a/src/js/exports.js b/src/js/exports.js
index 6630acbaa..776259179 100644
--- a/src/js/exports.js
+++ b/src/js/exports.js
@@ -3,6 +3,7 @@
//try to keep this list short because we need to eliminate it eventually
global.simplePopups = simplePopups;
global.sendVerificationEmail = Misc.sendVerificationEmail;
+global.getuid = getuid;
//these exports are just for debugging in the browser
global.snapshot = db_getSnapshot;
diff --git a/src/js/notification-center.js b/src/js/notification-center.js
index c0f3be1fe..eb655cc6b 100644
--- a/src/js/notification-center.js
+++ b/src/js/notification-center.js
@@ -87,7 +87,7 @@ class Notification {
);
}
);
- $(`#notificationCenter .notif[id='${this.id}']`).click((e) => {
+ $(`#notificationCenter .notif[id='${this.id}']`).click(() => {
this.hide();
});
}
@@ -97,7 +97,7 @@ class Notification {
this.hide();
}, this.duration + 250);
}
- $(`#notificationCenter .notif[id='${this.id}']`).hover((e) => {
+ $(`#notificationCenter .notif[id='${this.id}']`).hover(() => {
$(`#notificationCenter .notif[id='${this.id}']`).toggleClass("hover");
});
}
diff --git a/src/js/result-filters.js b/src/js/result-filters.js
index ed1c30357..bf9f95e8a 100644
--- a/src/js/result-filters.js
+++ b/src/js/result-filters.js
@@ -1,7 +1,5 @@
import * as Misc from "./misc";
-let filters = defaultResultFilters;
-
let defaultResultFilters = {
difficulty: {
normal: true,
@@ -58,7 +56,7 @@ let defaultResultFilters = {
},
};
-load();
+let filters = defaultResultFilters;
Misc.getLanguageList().then((languages) => {
languages.forEach((language) => {
@@ -123,3 +121,5 @@ export function reset() {
filters = defaultResultFilters;
save();
}
+
+load();
diff --git a/src/js/script.js b/src/js/script.js
index c5a0a1790..a632061d8 100644
--- a/src/js/script.js
+++ b/src/js/script.js
@@ -269,7 +269,7 @@ function copyResultToClipboard() {
})
),
])
- .then((f) => {
+ .then(() => {
$("#notificationCenter").removeClass("hidden");
$("#commandLineMobileButton").removeClass("hidden");
Notifications.add("Copied to clipboard", 1, 2);
@@ -834,14 +834,14 @@ function punctuateWord(previousWord, currentWord, index, maxindex) {
) {
word = `"${word}"`;
} else if (
- Math.random() < 0.01 &&
+ Math.random() < 0.011 &&
Misc.getLastChar(previousWord) != "," &&
Misc.getLastChar(previousWord) != "." &&
config.language.split("_")[0] !== "russian"
) {
word = `'${word}'`;
} else if (
- Math.random() < 0.01 &&
+ Math.random() < 0.012 &&
Misc.getLastChar(previousWord) != "," &&
Misc.getLastChar(previousWord) != "."
) {
@@ -859,21 +859,21 @@ function punctuateWord(previousWord, currentWord, index, maxindex) {
} else {
word = `(${word})`;
}
- } else if (Math.random() < 0.01) {
+ } else if (Math.random() < 0.013) {
if (config.language.split("_")[0] == "french") {
word = ":";
} else {
word += ":";
}
} else if (
- Math.random() < 0.01 &&
+ Math.random() < 0.014 &&
Misc.getLastChar(previousWord) != "," &&
Misc.getLastChar(previousWord) != "." &&
previousWord != "-"
) {
word = "-";
} else if (
- Math.random() < 0.01 &&
+ Math.random() < 0.015 &&
Misc.getLastChar(previousWord) != "," &&
Misc.getLastChar(previousWord) != "." &&
Misc.getLastChar(previousWord) != ";"
@@ -1177,8 +1177,7 @@ function updateWordElement(showError) {
// }
// }
if (!showError) {
- if (currentLetter == undefined) {
- } else {
+ if (currentLetter !== undefined) {
ret += `