aboutsummaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-08-09 21:07:11 -0400
committerGitHub <noreply@github.com>2020-08-09 21:07:11 -0400
commit2a86d6609210a586ec32c48a99904c9b64744d04 (patch)
treee87b3a7abb84c1d1dbb51d27de100288d00df155 /ext/bg
parent9f8f83508e6d8e469b8cd89c1fb3ec85601401d8 (diff)
DOM + DocumentUtil merge (#727)
* Add DOM functions to DocumentUtil * Use DocumentUtil instead of DOM * Remove DOM * Move document-util.js into mixed
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/search.js4
-rw-r--r--ext/bg/js/settings/conditions-ui.js6
-rw-r--r--ext/bg/search.html3
-rw-r--r--ext/bg/settings-popup-preview.html3
-rw-r--r--ext/bg/settings.html2
5 files changed, 8 insertions, 10 deletions
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 @@
<script src="/mixed/js/core.js"></script>
<script src="/mixed/js/yomichan.js"></script>
<script src="/mixed/js/comm.js"></script>
- <script src="/mixed/js/dom.js"></script>
<script src="/mixed/js/api.js"></script>
<script src="/mixed/js/japanese.js"></script>
<script src="/bg/js/handlebars.js"></script>
- <script src="/fg/js/document-util.js"></script>
+ <script src="/mixed/js/document-util.js"></script>
<script src="/fg/js/dom-text-scanner.js"></script>
<script src="/fg/js/source.js"></script>
<script src="/mixed/js/audio-system.js"></script>
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 @@
<script src="/mixed/js/core.js"></script>
<script src="/mixed/js/yomichan.js"></script>
<script src="/mixed/js/comm.js"></script>
- <script src="/mixed/js/dom.js"></script>
<script src="/mixed/js/api.js"></script>
<script src="/mixed/js/dynamic-loader.js"></script>
<script src="/mixed/js/frame-client.js"></script>
<script src="/mixed/js/text-scanner.js"></script>
- <script src="/fg/js/document-util.js"></script>
+ <script src="/mixed/js/document-util.js"></script>
<script src="/fg/js/dom-text-scanner.js"></script>
<script src="/fg/js/popup.js"></script>
<script src="/fg/js/source.js"></script>
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 @@
<script src="/mixed/js/core.js"></script>
<script src="/mixed/js/yomichan.js"></script>
<script src="/mixed/js/comm.js"></script>
- <script src="/mixed/js/dom.js"></script>
<script src="/mixed/js/environment.js"></script>
<script src="/mixed/js/api.js"></script>
<script src="/mixed/js/japanese.js"></script>
@@ -1148,6 +1147,7 @@
<script src="/bg/js/profile-conditions.js"></script>
<script src="/bg/js/util.js"></script>
<script src="/mixed/js/audio-system.js"></script>
+ <script src="/mixed/js/document-util.js"></script>
<script src="/bg/js/settings/anki.js"></script>
<script src="/bg/js/settings/anki-templates.js"></script>