Browse Source

Merge branch 'odiffey-owen-shortcut-overrides' into polishing

Kristian Vos 3 years ago
parent
commit
eb69692c06
3 changed files with 18 additions and 2 deletions
  1. 10 1
      frontend/dist/config/template.json
  2. 7 0
      frontend/src/keyboardShortcuts.js
  3. 1 1
      frontend/src/main.js

+ 10 - 1
frontend/dist/config/template.json

@@ -22,6 +22,15 @@
 	"messages": {
 		"accountRemoval": "Your account will be deactivated instantly and your data will shortly be deleted by an admin."
 	},
+	// "shortcutOverrides": {
+	// 	"editSong.useAllDiscogs": {
+	// 		"keyCode": 68,
+	// 		"ctrl": true,
+	// 		"alt": true,
+	// 		"shift": false,
+	// 		"preventDefault": true
+	// 	}
+	// },
 	"skipConfigVersionCheck": false,
-	"configVersion": 6
+	"configVersion": 7
 }

+ 7 - 0
frontend/src/keyboardShortcuts.js

@@ -32,6 +32,13 @@ const lib = {
 		shortcuts[name].shift = shortcuts[name].shift
 			? shortcuts[name].shift
 			: false;
+		lofig.get("shortcutOverrides").then(overrides => {
+			if (overrides && overrides[name])
+				shortcuts[name] = Object.assign(
+					shortcuts[name],
+					overrides[name]
+				);
+		});
 		lib.remakeShortcutsArray();
 	},
 

+ 1 - 1
frontend/src/main.js

@@ -9,7 +9,7 @@ import store from "./store";
 
 import AppComponent from "./App.vue";
 
-const REQUIRED_CONFIG_VERSION = 6;
+const REQUIRED_CONFIG_VERSION = 7;
 
 const handleMetadata = attrs => {
 	document.title = `Musare | ${attrs.title}`;