diff --git a/src/js/commandline-lists.js b/src/js/commandline-lists.js index 4d7992a9d..988d1c124 100644 --- a/src/js/commandline-lists.js +++ b/src/js/commandline-lists.js @@ -15,7 +15,6 @@ import * as Funbox from "./funbox"; import * as TagController from "./tag-controller"; import * as Commandline from "./commandline"; import * as CustomText from "./custom-text"; -import { keymapLegendStyles } from "../../static/keymap/legend"; export let current = []; @@ -653,23 +652,23 @@ let commandsKeymapLegendStyle = { list: [ { id: "setKeymapLegendStyleLowercase", - display: keymapLegendStyles.lowercase, + display: "lowercase", exec: () => { - UpdateConfig.setKeymapLegendStyle(keymapLegendStyles.lowercase); + UpdateConfig.setKeymapLegendStyle("lowercase"); }, }, { id: "setKeymapLegendStyleUppercase", - display: keymapLegendStyles.uppercase, + display: "uppercase", exec: () => { - UpdateConfig.setKeymapLegendStyle(keymapLegendStyles.uppercase); + UpdateConfig.setKeymapLegendStyle("uppercase"); }, }, { id: "setKeymapLegendStyleBlank", - display: keymapLegendStyles.blank, + display: "blank", exec: () => { - UpdateConfig.setKeymapLegendStyle(keymapLegendStyles.blank); + UpdateConfig.setKeymapLegendStyle("blank"); }, }, ], diff --git a/src/js/config.js b/src/js/config.js index d252c8263..f48be2055 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -17,7 +17,6 @@ import * as PaceCaret from "./pace-caret"; import * as UI from "./ui"; import * as CommandlineLists from "./commandline-lists"; import * as BackgroundFilter from "./custom-background-filter"; -import keymapLegendStyles from "../../static/keymap/legend/_list.json"; export let cookieConfig = null; export let dbConfigLoaded = false; @@ -87,7 +86,7 @@ let defaultConfig = { showAllLines: false, keymapMode: "off", keymapStyle: "staggered", - keymapLegendStyle: keymapLegendStyles.lowercase, + keymapLegendStyle: "lowercase", keymapLayout: "qwerty", fontFamily: "Roboto_Mono", smoothLineScroll: false, @@ -1268,11 +1267,12 @@ export function setKeymapMode(mode, nosave) { export function setKeymapLegendStyle(style, nosave) { // Remove existing styles - Object.keys(keymapLegendStyles).forEach((name) => { + const keymapLegendStyles = ["lowercase", "uppercase", "blank"]; + keymapLegendStyles.forEach((name) => { $(".keymapLegendStyle").removeClass(name); }); - style = style || keymapLegendStyles.lowercase; + style = style || "lowercase"; // Mutate the keymap in the DOM, if it exists. // 1. Remove everything @@ -1280,10 +1280,10 @@ export function setKeymapLegendStyle(style, nosave) { $(".keymap-key > .letter").css("text-transform", ""); // 2. Append special styles onto the DOM elements - if (style === keymapLegendStyles.uppercase) { + if (style === "uppercase") { $(".keymap-key > .letter").css("text-transform", "capitalize"); } - if (style === keymapLegendStyles.blank) { + if (style === "blank") { $(".keymap-key > .letter").css("display", "none"); } diff --git a/src/js/settings.js b/src/js/settings.js index fb7c6e5d1..c542befb8 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -13,7 +13,6 @@ import * as TagController from "./tag-controller"; import * as SimplePopups from "./simple-popups"; import * as EditTagsPopup from "./edit-tags-popup"; import * as ThemePicker from "./theme-picker"; -import { KEYMAP_LEGEND_TITLE } from "../../static/keymap/legend"; export let groups = {}; async function initGroups() { @@ -69,7 +68,7 @@ async function initGroups() { UpdateConfig.setKeymapLayout ); groups.keymapLegendStyle = new SettingsGroup( - KEYMAP_LEGEND_TITLE, + "keymapLegendStyle", UpdateConfig.setKeymapLegendStyle ); groups.showKeyTips = new SettingsGroup( diff --git a/static/keymap/legend/_list.json b/static/keymap/legend/_list.json deleted file mode 100644 index 874cf7b0b..000000000 --- a/static/keymap/legend/_list.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lowercase": "lowercase", - "uppercase": "uppercase", - "blank": "blank" -} \ No newline at end of file diff --git a/static/keymap/legend/index.js b/static/keymap/legend/index.js deleted file mode 100644 index 3c3db597f..000000000 --- a/static/keymap/legend/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export * as keymapLegendStyles from "./_list.json"; -export const KEYMAP_LEGEND_TITLE = "keymapLegendStyle";