-
-
Info
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
Shortcuts
+
You can modify the shortcuts here, read the documentation for more information. Shortcuts not work on this tab, go to any other settings tab to reactivate them!
+
+
-
Global shortcuts
You can modify the global shortcuts here, read the documentation for more information. Shortcuts not work on this tab, go to any other settings tab to reactivate them!
-
-
-
-
Show/Hide App
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Settings
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
Exit App
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Quick copy shortcuts
-
You can create a shortcut for your most used codes to copy quickly. Shortcuts not work on this tab, go to any other settings tab to reactivate them!
-
-
diff --git a/app/settings/src/js/shortcuts.js b/app/settings/src/js/shortcuts.js
index 40ff12c5..27cfaf87 100644
--- a/app/settings/src/js/shortcuts.js
+++ b/app/settings/src/js/shortcuts.js
@@ -26,6 +26,107 @@ const default_shortcuts = {
},
}
+/**
+ * Create shortcuts
+ */
+const createShortcuts = () => {
+ const names = lang.menu
+
+ delete names.file
+ delete names.hide_app
+ delete names.view
+ delete names.tools
+ delete names.help
+ delete names.about
+
+ let i = 0
+
+ for (const name in names) {
+ const element = `
+
+
+
${names[name]}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `
+ const div = document.createElement("div")
+ div.innerHTML = element
+ document.querySelector(".shortcutsDiv").appendChild(div)
+
+ i++
+ }
+}
+
+createShortcuts()
+
+/**
+ * Create global shortcuts
+ */
+const createGlobalShortcuts = () => {
+ const names = lang.tray
+
+ delete names.hide_app
+
+ let i = 100
+
+ for (const name in names) {
+ const element = `
+
+
+
${names[name]}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `
+ const div = document.createElement("div")
+ div.innerHTML = element
+ document.querySelector(".globalShortcutsDiv").appendChild(div)
+
+ i++
+ }
+}
+
+createGlobalShortcuts()
+
/**
* Load storage
* @type {LibStorage}
@@ -68,18 +169,18 @@ const hk102 = document.querySelector("#hk102_input")
hk0.value = settings.shortcuts.show
hk1.value = settings.shortcuts.settings
hk2.value = settings.shortcuts.exit
-hk3.value = settings.shortcuts.edit
-hk4.value = settings.shortcuts.import
-hk5.value = settings.shortcuts.export
-hk6.value = settings.shortcuts.release
-hk7.value = settings.shortcuts.support
-hk8.value = settings.shortcuts.docs
-hk9.value = settings.shortcuts.licenses
-hk10.value = settings.shortcuts.update
-hk11.value = settings.shortcuts.info
-hk12.value = settings.shortcuts.zoom_reset
-hk13.value = settings.shortcuts.zoom_in
-hk14.value = settings.shortcuts.zoom_out
+hk3.value = settings.shortcuts.zoom_reset
+hk4.value = settings.shortcuts.zoom_in
+hk5.value = settings.shortcuts.zoom_out
+hk6.value = settings.shortcuts.edit
+hk7.value = settings.shortcuts.import
+hk8.value = settings.shortcuts.export
+hk9.value = settings.shortcuts.docs
+hk10.value = settings.shortcuts.release
+hk11.value = settings.shortcuts.support
+hk12.value = settings.shortcuts.licenses
+hk13.value = settings.shortcuts.update
+hk14.value = settings.shortcuts.info
hk100.value = settings.global_shortcuts.show
hk101.value = settings.global_shortcuts.settings
hk102.value = settings.global_shortcuts.exit
@@ -158,63 +259,63 @@ const hk_edit = (value) => {
case 3:
const hk3 = document.querySelector("#hk3_input").value
- settings.shortcuts.edit = hk3
+ settings.shortcuts.zoom_reset = hk3
break
case 4:
const hk4 = document.querySelector("#hk4_input").value
- settings.shortcuts.import = hk4
+ settings.shortcuts.zoom_in = hk4
break
case 5:
const hk5 = document.querySelector("#hk5_input").value
- settings.shortcuts.export = hk5
+ settings.shortcuts.zoom_out = hk5
break
case 6:
const hk6 = document.querySelector("#hk6_input").value
- settings.shortcuts.release = hk6
+ settings.shortcuts.edit = hk6
break
case 7:
const hk7 = document.querySelector("#hk7_input").value
- settings.shortcuts.support = hk7
+ settings.shortcuts.import = hk7
break
case 8:
const hk8 = document.querySelector("#hk8_input").value
- settings.shortcuts.docs = hk8
+ settings.shortcuts.export = hk8
break
case 9:
const hk9 = document.querySelector("#hk9_input").value
- settings.shortcuts.licenses = hk9
+ settings.shortcuts.docs = hk9
break
case 10:
const hk10 = document.querySelector("#hk10_input").value
- settings.shortcuts.update = hk10
+ settings.shortcuts.release = hk10
break
case 11:
const hk11 = document.querySelector("#hk11_input").value
- settings.shortcuts.info = hk11
+ settings.shortcuts.support = hk11
break
case 12:
const hk12 = document.querySelector("#hk12_input").value
- settings.shortcuts.zoom_reset = hk12
+ settings.shortcuts.licenses = hk12
break
case 13:
const hk13 = document.querySelector("#hk13_input").value
- settings.shortcuts.zoom_in = hk13
+ settings.shortcuts.update = hk13
break
case 14:
const hk14 = document.querySelector("#hk14_input").value
- settings.shortcuts.zoom_out = hk14
+ settings.shortcuts.info = hk14
break
// global shortcuts
@@ -292,63 +393,63 @@ const hk_delete = (value) => {
case 3:
const hk3 = document.querySelector("#hk3_input").value
- settings.shortcuts.edit = hk3
+ settings.shortcuts.zoom_reset = hk3
break
case 4:
const hk4 = document.querySelector("#hk4_input").value
- settings.shortcuts.import = hk4
+ settings.shortcuts.zoom_in = hk4
break
case 5:
const hk5 = document.querySelector("#hk5_input").value
- settings.shortcuts.export = hk5
+ settings.shortcuts.zoom_out = hk5
break
case 6:
const hk6 = document.querySelector("#hk6_input").value
- settings.shortcuts.release = hk6
+ settings.shortcuts.edit = hk6
break
case 7:
const hk7 = document.querySelector("#hk7_input").value
- settings.shortcuts.support = hk7
+ settings.shortcuts.import = hk7
break
case 8:
const hk8 = document.querySelector("#hk8_input").value
- settings.shortcuts.docs = hk8
+ settings.shortcuts.export = hk8
break
case 9:
const hk9 = document.querySelector("#hk9_input").value
- settings.shortcuts.licenses = hk9
+ settings.shortcuts.docs = hk9
break
case 10:
const hk10 = document.querySelector("#hk10_input").value
- settings.shortcuts.update = hk10
+ settings.shortcuts.release = hk10
break
case 11:
const hk11 = document.querySelector("#hk11_input").value
- settings.shortcuts.info = hk11
+ settings.shortcuts.support = hk11
break
case 12:
const hk12 = document.querySelector("#hk12_input").value
- settings.shortcuts.zoom_reset = hk12
+ settings.shortcuts.licenses = hk12
break
case 13:
const hk13 = document.querySelector("#hk13_input").value
- settings.shortcuts.zoom_in = hk13
+ settings.shortcuts.update = hk13
break
case 14:
const hk14 = document.querySelector("#hk14_input").value
- settings.shortcuts.zoom_out = hk14
+ settings.shortcuts.info = hk14
break
// global shortcuts
@@ -411,65 +512,65 @@ const hk_reset = (value) => {
settings.shortcuts.exit = default_shortcuts.shortcuts.exit
break
case 3:
- document.querySelector("#hk3_input").value = default_shortcuts.shortcuts.edit
+ document.querySelector("#hk3_input").value = default_shortcuts.shortcuts.zoom_reset
- settings.shortcuts.edit = default_shortcuts.shortcuts.edit
+ settings.shortcuts.zoom_reset = default_shortcuts.shortcuts.zoom_reset
break
case 4:
- document.querySelector("#hk4_input").value = default_shortcuts.shortcuts.import
+ document.querySelector("#hk4_input").value = default_shortcuts.shortcuts.zoom_in
- settings.shortcuts.import = default_shortcuts.shortcuts.import
+ settings.shortcuts.zoom_in = default_shortcuts.shortcuts.zoom_in
break
case 5:
- document.querySelector("#hk5_input").value = default_shortcuts.shortcuts.export
+ document.querySelector("#hk5_input").value = default_shortcuts.shortcuts.zoom_out
- settings.shortcuts.export = default_shortcuts.shortcuts.export
+ settings.shortcuts.zoom_out = default_shortcuts.shortcuts.zoom_out
break
case 6:
- document.querySelector("#hk6_input").value = default_shortcuts.shortcuts.release
+ document.querySelector("#hk6_input").value = default_shortcuts.shortcuts.edit
- settings.shortcuts.release = default_shortcuts.shortcuts.release
+ settings.shortcuts.edit = default_shortcuts.shortcuts.edit
break
case 7:
- document.querySelector("#hk7_input").value = default_shortcuts.shortcuts.support
+ document.querySelector("#hk7_input").value = default_shortcuts.shortcuts.import
- settings.shortcuts.support = default_shortcuts.shortcuts.support
+ settings.shortcuts.import = default_shortcuts.shortcuts.import
break
case 8:
- document.querySelector("#hk8_input").value = default_shortcuts.shortcuts.docs
+ document.querySelector("#hk8_input").value = default_shortcuts.shortcuts.export
- settings.shortcuts.docs = default_shortcuts.shortcuts.docs
+ settings.shortcuts.export = default_shortcuts.shortcuts.export
break
case 9:
- document.querySelector("#hk9_input").value = default_shortcuts.shortcuts.licenses
+ document.querySelector("#hk9_input").value = default_shortcuts.shortcuts.docs
- settings.shortcuts.licenses = default_shortcuts.shortcuts.licenses
+ settings.shortcuts.docs = default_shortcuts.shortcuts.docs
break
case 10:
- document.querySelector("#hk10_input").value = default_shortcuts.shortcuts.update
+ document.querySelector("#hk10_input").value = default_shortcuts.shortcuts.release
- settings.shortcuts.update = default_shortcuts.shortcuts.update
+ settings.shortcuts.release = default_shortcuts.shortcuts.release
break
case 11:
- document.querySelector("#hk11_input").value = default_shortcuts.shortcuts.info
+ document.querySelector("#hk11_input").value = default_shortcuts.shortcuts.support
- settings.shortcuts.info = default_shortcuts.shortcuts.info
+ settings.shortcuts.support = default_shortcuts.shortcuts.support
break
case 12:
- document.querySelector("#hk12_input").value = default_shortcuts.shortcuts.zoom_reset
+ document.querySelector("#hk12_input").value = default_shortcuts.shortcuts.licenses
- settings.shortcuts.zoom_reset = default_shortcuts.shortcuts.zoom_reset
+ settings.shortcuts.licenses = default_shortcuts.shortcuts.licenses
break
case 13:
- document.querySelector("#hk13_input").value = default_shortcuts.shortcuts.zoom_in
+ document.querySelector("#hk13_input").value = default_shortcuts.shortcuts.update
- settings.shortcuts.zoom_in = default_shortcuts.shortcuts.zoom_in
+ settings.shortcuts.update = default_shortcuts.shortcuts.update
break
case 14:
- document.querySelector("#hk14_input").value = default_shortcuts.shortcuts.zoom_out
+ document.querySelector("#hk14_input").value = default_shortcuts.shortcuts.info
- settings.shortcuts.zoom_out = default_shortcuts.shortcuts.zoom_out
+ settings.shortcuts.info = default_shortcuts.shortcuts.info
break
// global shortcuts
@@ -534,7 +635,7 @@ const generateQuickShortcuts = (issuers) => {
const div = document.createElement("div")
div.innerHTML = element
- document.querySelector(".quick").appendChild(div)
+ document.querySelector(".quickShortcutsDiv").appendChild(div)
document.querySelector(`#issuers${i}`).textContent = `${issuers[i]}`
}
@@ -571,7 +672,7 @@ const checkForIssuers = () => {
/**
* Edit selected quick shortcuts
- * @param {Number} value
+ * @param {number} value
*/
const qsEdit = (value) => {
const issuers = storage.issuers
@@ -621,7 +722,7 @@ const qsEdit = (value) => {
/**
* Delete selected quick shortcut
- * @param {Number} value
+ * @param {number} value
*/
const qsDelete = (value) => {
const issuers = storage.issuers
diff --git a/languages/en.js b/languages/en.js
index c2d4dea7..5b99dd41 100644
--- a/languages/en.js
+++ b/languages/en.js
@@ -181,12 +181,12 @@ module.exports = {
"Save the latest code you searched for. Works even after restart.",
"Reset search after copy",
"Reset the search bar after you copied a code. Useful if you copy and search for a lot of codes.",
+ "Quick copy shortcuts",
+ "You can create a shortcut for your most used codes to copy quickly. Shortcuts not work on this tab, go to any other settings tab to reactivate them!",
"Shortcuts",
"You can modify the shortcuts here, read the documentation for more information. Shortcuts not work on this tab, go to any other settings tab to reactivate them!",
"Global shortcuts",
"You can modify the global shortcuts here, read the documentation for more information. Shortcuts not work on this tab, go to any other settings tab to reactivate them!",
- "Quick copy shortcuts",
- "You can create a shortcut for your most used codes to copy quickly. Shortcuts not work on this tab, go to any other settings tab to reactivate them!",
],
"settings_dialog": {