summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-14 11:19:54 -0500
committerGitHub <noreply@github.com>2021-02-14 11:19:54 -0500
commite419a418f6f03ef0a24330b67e7b76c5e3a7c22d (patch)
treea4c27bdfabc9280d9f6262d93d5152a58de8bc15
parent43d1457ebfe23196348649c245dfb942a0f00a1a (diff)
Move bg/js (#1387)
* Move bg/js/anki.js to js/comm/anki.js * Move bg/js/mecab.js to js/comm/mecab.js * Move bg/js/search-main.js to js/display/search-main.js * Move bg/js/template-patcher.js to js/templates/template-patcher.js * Move bg/js/template-renderer-frame-api.js to js/templates/template-renderer-frame-api.js * Move bg/js/template-renderer-frame-main.js to js/templates/template-renderer-frame-main.js * Move bg/js/template-renderer-proxy.js to js/templates/template-renderer-proxy.js * Move bg/js/template-renderer.js to js/templates/template-renderer.js * Move bg/js/media-utility.js to js/media/media-utility.js * Move bg/js/native-simple-dom-parser.js to js/dom/native-simple-dom-parser.js * Move bg/js/simple-dom-parser.js to js/dom/simple-dom-parser.js * Move bg/js/audio-downloader.js to js/media/audio-downloader.js * Move bg/js/deinflector.js to js/language/deinflector.js * Move bg/js/backend.js to js/background/backend.js * Move bg/js/translator.js to js/language/translator.js * Move bg/js/search-display-controller.js to js/display/search-display-controller.js * Move bg/js/request-builder.js to js/background/request-builder.js * Move bg/js/text-source-map.js to js/general/text-source-map.js * Move bg/js/clipboard-reader.js to js/comm/clipboard-reader.js * Move bg/js/clipboard-monitor.js to js/comm/clipboard-monitor.js * Move bg/js/query-parser.js to js/display/query-parser.js * Move bg/js/profile-conditions.js to js/background/profile-conditions.js * Move bg/js/dictionary-database.js to js/language/dictionary-database.js * Move bg/js/dictionary-importer.js to js/language/dictionary-importer.js * Move bg/js/anki-note-builder.js to js/data/anki-note-builder.js * Move bg/js/anki-note-data.js to js/data/anki-note-data.js * Move bg/js/database.js to js/data/database.js * Move bg/js/json-schema.js to js/data/json-schema.js * Move bg/js/options.js to js/data/options-util.js * Move bg/js/background-main.js to js/background/background-main.js * Move bg/js/permissions-util.js to js/data/permissions-util.js * Move bg/js/context-main.js to js/pages/action-popup-main.js * Move bg/js/generic-page-main.js to js/pages/generic-page-main.js * Move bg/js/info-main.js to js/pages/info-main.js * Move bg/js/permissions-main.js to js/pages/permissions-main.js * Move bg/js/welcome-main.js to js/pages/welcome-main.js
-rw-r--r--.eslintrc.json46
-rw-r--r--dev/data/manifest-variants.json10
-rw-r--r--dev/dictionary-validate.js2
-rw-r--r--dev/schema-validate.js2
-rw-r--r--docs/templates.md2
-rw-r--r--ext/action-popup.html4
-rw-r--r--ext/background.html40
-rw-r--r--ext/info.html4
-rw-r--r--ext/js/background/backend.js (renamed from ext/bg/js/backend.js)0
-rw-r--r--ext/js/background/background-main.js (renamed from ext/bg/js/background-main.js)0
-rw-r--r--ext/js/background/profile-conditions.js (renamed from ext/bg/js/profile-conditions.js)0
-rw-r--r--ext/js/background/request-builder.js (renamed from ext/bg/js/request-builder.js)0
-rw-r--r--ext/js/comm/anki.js (renamed from ext/bg/js/anki.js)0
-rw-r--r--ext/js/comm/clipboard-monitor.js (renamed from ext/bg/js/clipboard-monitor.js)0
-rw-r--r--ext/js/comm/clipboard-reader.js (renamed from ext/bg/js/clipboard-reader.js)0
-rw-r--r--ext/js/comm/mecab.js (renamed from ext/bg/js/mecab.js)0
-rw-r--r--ext/js/data/anki-note-builder.js (renamed from ext/bg/js/anki-note-builder.js)0
-rw-r--r--ext/js/data/anki-note-data.js (renamed from ext/bg/js/anki-note-data.js)0
-rw-r--r--ext/js/data/database.js (renamed from ext/bg/js/database.js)0
-rw-r--r--ext/js/data/json-schema.js (renamed from ext/bg/js/json-schema.js)0
-rw-r--r--ext/js/data/options-util.js (renamed from ext/bg/js/options.js)0
-rw-r--r--ext/js/data/permissions-util.js (renamed from ext/bg/js/permissions-util.js)0
-rw-r--r--ext/js/display/query-parser.js (renamed from ext/bg/js/query-parser.js)0
-rw-r--r--ext/js/display/search-display-controller.js (renamed from ext/bg/js/search-display-controller.js)0
-rw-r--r--ext/js/display/search-main.js (renamed from ext/bg/js/search-main.js)0
-rw-r--r--ext/js/dom/native-simple-dom-parser.js (renamed from ext/bg/js/native-simple-dom-parser.js)0
-rw-r--r--ext/js/dom/simple-dom-parser.js (renamed from ext/bg/js/simple-dom-parser.js)0
-rw-r--r--ext/js/general/text-source-map.js (renamed from ext/bg/js/text-source-map.js)0
-rw-r--r--ext/js/language/deinflector.js (renamed from ext/bg/js/deinflector.js)0
-rw-r--r--ext/js/language/dictionary-database.js (renamed from ext/bg/js/dictionary-database.js)0
-rw-r--r--ext/js/language/dictionary-importer.js (renamed from ext/bg/js/dictionary-importer.js)0
-rw-r--r--ext/js/language/translator.js (renamed from ext/bg/js/translator.js)0
-rw-r--r--ext/js/media/audio-downloader.js (renamed from ext/bg/js/audio-downloader.js)0
-rw-r--r--ext/js/media/media-utility.js (renamed from ext/bg/js/media-utility.js)0
-rw-r--r--ext/js/pages/action-popup-main.js (renamed from ext/bg/js/context-main.js)0
-rw-r--r--ext/js/pages/generic-page-main.js (renamed from ext/bg/js/generic-page-main.js)0
-rw-r--r--ext/js/pages/info-main.js (renamed from ext/bg/js/info-main.js)0
-rw-r--r--ext/js/pages/permissions-main.js (renamed from ext/bg/js/permissions-main.js)0
-rw-r--r--ext/js/pages/welcome-main.js (renamed from ext/bg/js/welcome-main.js)0
-rw-r--r--ext/js/templates/template-patcher.js (renamed from ext/bg/js/template-patcher.js)0
-rw-r--r--ext/js/templates/template-renderer-frame-api.js (renamed from ext/bg/js/template-renderer-frame-api.js)0
-rw-r--r--ext/js/templates/template-renderer-frame-main.js (renamed from ext/bg/js/template-renderer-frame-main.js)0
-rw-r--r--ext/js/templates/template-renderer-proxy.js (renamed from ext/bg/js/template-renderer-proxy.js)0
-rw-r--r--ext/js/templates/template-renderer.js (renamed from ext/bg/js/template-renderer.js)0
-rw-r--r--ext/legal.html2
-rw-r--r--ext/permissions.html4
-rw-r--r--ext/popup.html6
-rw-r--r--ext/search.html12
-rw-r--r--ext/settings-old.html22
-rw-r--r--ext/settings.html22
-rw-r--r--ext/sw.js40
-rw-r--r--ext/template-renderer.html8
-rw-r--r--ext/welcome.html14
-rw-r--r--test/test-database.js10
-rw-r--r--test/test-deinflector.js2
-rw-r--r--test/test-japanese.js2
-rw-r--r--test/test-options-util.js6
-rw-r--r--test/test-profile-conditions.js4
-rw-r--r--test/test-schema.js2
-rw-r--r--test/test-sw.js4
-rw-r--r--test/test-text-source-map.js2
-rw-r--r--test/test-translator.js16
62 files changed, 144 insertions, 144 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
index b345234c..fce741ae 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -85,7 +85,7 @@
{
"files": [
"ext/js/core.js",
- "ext/bg/js/template-renderer.js",
+ "ext/js/templates/template-renderer.js",
"ext/js/language/dictionary-data-util.js"
],
"env": {
@@ -96,8 +96,8 @@
"files": ["ext/**/*.js"],
"excludedFiles": [
"ext/js/core.js",
- "ext/bg/js/template-renderer.js",
- "ext/bg/js/anki-note-data.js",
+ "ext/js/templates/template-renderer.js",
+ "ext/js/data/anki-note-data.js",
"ext/js/language/dictionary-data-util.js"
],
"globals": {
@@ -165,26 +165,26 @@
"ext/js/general/cache-map.js",
"ext/js/language/dictionary-data-util.js",
"ext/js/general/object-property-accessor.js",
- "ext/bg/js/anki.js",
- "ext/bg/js/audio-downloader.js",
- "ext/bg/js/clipboard-monitor.js",
- "ext/bg/js/clipboard-reader.js",
- "ext/bg/js/database.js",
- "ext/bg/js/deinflector.js",
- "ext/bg/js/dictionary-database.js",
- "ext/bg/js/json-schema.js",
- "ext/bg/js/mecab.js",
- "ext/bg/js/media-utility.js",
- "ext/bg/js/options.js",
- "ext/bg/js/permissions-util.js",
- "ext/bg/js/profile-conditions.js",
- "ext/bg/js/request-builder.js",
- "ext/bg/js/simple-dom-parser.js",
- "ext/bg/js/template-patcher.js",
- "ext/bg/js/text-source-map.js",
- "ext/bg/js/translator.js",
- "ext/bg/js/backend.js",
- "ext/bg/js/background-main.js"
+ "ext/js/comm/anki.js",
+ "ext/js/media/audio-downloader.js",
+ "ext/js/comm/clipboard-monitor.js",
+ "ext/js/comm/clipboard-reader.js",
+ "ext/js/data/database.js",
+ "ext/js/language/deinflector.js",
+ "ext/js/language/dictionary-database.js",
+ "ext/js/data/json-schema.js",
+ "ext/js/comm/mecab.js",
+ "ext/js/media/media-utility.js",
+ "ext/js/data/options-util.js",
+ "ext/js/data/permissions-util.js",
+ "ext/js/background/profile-conditions.js",
+ "ext/js/background/request-builder.js",
+ "ext/js/dom/simple-dom-parser.js",
+ "ext/js/templates/template-patcher.js",
+ "ext/js/general/text-source-map.js",
+ "ext/js/language/translator.js",
+ "ext/js/background/backend.js",
+ "ext/js/background/background-main.js"
],
"env": {
"browser": false,
diff --git a/dev/data/manifest-variants.json b/dev/data/manifest-variants.json
index 72e07086..178f1395 100644
--- a/dev/data/manifest-variants.json
+++ b/dev/data/manifest-variants.json
@@ -122,7 +122,7 @@
"fileName": "yomichan-chrome.zip",
"excludeFiles": [
"sw.js",
- "bg/js/simple-dom-parser.js",
+ "js/dom/simple-dom-parser.js",
"lib/parse5.js"
]
},
@@ -147,7 +147,7 @@
],
"excludeFiles": [
"sw.js",
- "bg/js/simple-dom-parser.js",
+ "js/dom/simple-dom-parser.js",
"lib/parse5.js"
]
},
@@ -175,7 +175,7 @@
],
"excludeFiles": [
"background.html",
- "bg/js/native-simple-dom-parser.js"
+ "js/dom/native-simple-dom-parser.js"
]
},
{
@@ -219,7 +219,7 @@
],
"excludeFiles": [
"sw.js",
- "bg/js/simple-dom-parser.js",
+ "js/dom/simple-dom-parser.js",
"lib/parse5.js"
]
},
@@ -255,7 +255,7 @@
],
"excludeFiles": [
"sw.js",
- "bg/js/simple-dom-parser.js",
+ "js/dom/simple-dom-parser.js",
"lib/parse5.js"
]
}
diff --git a/dev/dictionary-validate.js b/dev/dictionary-validate.js
index 17d6e3de..fbb22cfc 100644
--- a/dev/dictionary-validate.js
+++ b/dev/dictionary-validate.js
@@ -24,7 +24,7 @@ const vm = new VM();
vm.execute([
'js/core.js',
'js/general/cache-map.js',
- 'bg/js/json-schema.js'
+ 'js/data/json-schema.js'
]);
const JsonSchemaValidator = vm.get('JsonSchemaValidator');
diff --git a/dev/schema-validate.js b/dev/schema-validate.js
index 0ede032b..1cb69618 100644
--- a/dev/schema-validate.js
+++ b/dev/schema-validate.js
@@ -22,7 +22,7 @@ const vm = new VM();
vm.execute([
'js/core.js',
'js/general/cache-map.js',
- 'bg/js/json-schema.js'
+ 'js/data/json-schema.js'
]);
const JsonSchemaValidator = vm.get('JsonSchemaValidator');
diff --git a/docs/templates.md b/docs/templates.md
index 7425bc4a..8e88a7dc 100644
--- a/docs/templates.md
+++ b/docs/templates.md
@@ -3,7 +3,7 @@
## Helpers
Yomichan supports several custom Handlebars helpers for rendering templates.
-The source code for these templates can be found [here](../ext/bg/js/template-renderer.js).
+The source code for these templates can be found [here](../ext/js/templates/template-renderer.js).
### `dumpObject`
diff --git a/ext/action-popup.html b/ext/action-popup.html
index e6dbdc44..79a3df88 100644
--- a/ext/action-popup.html
+++ b/ext/action-popup.html
@@ -89,9 +89,9 @@
<script src="/js/input/hotkey-help-controller.js"></script>
<script src="/js/input/hotkey-util.js"></script>
-<script src="/bg/js/permissions-util.js"></script>
+<script src="/js/data/permissions-util.js"></script>
-<script src="/bg/js/context-main.js"></script>
+<script src="/js/pages/action-popup-main.js"></script>
</body>
</html>
diff --git a/ext/background.html b/ext/background.html
index 92c3b0aa..740bee57 100644
--- a/ext/background.html
+++ b/ext/background.html
@@ -26,28 +26,28 @@
<script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/general/object-property-accessor.js"></script>
- <script src="/bg/js/anki.js"></script>
- <script src="/bg/js/audio-downloader.js"></script>
- <script src="/bg/js/clipboard-monitor.js"></script>
- <script src="/bg/js/clipboard-reader.js"></script>
- <script src="/bg/js/database.js"></script>
- <script src="/bg/js/deinflector.js"></script>
- <script src="/bg/js/dictionary-database.js"></script>
- <script src="/bg/js/json-schema.js"></script>
- <script src="/bg/js/mecab.js"></script>
- <script src="/bg/js/media-utility.js"></script>
- <script src="/bg/js/options.js"></script>
- <script src="/bg/js/permissions-util.js"></script>
- <script src="/bg/js/profile-conditions.js"></script>
- <script src="/bg/js/request-builder.js"></script>
- <script src="/bg/js/native-simple-dom-parser.js"></script>
- <script src="/bg/js/template-patcher.js"></script>
- <script src="/bg/js/text-source-map.js"></script>
- <script src="/bg/js/translator.js"></script>
+ <script src="/js/comm/anki.js"></script>
+ <script src="/js/media/audio-downloader.js"></script>
+ <script src="/js/comm/clipboard-monitor.js"></script>
+ <script src="/js/comm/clipboard-reader.js"></script>
+ <script src="/js/data/database.js"></script>
+ <script src="/js/language/deinflector.js"></script>
+ <script src="/js/language/dictionary-database.js"></script>
+ <script src="/js/data/json-schema.js"></script>
+ <script src="/js/comm/mecab.js"></script>
+ <script src="/js/media/media-utility.js"></script>
+ <script src="/js/data/options-util.js"></script>
+ <script src="/js/data/permissions-util.js"></script>
+ <script src="/js/background/profile-conditions.js"></script>
+ <script src="/js/background/request-builder.js"></script>
+ <script src="/js/dom/native-simple-dom-parser.js"></script>
+ <script src="/js/templates/template-patcher.js"></script>
+ <script src="/js/general/text-source-map.js"></script>
+ <script src="/js/language/translator.js"></script>
- <script src="/bg/js/backend.js"></script>
+ <script src="/js/background/backend.js"></script>
- <script src="/bg/js/background-main.js"></script>
+ <script src="/js/background/background-main.js"></script>
<!--
Due to a Firefox bug, this next element is purposefully terminated incorrectly.
diff --git a/ext/info.html b/ext/info.html
index d9a20e5e..aa00b103 100644
--- a/ext/info.html
+++ b/ext/info.html
@@ -65,11 +65,11 @@
<script src="/js/dom/document-focus-controller.js"></script>
<script src="/js/dom/html-template-collection.js"></script>
-<script src="/bg/js/permissions-util.js"></script>
+<script src="/js/data/permissions-util.js"></script>
<script src="/js/settings/settings-controller.js"></script>
<script src="/js/settings/backup-controller.js"></script>
-<script src="/bg/js/info-main.js"></script>
+<script src="/js/pages/info-main.js"></script>
</body>
</html>
diff --git a/ext/bg/js/backend.js b/ext/js/background/backend.js
index 3bb23310..3bb23310 100644
--- a/ext/bg/js/backend.js
+++ b/ext/js/background/backend.js
diff --git a/ext/bg/js/background-main.js b/ext/js/background/background-main.js
index 01e57d0f..01e57d0f 100644
--- a/ext/bg/js/background-main.js
+++ b/ext/js/background/background-main.js
diff --git a/ext/bg/js/profile-conditions.js b/ext/js/background/profile-conditions.js
index 8e6c7163..8e6c7163 100644
--- a/ext/bg/js/profile-conditions.js
+++ b/ext/js/background/profile-conditions.js
diff --git a/ext/bg/js/request-builder.js b/ext/js/background/request-builder.js
index dda5825d..dda5825d 100644
--- a/ext/bg/js/request-builder.js
+++ b/ext/js/background/request-builder.js
diff --git a/ext/bg/js/anki.js b/ext/js/comm/anki.js
index 251e0e0c..251e0e0c 100644
--- a/ext/bg/js/anki.js
+++ b/ext/js/comm/anki.js
diff --git a/ext/bg/js/clipboard-monitor.js b/ext/js/comm/clipboard-monitor.js
index 7379d7ad..7379d7ad 100644
--- a/ext/bg/js/clipboard-monitor.js
+++ b/ext/js/comm/clipboard-monitor.js
diff --git a/ext/bg/js/clipboard-reader.js b/ext/js/comm/clipboard-reader.js
index 275c2d60..275c2d60 100644
--- a/ext/bg/js/clipboard-reader.js
+++ b/ext/js/comm/clipboard-reader.js
diff --git a/ext/bg/js/mecab.js b/ext/js/comm/mecab.js
index 4eff2927..4eff2927 100644
--- a/ext/bg/js/mecab.js
+++ b/ext/js/comm/mecab.js
diff --git a/ext/bg/js/anki-note-builder.js b/ext/js/data/anki-note-builder.js
index e1399f66..e1399f66 100644
--- a/ext/bg/js/anki-note-builder.js
+++ b/ext/js/data/anki-note-builder.js
diff --git a/ext/bg/js/anki-note-data.js b/ext/js/data/anki-note-data.js
index a7d0f9f6..a7d0f9f6 100644
--- a/ext/bg/js/anki-note-data.js
+++ b/ext/js/data/anki-note-data.js
diff --git a/ext/bg/js/database.js b/ext/js/data/database.js
index 068f4a5f..068f4a5f 100644
--- a/ext/bg/js/database.js
+++ b/ext/js/data/database.js
diff --git a/ext/bg/js/json-schema.js b/ext/js/data/json-schema.js
index 7b6b9c53..7b6b9c53 100644
--- a/ext/bg/js/json-schema.js
+++ b/ext/js/data/json-schema.js
diff --git a/ext/bg/js/options.js b/ext/js/data/options-util.js
index 1105dfed..1105dfed 100644
--- a/ext/bg/js/options.js
+++ b/ext/js/data/options-util.js
diff --git a/ext/bg/js/permissions-util.js b/ext/js/data/permissions-util.js
index bd3a18ce..bd3a18ce 100644
--- a/ext/bg/js/permissions-util.js
+++ b/ext/js/data/permissions-util.js
diff --git a/ext/bg/js/query-parser.js b/ext/js/display/query-parser.js
index 05ebfa27..05ebfa27 100644
--- a/ext/bg/js/query-parser.js
+++ b/ext/js/display/query-parser.js
diff --git a/ext/bg/js/search-display-controller.js b/ext/js/display/search-display-controller.js
index a295346d..a295346d 100644
--- a/ext/bg/js/search-display-controller.js
+++ b/ext/js/display/search-display-controller.js
diff --git a/ext/bg/js/search-main.js b/ext/js/display/search-main.js
index c7ec595a..c7ec595a 100644
--- a/ext/bg/js/search-main.js
+++ b/ext/js/display/search-main.js
diff --git a/ext/bg/js/native-simple-dom-parser.js b/ext/js/dom/native-simple-dom-parser.js
index 27dadec0..27dadec0 100644
--- a/ext/bg/js/native-simple-dom-parser.js
+++ b/ext/js/dom/native-simple-dom-parser.js
diff --git a/ext/bg/js/simple-dom-parser.js b/ext/js/dom/simple-dom-parser.js
index 7c57ca98..7c57ca98 100644
--- a/ext/bg/js/simple-dom-parser.js
+++ b/ext/js/dom/simple-dom-parser.js
diff --git a/ext/bg/js/text-source-map.js b/ext/js/general/text-source-map.js
index 49b6d99f..49b6d99f 100644
--- a/ext/bg/js/text-source-map.js
+++ b/ext/js/general/text-source-map.js
diff --git a/ext/bg/js/deinflector.js b/ext/js/language/deinflector.js
index 8fee3f01..8fee3f01 100644
--- a/ext/bg/js/deinflector.js
+++ b/ext/js/language/deinflector.js
diff --git a/ext/bg/js/dictionary-database.js b/ext/js/language/dictionary-database.js
index b363ed25..b363ed25 100644
--- a/ext/bg/js/dictionary-database.js
+++ b/ext/js/language/dictionary-database.js
diff --git a/ext/bg/js/dictionary-importer.js b/ext/js/language/dictionary-importer.js
index 4cb608db..4cb608db 100644
--- a/ext/bg/js/dictionary-importer.js
+++ b/ext/js/language/dictionary-importer.js
diff --git a/ext/bg/js/translator.js b/ext/js/language/translator.js
index 729c8294..729c8294 100644
--- a/ext/bg/js/translator.js
+++ b/ext/js/language/translator.js
diff --git a/ext/bg/js/audio-downloader.js b/ext/js/media/audio-downloader.js
index 4e77419b..4e77419b 100644
--- a/ext/bg/js/audio-downloader.js
+++ b/ext/js/media/audio-downloader.js
diff --git a/ext/bg/js/media-utility.js b/ext/js/media/media-utility.js
index b4fbe04d..b4fbe04d 100644
--- a/ext/bg/js/media-utility.js
+++ b/ext/js/media/media-utility.js
diff --git a/ext/bg/js/context-main.js b/ext/js/pages/action-popup-main.js
index 5cc56745..5cc56745 100644
--- a/ext/bg/js/context-main.js
+++ b/ext/js/pages/action-popup-main.js
diff --git a/ext/bg/js/generic-page-main.js b/ext/js/pages/generic-page-main.js
index db1a770a..db1a770a 100644
--- a/ext/bg/js/generic-page-main.js
+++ b/ext/js/pages/generic-page-main.js
diff --git a/ext/bg/js/info-main.js b/ext/js/pages/info-main.js
index 6cf82595..6cf82595 100644
--- a/ext/bg/js/info-main.js
+++ b/ext/js/pages/info-main.js
diff --git a/ext/bg/js/permissions-main.js b/ext/js/pages/permissions-main.js
index 5b17a5dd..5b17a5dd 100644
--- a/ext/bg/js/permissions-main.js
+++ b/ext/js/pages/permissions-main.js
diff --git a/ext/bg/js/welcome-main.js b/ext/js/pages/welcome-main.js
index 57b265dc..57b265dc 100644
--- a/ext/bg/js/welcome-main.js
+++ b/ext/js/pages/welcome-main.js
diff --git a/ext/bg/js/template-patcher.js b/ext/js/templates/template-patcher.js
index 57178957..57178957 100644
--- a/ext/bg/js/template-patcher.js
+++ b/ext/js/templates/template-patcher.js
diff --git a/ext/bg/js/template-renderer-frame-api.js b/ext/js/templates/template-renderer-frame-api.js
index 4936a2af..4936a2af 100644
--- a/ext/bg/js/template-renderer-frame-api.js
+++ b/ext/js/templates/template-renderer-frame-api.js
diff --git a/ext/bg/js/template-renderer-frame-main.js b/ext/js/templates/template-renderer-frame-main.js
index d25eb56d..d25eb56d 100644
--- a/ext/bg/js/template-renderer-frame-main.js
+++ b/ext/js/templates/template-renderer-frame-main.js
diff --git a/ext/bg/js/template-renderer-proxy.js b/ext/js/templates/template-renderer-proxy.js
index 6a49832b..6a49832b 100644
--- a/ext/bg/js/template-renderer-proxy.js
+++ b/ext/js/templates/template-renderer-proxy.js
diff --git a/ext/bg/js/template-renderer.js b/ext/js/templates/template-renderer.js
index ae39e478..ae39e478 100644
--- a/ext/bg/js/template-renderer.js
+++ b/ext/js/templates/template-renderer.js
diff --git a/ext/legal.html b/ext/legal.html
index 644ad831..0f2cfd67 100644
--- a/ext/legal.html
+++ b/ext/legal.html
@@ -221,7 +221,7 @@ THE SOFTWARE.
<!-- Scripts -->
<script src="/js/dom/document-focus-controller.js"></script>
-<script src="/bg/js/generic-page-main.js"></script>
+<script src="/js/pages/generic-page-main.js"></script>
</body>
</html>
diff --git a/ext/permissions.html b/ext/permissions.html
index 67dc5f85..23d3412a 100644
--- a/ext/permissions.html
+++ b/ext/permissions.html
@@ -168,11 +168,11 @@
<script src="/js/dom/document-focus-controller.js"></script>
<script src="/js/dom/html-template-collection.js"></script>
-<script src="/bg/js/permissions-util.js"></script>
+<script src="/js/data/permissions-util.js"></script>
<script src="/js/settings/permissions-toggle-controller.js"></script>
<script src="/js/settings/settings-controller.js"></script>
-<script src="/bg/js/permissions-main.js"></script>
+<script src="/js/pages/permissions-main.js"></script>
</body>
</html>
diff --git a/ext/popup.html b/ext/popup.html
index e31237dd..9f3220bc 100644
--- a/ext/popup.html
+++ b/ext/popup.html
@@ -121,10 +121,10 @@
<script src="/js/dom/html-template-collection.js"></script>
<script src="/js/media/text-to-speech-audio.js"></script>
-<script src="/bg/js/anki-note-builder.js"></script>
-<script src="/bg/js/template-renderer-proxy.js"></script>
+<script src="/js/data/anki-note-builder.js"></script>
+<script src="/js/templates/template-renderer-proxy.js"></script>
-<script src="/bg/js/query-parser.js"></script>
+<script src="/js/display/query-parser.js"></script>
<script src="/js/display/popup-main.js"></script>
diff --git a/ext/search.html b/ext/search.html
index 1efef61e..65e04949 100644
--- a/ext/search.html
+++ b/ext/search.html
@@ -104,14 +104,14 @@
<script src="/js/dom/html-template-collection.js"></script>
<script src="/js/media/text-to-speech-audio.js"></script>
-<script src="/bg/js/anki-note-builder.js"></script>
-<script src="/bg/js/template-renderer-proxy.js"></script>
+<script src="/js/data/anki-note-builder.js"></script>
+<script src="/js/templates/template-renderer-proxy.js"></script>
-<script src="/bg/js/query-parser.js"></script>
-<script src="/bg/js/clipboard-monitor.js"></script>
-<script src="/bg/js/search-display-controller.js"></script>
+<script src="/js/display/query-parser.js"></script>
+<script src="/js/comm/clipboard-monitor.js"></script>
+<script src="/js/display/search-display-controller.js"></script>
-<script src="/bg/js/search-main.js"></script>
+<script src="/js/display/search-main.js"></script>
</body>
</html>
diff --git a/ext/settings-old.html b/ext/settings-old.html
index d95c4ee4..8b541ab3 100644
--- a/ext/settings-old.html
+++ b/ext/settings-old.html
@@ -1297,17 +1297,17 @@
<script src="/js/general/task-accumulator.js"></script>
<script src="/js/media/text-to-speech-audio.js"></script>
- <script src="/bg/js/anki.js"></script>
- <script src="/bg/js/anki-note-builder.js"></script>
- <script src="/bg/js/options.js"></script>
- <script src="/bg/js/database.js"></script>
- <script src="/bg/js/dictionary-database.js"></script>
- <script src="/bg/js/dictionary-importer.js"></script>
- <script src="/bg/js/json-schema.js"></script>
- <script src="/bg/js/media-utility.js"></script>
- <script src="/bg/js/permissions-util.js"></script>
- <script src="/bg/js/template-patcher.js"></script>
- <script src="/bg/js/template-renderer-proxy.js"></script>
+ <script src="/js/comm/anki.js"></script>
+ <script src="/js/data/anki-note-builder.js"></script>
+ <script src="/js/data/options-util.js"></script>
+ <script src="/js/data/database.js"></script>
+ <script src="/js/language/dictionary-database.js"></script>
+ <script src="/js/language/dictionary-importer.js"></script>
+ <script src="/js/data/json-schema.js"></script>
+ <script src="/js/media/media-utility.js"></script>
+ <script src="/js/data/permissions-util.js"></script>
+ <script src="/js/templates/template-patcher.js"></script>
+ <script src="/js/templates/template-renderer-proxy.js"></script>
<script src="/js/settings/keyboard-mouse-input-field.js"></script>
<script src="/js/settings/modal-jquery.js"></script>
diff --git a/ext/settings.html b/ext/settings.html
index eece5157..faea4aa3 100644
--- a/ext/settings.html
+++ b/ext/settings.html
@@ -3211,17 +3211,17 @@
<script src="/js/general/task-accumulator.js"></script>
<script src="/js/media/text-to-speech-audio.js"></script>
-<script src="/bg/js/anki.js"></script>
-<script src="/bg/js/anki-note-builder.js"></script>
-<script src="/bg/js/options.js"></script>
-<script src="/bg/js/database.js"></script>
-<script src="/bg/js/dictionary-database.js"></script>
-<script src="/bg/js/dictionary-importer.js"></script>
-<script src="/bg/js/json-schema.js"></script>
-<script src="/bg/js/media-utility.js"></script>
-<script src="/bg/js/permissions-util.js"></script>
-<script src="/bg/js/template-patcher.js"></script>
-<script src="/bg/js/template-renderer-proxy.js"></script>
+<script src="/js/comm/anki.js"></script>
+<script src="/js/data/anki-note-builder.js"></script>
+<script src="/js/data/options-util.js"></script>
+<script src="/js/data/database.js"></script>
+<script src="/js/language/dictionary-database.js"></script>
+<script src="/js/language/dictionary-importer.js"></script>
+<script src="/js/data/json-schema.js"></script>
+<script src="/js/media/media-utility.js"></script>
+<script src="/js/data/permissions-util.js"></script>
+<script src="/js/templates/template-patcher.js"></script>
+<script src="/js/templates/template-renderer-proxy.js"></script>
<script src="/js/settings/keyboard-mouse-input-field.js"></script>
<script src="/js/settings/profile-conditions-ui.js"></script>
diff --git a/ext/sw.js b/ext/sw.js
index 2cc9a6c3..23f9732c 100644
--- a/ext/sw.js
+++ b/ext/sw.js
@@ -25,24 +25,24 @@ self.importScripts(
'/js/general/cache-map.js',
'/js/language/dictionary-data-util.js',
'/js/general/object-property-accessor.js',
- '/bg/js/anki.js',
- '/bg/js/audio-downloader.js',
- '/bg/js/clipboard-monitor.js',
- '/bg/js/clipboard-reader.js',
- '/bg/js/database.js',
- '/bg/js/deinflector.js',
- '/bg/js/dictionary-database.js',
- '/bg/js/json-schema.js',
- '/bg/js/mecab.js',
- '/bg/js/media-utility.js',
- '/bg/js/options.js',
- '/bg/js/permissions-util.js',
- '/bg/js/profile-conditions.js',
- '/bg/js/request-builder.js',
- '/bg/js/simple-dom-parser.js',
- '/bg/js/template-patcher.js',
- '/bg/js/text-source-map.js',
- '/bg/js/translator.js',
- '/bg/js/backend.js',
- '/bg/js/background-main.js'
+ '/js/comm/anki.js',
+ '/js/media/audio-downloader.js',
+ '/js/comm/clipboard-monitor.js',
+ '/js/comm/clipboard-reader.js',
+ '/js/data/database.js',
+ '/js/language/deinflector.js',
+ '/js/language/dictionary-database.js',
+ '/js/data/json-schema.js',
+ '/js/comm/mecab.js',
+ '/js/media/media-utility.js',
+ '/js/data/options-util.js',
+ '/js/data/permissions-util.js',
+ '/js/background/profile-conditions.js',
+ '/js/background/request-builder.js',
+ '/js/dom/simple-dom-parser.js',
+ '/js/templates/template-patcher.js',
+ '/js/general/text-source-map.js',
+ '/js/language/translator.js',
+ '/js/background/backend.js',
+ '/js/background/background-main.js'
);
diff --git a/ext/template-renderer.html b/ext/template-renderer.html
index 11c19067..7245ed62 100644
--- a/ext/template-renderer.html
+++ b/ext/template-renderer.html
@@ -16,9 +16,9 @@
<script src="/lib/handlebars.min.js"></script>
<script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/language/japanese-util.js"></script>
- <script src="/bg/js/anki-note-data.js"></script>
- <script src="/bg/js/template-renderer.js"></script>
- <script src="/bg/js/template-renderer-frame-api.js"></script>
- <script src="/bg/js/template-renderer-frame-main.js"></script>
+ <script src="/js/data/anki-note-data.js"></script>
+ <script src="/js/templates/template-renderer.js"></script>
+ <script src="/js/templates/template-renderer-frame-api.js"></script>
+ <script src="/js/templates/template-renderer-frame-main.js"></script>
</body>
</html>
diff --git a/ext/welcome.html b/ext/welcome.html
index 98992aec..16dd964d 100644
--- a/ext/welcome.html
+++ b/ext/welcome.html
@@ -331,12 +331,12 @@
<script src="/js/dom/selector-observer.js"></script>
<script src="/js/general/task-accumulator.js"></script>
-<script src="/bg/js/database.js"></script>
-<script src="/bg/js/dictionary-database.js"></script>
-<script src="/bg/js/dictionary-importer.js"></script>
-<script src="/bg/js/json-schema.js"></script>
-<script src="/bg/js/media-utility.js"></script>
-<script src="/bg/js/permissions-util.js"></script>
+<script src="/js/data/database.js"></script>
+<script src="/js/language/dictionary-database.js"></script>
+<script src="/js/language/dictionary-importer.js"></script>
+<script src="/js/data/json-schema.js"></script>
+<script src="/js/media/media-utility.js"></script>
+<script src="/js/data/permissions-util.js"></script>
<script src="/js/settings/dictionary-controller.js"></script>
<script src="/js/settings/dictionary-import-controller.js"></script>
@@ -349,7 +349,7 @@
<script src="/js/settings/settings-display-controller.js"></script>
-<script src="/bg/js/welcome-main.js"></script>
+<script src="/js/pages/welcome-main.js"></script>
</body>
</html>
diff --git a/test/test-database.js b/test/test-database.js
index 8b075fd4..ae827318 100644
--- a/test/test-database.js
+++ b/test/test-database.js
@@ -25,11 +25,11 @@ const vm = new DatabaseVM();
vm.execute([
'js/core.js',
'js/general/cache-map.js',
- 'bg/js/json-schema.js',
- 'bg/js/media-utility.js',
- 'bg/js/dictionary-importer.js',
- 'bg/js/database.js',
- 'bg/js/dictionary-database.js'
+ 'js/data/json-schema.js',
+ 'js/media/media-utility.js',
+ 'js/language/dictionary-importer.js',
+ 'js/data/database.js',
+ 'js/language/dictionary-database.js'
]);
const DictionaryImporter = vm.get('DictionaryImporter');
const DictionaryDatabase = vm.get('DictionaryDatabase');
diff --git a/test/test-deinflector.js b/test/test-deinflector.js
index dbc1f7e2..a5d6c06f 100644
--- a/test/test-deinflector.js
+++ b/test/test-deinflector.js
@@ -881,7 +881,7 @@ function testDeinflections() {
];
const vm = new VM();
- vm.execute(['bg/js/deinflector.js']);
+ vm.execute(['js/language/deinflector.js']);
const [Deinflector] = vm.get(['Deinflector']);
const deinflectionReasions = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'ext', 'data/deinflect.json')));
diff --git a/test/test-japanese.js b/test/test-japanese.js
index e2be2315..590d3157 100644
--- a/test/test-japanese.js
+++ b/test/test-japanese.js
@@ -23,7 +23,7 @@ const vm = new VM();
vm.execute([
'lib/wanakana.min.js',
'js/language/japanese-util.js',
- 'bg/js/text-source-map.js'
+ 'js/general/text-source-map.js'
]);
const [JapaneseUtil, TextSourceMap, wanakana] = vm.get(['JapaneseUtil', 'TextSourceMap', 'wanakana']);
const jp = new JapaneseUtil(wanakana);
diff --git a/test/test-options-util.js b/test/test-options-util.js
index 3e3f93bc..20b1f3f4 100644
--- a/test/test-options-util.js
+++ b/test/test-options-util.js
@@ -49,9 +49,9 @@ function createVM(extDir) {
vm.execute([
'js/core.js',
'js/general/cache-map.js',
- 'bg/js/json-schema.js',
- 'bg/js/template-patcher.js',
- 'bg/js/options.js'
+ 'js/data/json-schema.js',
+ 'js/templates/template-patcher.js',
+ 'js/data/options-util.js'
]);
return vm;
diff --git a/test/test-profile-conditions.js b/test/test-profile-conditions.js
index 7ceda8c4..e1e6a72c 100644
--- a/test/test-profile-conditions.js
+++ b/test/test-profile-conditions.js
@@ -24,8 +24,8 @@ const vm = new VM({});
vm.execute([
'js/core.js',
'js/general/cache-map.js',
- 'bg/js/json-schema.js',
- 'bg/js/profile-conditions.js'
+ 'js/data/json-schema.js',
+ 'js/background/profile-conditions.js'
]);
const [JsonSchemaValidator, ProfileConditions] = vm.get(['JsonSchemaValidator', 'ProfileConditions']);
diff --git a/test/test-schema.js b/test/test-schema.js
index 2c48f5f5..7a1ea9bc 100644
--- a/test/test-schema.js
+++ b/test/test-schema.js
@@ -23,7 +23,7 @@ const vm = new VM();
vm.execute([
'js/core.js',
'js/general/cache-map.js',
- 'bg/js/json-schema.js'
+ 'js/data/json-schema.js'
]);
const JsonSchemaValidator = vm.get('JsonSchemaValidator');
diff --git a/test/test-sw.js b/test/test-sw.js
index 803bb0c2..498a0a32 100644
--- a/test/test-sw.js
+++ b/test/test-sw.js
@@ -38,9 +38,9 @@ function getAllHtmlScriptPaths(fileName) {
function convertBackgroundScriptsToServiceWorkerScripts(scripts) {
// Use parse5-based SimpleDOMParser
scripts.splice(0, 0, '/lib/parse5.js');
- const index = scripts.indexOf('/bg/js/native-simple-dom-parser.js');
+ const index = scripts.indexOf('/js/dom/native-simple-dom-parser.js');
assert.ok(index >= 0);
- scripts[index] = '/bg/js/simple-dom-parser.js';
+ scripts[index] = '/js/dom/simple-dom-parser.js';
}
function main() {
diff --git a/test/test-text-source-map.js b/test/test-text-source-map.js
index 68bb97b0..9f0c17bd 100644
--- a/test/test-text-source-map.js
+++ b/test/test-text-source-map.js
@@ -20,7 +20,7 @@ const {testMain} = require('../dev/util');
const {VM} = require('../dev/vm');
const vm = new VM();
-vm.execute(['bg/js/text-source-map.js']);
+vm.execute(['js/general/text-source-map.js']);
const TextSourceMap = vm.get('TextSourceMap');
diff --git a/test/test-translator.js b/test/test-translator.js
index e1161a15..2d7b6baa 100644
--- a/test/test-translator.js
+++ b/test/test-translator.js
@@ -39,14 +39,14 @@ async function createVM() {
'js/core.js',
'js/general/cache-map.js',
'js/language/japanese-util.js',
- 'bg/js/json-schema.js',
- 'bg/js/media-utility.js',
- 'bg/js/dictionary-importer.js',
- 'bg/js/database.js',
- 'bg/js/dictionary-database.js',
- 'bg/js/text-source-map.js',
- 'bg/js/deinflector.js',
- 'bg/js/translator.js'
+ 'js/data/json-schema.js',
+ 'js/media/media-utility.js',
+ 'js/language/dictionary-importer.js',
+ 'js/data/database.js',
+ 'js/language/dictionary-database.js',
+ 'js/general/text-source-map.js',
+ 'js/language/deinflector.js',
+ 'js/language/translator.js'
]);
const [
DictionaryImporter,