diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-09-09 16:59:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-09 16:59:03 -0400 |
commit | 0d00f7e1cf8a0fa1e2b1aa2732bceaae39f4e23c (patch) | |
tree | 92b0a2e72ef2cecb31e8cc70da354ee43b87e2b4 /ext/bg/js/settings/main.js | |
parent | acb7ad32f39c40b879400c9daa4bc8cd25585ba7 (diff) |
Scanning input generalization (#789)
* Add inputs to options.scanning
* Update CSS for mouse buttons
* Update list counters
* Set up HTML/CSS
* Add input controller
* Use new inputs
* Include mouse buttons
* Update how button inputs are detected
* Add index/empty fields to the input details object
* Update none check for scanning modifier
* Remove old settings
* Remove unused global
Diffstat (limited to 'ext/bg/js/settings/main.js')
-rw-r--r-- | ext/bg/js/settings/main.js | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js index 7fa8e502..4932586b 100644 --- a/ext/bg/js/settings/main.js +++ b/ext/bg/js/settings/main.js @@ -22,10 +22,10 @@ * ClipboardPopupsController * DictionaryController * DictionaryImportController - * DocumentUtil * GenericSettingController * PopupPreviewController * ProfileController + * ScanInputsController * SettingsBackup * SettingsController * StorageController @@ -40,23 +40,6 @@ function showExtensionInformation() { node.textContent = `${manifest.name} v${manifest.version}`; } -async function settingsPopulateModifierKeys() { - const scanModifierKeySelect = document.querySelector('#scan-modifier-key'); - scanModifierKeySelect.textContent = ''; - - const {platform: {os}} = await api.getEnvironmentInfo(); - const modifierKeys = [ - ['none', 'None'], - ...DocumentUtil.getModifierKeys(os) - ]; - for (const [value, name] of modifierKeys) { - const option = document.createElement('option'); - option.value = value; - option.textContent = name; - scanModifierKeySelect.appendChild(option); - } -} - async function setupEnvironmentInfo() { const {browser, platform} = await api.getEnvironmentInfo(); document.documentElement.dataset.browser = browser; @@ -71,7 +54,6 @@ async function setupEnvironmentInfo() { setupEnvironmentInfo(); showExtensionInformation(); - settingsPopulateModifierKeys(); const optionsFull = await api.optionsGetFull(); @@ -111,6 +93,9 @@ async function setupEnvironmentInfo() { const settingsBackup = new SettingsBackup(settingsController); settingsBackup.prepare(); + const scanInputsController = new ScanInputsController(settingsController); + scanInputsController.prepare(); + yomichan.ready(); } catch (e) { yomichan.logError(e); |