removed dependencies

This commit is contained in:
Miodec 2022-02-11 01:38:43 +01:00
parent a5e842fe91
commit 7b599a2465
5 changed files with 18 additions and 21 deletions

View file

@ -1,7 +1,6 @@
import * as Config from "../config";
import * as DB from "../db";
import * as Notifications from "../elements/notifications";
import * as Settings from "../pages/settings";
import * as TestLogic from "../test/test-logic";
import * as TagController from "./tag-controller";
@ -19,7 +18,6 @@ export function apply(_id) {
TestLogic.restart();
Notifications.add("Preset applied", 1, 2);
Config.saveToLocalStorage();
Settings.update();
}
});
}

View file

@ -284,6 +284,7 @@ export function updatePresetCommands() {
display: dis,
exec: () => {
PresetController.apply(preset._id);
Settings.update();
TestUI.updateModesNotice();
},
});

View file

@ -634,3 +634,19 @@ $(document).on("click", ".keymap .r5 #KeySpace", (e) => {
CommandlineLists.setCurrent([CommandlineLists.commandsKeymapLayouts]);
show();
});
$(document).on("click", "#testModesNotice .text-button", (event) => {
let commands = CommandlineLists.getList(
$(event.currentTarget).attr("commands")
);
let func = $(event.currentTarget).attr("function");
if (commands !== undefined) {
if ($(event.currentTarget).attr("commands") === "commandsTags") {
CommandlineLists.updateTagCommands();
}
CommandlineLists.pushCurrent(commands);
show();
} else if (func != undefined) {
eval(func);
}
});

View file

@ -808,6 +808,7 @@ $(document).on(
let presetid = $(target).parent(".preset").attr("id");
console.log("Applying Preset");
PresetController.apply(presetid);
update();
}
);

View file

@ -9,8 +9,6 @@ import * as PaceCaret from "./pace-caret";
import * as CustomText from "./custom-text";
import * as Keymap from "../elements/keymap";
import * as Caret from "./caret";
import * as CommandlineLists from "../elements/commandline-lists";
import * as Commandline from "../elements/commandline";
import * as OutOfFocus from "./out-of-focus";
import * as ManualRestart from "./manual-restart-tracker";
import * as PractiseWords from "./practise-words";
@ -1080,23 +1078,6 @@ $(document).on("mouseenter", "#resultWordsHistory .words .word", (e) => {
}
});
$(document).on("click", "#testModesNotice .text-button", (event) => {
// console.log("CommandlineLists."+$(event.currentTarget).attr("commands"));
let commands = CommandlineLists.getList(
$(event.currentTarget).attr("commands")
);
let func = $(event.currentTarget).attr("function");
if (commands !== undefined) {
if ($(event.currentTarget).attr("commands") === "commandsTags") {
CommandlineLists.updateTagCommands();
}
CommandlineLists.pushCurrent(commands);
Commandline.show();
} else if (func != undefined) {
eval(func);
}
});
$("#wordsInput").on("focus", () => {
if (!resultVisible && Config.showOutOfFocusWarning) {
OutOfFocus.hide();