From 2a86d6609210a586ec32c48a99904c9b64744d04 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 9 Aug 2020 21:07:11 -0400 Subject: DOM + DocumentUtil merge (#727) * Add DOM functions to DocumentUtil * Use DocumentUtil instead of DOM * Remove DOM * Move document-util.js into mixed --- ext/bg/js/search.js | 4 ++-- ext/bg/js/settings/conditions-ui.js | 6 +++--- ext/bg/search.html | 3 +-- ext/bg/settings-popup-preview.html | 3 +-- ext/bg/settings.html | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) (limited to 'ext/bg') diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index 7cad2671..0a0699a9 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -17,8 +17,8 @@ /* global * ClipboardMonitor - * DOM * Display + * DocumentUtil * api * wanakana */ @@ -104,7 +104,7 @@ class DisplaySearch extends Display { } onKeyDown(e) { - const key = DOM.getKeyFromEvent(e); + const key = DocumentUtil.getKeyFromEvent(e); const ignoreKeys = this._onKeyDownIgnoreKeys; const activeModifierMap = new Map([ diff --git a/ext/bg/js/settings/conditions-ui.js b/ext/bg/js/settings/conditions-ui.js index 031689a7..98b3d432 100644 --- a/ext/bg/js/settings/conditions-ui.js +++ b/ext/bg/js/settings/conditions-ui.js @@ -16,7 +16,7 @@ */ /* global - * DOM + * DocumentUtil * conditionsNormalizeOptionValue */ @@ -323,7 +323,7 @@ ConditionsUI.Condition = class Condition { const pressedKeyIndices = new Set(); const onKeyDown = ({originalEvent}) => { - const pressedKeyEventName = DOM.getKeyFromEvent(originalEvent); + const pressedKeyEventName = DocumentUtil.getKeyFromEvent(originalEvent); if (pressedKeyEventName === 'Escape' || pressedKeyEventName === 'Backspace') { pressedKeyIndices.clear(); inputInner.val(''); @@ -331,7 +331,7 @@ ConditionsUI.Condition = class Condition { return; } - const pressedModifiers = DOM.getActiveModifiers(originalEvent); + const pressedModifiers = DocumentUtil.getActiveModifiers(originalEvent); // https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/metaKey // https://askubuntu.com/questions/567731/why-is-shift-alt-being-mapped-to-meta // It works with mouse events on some platforms, so try to determine if metaKey is pressed diff --git a/ext/bg/search.html b/ext/bg/search.html index 9556a1a1..6f7e04c9 100644 --- a/ext/bg/search.html +++ b/ext/bg/search.html @@ -73,12 +73,11 @@ - - + diff --git a/ext/bg/settings-popup-preview.html b/ext/bg/settings-popup-preview.html index 3479efa4..59924a27 100644 --- a/ext/bg/settings-popup-preview.html +++ b/ext/bg/settings-popup-preview.html @@ -121,13 +121,12 @@ - - + diff --git a/ext/bg/settings.html b/ext/bg/settings.html index 8326a65c..f6025f55 100644 --- a/ext/bg/settings.html +++ b/ext/bg/settings.html @@ -1135,7 +1135,6 @@ - @@ -1148,6 +1147,7 @@ + -- cgit v1.2.3