fixed some todo's

This commit is contained in:
Miodec 2021-03-26 00:31:03 +00:00
parent d0f8ea3d82
commit aec4959d5b
5 changed files with 10 additions and 11 deletions

View file

@ -12,7 +12,6 @@ export function stopAnimation() {
}
}
//TODO remove config when module
export function startAnimation() {
if (caretAnimating === false) {
if (Config.smoothCaret) {
@ -28,8 +27,6 @@ export function hide() {
$("#caret").addClass("hidden");
}
//TODO remove this after test logic is a module
//TODO remove config when module
export function updatePosition() {
if ($("#wordsWrapper").hasClass("hidden")) return;
if ($("#caret").hasClass("off")) {

View file

@ -1,4 +1,4 @@
import Config from "./config";
import Config, * as UpdateConfig from "./config";
import * as ThemeColors from "./theme-colors";
import layouts from "./layouts";
@ -152,8 +152,7 @@ export function show() {
$(".keymap").removeClass("hidden");
}
//TODO remove setkeymaplayout after userconfig is a module
export function refreshKeys(layout, setKeymapLayout) {
export function refreshKeys(layout) {
try {
let lts = layouts[layout]; //layout to show
let layoutString = layout;
@ -240,6 +239,6 @@ export function refreshKeys(layout, setKeymapLayout) {
console.log(
"something went wrong when changing layout, resettings: " + e.message
);
setKeymapLayout("qwerty", true);
UpdateConfig.setKeymapLayout("qwerty", true);
}
}

View file

@ -1,4 +1,5 @@
import Config from "./config";
import * as TestLogic from "./test-logic";
export function update(acc) {
let number = Math.floor(acc);
@ -11,7 +12,7 @@ export function update(acc) {
export function show() {
if (!Config.showLiveAcc) return;
// if (!TestLogic.active) return;
if (!TestLogic.active) return;
if (Config.timerStyle === "mini") {
// $("#miniTimerAndLiveWpm .wpm").css("opacity", Config.timerOpacity);
if (!$("#miniTimerAndLiveWpm .acc").hasClass("hidden")) return;

View file

@ -1,4 +1,5 @@
import Config from "./config";
import * as TestLogic from "./test-logic";
export function update(wpm, raw) {
// if (!TestLogic.active || !Config.showLiveWpm) {
@ -17,9 +18,9 @@ export function update(wpm, raw) {
document.querySelector("#liveWpm").innerHTML = number;
}
//TODO needs to check if test is active
export function show() {
if (!Config.showLiveWpm) return;
if (!TestLogic.active) return;
if (Config.timerStyle === "mini") {
// $("#miniTimerAndLiveWpm .wpm").css("opacity", Config.timerOpacity);
if (!$("#miniTimerAndLiveWpm .wpm").hasClass("hidden")) return;

View file

@ -2,6 +2,7 @@ import Config from "./config";
import * as CustomText from "./custom-text";
import * as Misc from "./misc";
import * as TestLogic from "./test-logic";
import * as TestTimer from "./test-timer";
export function show() {
let op = Config.showTimerProgress ? Config.timerOpacity : 0;
@ -84,8 +85,8 @@ export function restart() {
}
}
//TODO remove the parameters once they are inside a module
export function update(time) {
export function update() {
let time = TestTimer.time;
if (
Config.mode === "time" ||
(Config.mode === "custom" && CustomText.isTimeRandom)