diff --git a/.eslintrc.json b/.eslintrc.json index 4c7b2393..3dcefb91 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -84,9 +84,9 @@ "overrides": [ { "files": [ - "ext/mixed/js/core.js", + "ext/js/core.js", "ext/bg/js/template-renderer.js", - "ext/mixed/js/dictionary-data-util.js" + "ext/js/language/dictionary-data-util.js" ], "env": { "webextensions": false @@ -95,10 +95,10 @@ { "files": ["ext/**/*.js"], "excludedFiles": [ - "ext/mixed/js/core.js", + "ext/js/core.js", "ext/bg/js/template-renderer.js", "ext/bg/js/anki-note-data.js", - "ext/mixed/js/dictionary-data-util.js" + "ext/js/language/dictionary-data-util.js" ], "globals": { "serializeError": "readonly", @@ -120,15 +120,15 @@ { "files": ["ext/**/*.js"], "excludedFiles": [ - "ext/mixed/js/core.js", - "ext/mixed/js/yomichan.js" + "ext/js/core.js", + "ext/js/yomichan.js" ], "globals": { "yomichan": "readonly" } }, { - "files": ["ext/mixed/js/yomichan.js"], + "files": ["ext/js/yomichan.js"], "globals": { "chrome": "writable" } @@ -158,13 +158,13 @@ }, { "files": [ - "ext/mixed/js/core.js", - "ext/mixed/js/yomichan.js", - "ext/mixed/js/environment.js", - "ext/mixed/js/japanese.js", - "ext/mixed/js/cache-map.js", - "ext/mixed/js/dictionary-data-util.js", - "ext/mixed/js/object-property-accessor.js", + "ext/js/core.js", + "ext/js/yomichan.js", + "ext/js/background/environment.js", + "ext/js/language/japanese-util.js", + "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", diff --git a/dev/data/manifest-variants.json b/dev/data/manifest-variants.json index dd46dc22..aa06bf58 100644 --- a/dev/data/manifest-variants.json +++ b/dev/data/manifest-variants.json @@ -39,15 +39,15 @@ "file://*/*" ], "js": [ - "mixed/js/core.js", - "mixed/js/yomichan.js", - "mixed/js/comm.js", - "mixed/js/api.js", - "mixed/js/dynamic-loader.js", - "mixed/js/frame-client.js", - "mixed/js/text-scanner.js", - "mixed/js/document-util.js", - "mixed/js/hotkey-handler.js", + "js/core.js", + "js/yomichan.js", + "js/comm/cross-frame-api.js", + "js/comm/api.js", + "js/script/dynamic-loader.js", + "js/comm/frame-client.js", + "js/language/text-scanner.js", + "js/dom/document-util.js", + "js/input/hotkey-handler.js", "fg/js/dom-text-scanner.js", "fg/js/popup.js", "fg/js/text-source-range.js", diff --git a/dev/dictionary-validate.js b/dev/dictionary-validate.js index 873bcb8a..17d6e3de 100644 --- a/dev/dictionary-validate.js +++ b/dev/dictionary-validate.js @@ -22,8 +22,8 @@ const {VM} = require('./vm'); const vm = new VM(); vm.execute([ - 'mixed/js/core.js', - 'mixed/js/cache-map.js', + 'js/core.js', + 'js/general/cache-map.js', 'bg/js/json-schema.js' ]); const JsonSchemaValidator = vm.get('JsonSchemaValidator'); diff --git a/dev/schema-validate.js b/dev/schema-validate.js index bf496223..0ede032b 100644 --- a/dev/schema-validate.js +++ b/dev/schema-validate.js @@ -20,8 +20,8 @@ const {VM} = require('./vm'); const vm = new VM(); vm.execute([ - 'mixed/js/core.js', - 'mixed/js/cache-map.js', + 'js/core.js', + 'js/general/cache-map.js', 'bg/js/json-schema.js' ]); const JsonSchemaValidator = vm.get('JsonSchemaValidator'); diff --git a/ext/action-popup.html b/ext/action-popup.html index 1b0072a6..e6dbdc44 100644 --- a/ext/action-popup.html +++ b/ext/action-popup.html @@ -81,13 +81,13 @@ - - - - + + + + - - + + diff --git a/ext/background.html b/ext/background.html index b1e82bd5..92c3b0aa 100644 --- a/ext/background.html +++ b/ext/background.html @@ -17,14 +17,14 @@ - - - - + + + + - - - + + + diff --git a/ext/info.html b/ext/info.html index 4dfe4c09..a520ad52 100644 --- a/ext/info.html +++ b/ext/info.html @@ -58,13 +58,13 @@ - - - - + + + + - - + + diff --git a/ext/mixed/js/environment.js b/ext/js/background/environment.js similarity index 100% rename from ext/mixed/js/environment.js rename to ext/js/background/environment.js diff --git a/ext/mixed/js/api.js b/ext/js/comm/api.js similarity index 100% rename from ext/mixed/js/api.js rename to ext/js/comm/api.js diff --git a/ext/mixed/js/comm.js b/ext/js/comm/cross-frame-api.js similarity index 100% rename from ext/mixed/js/comm.js rename to ext/js/comm/cross-frame-api.js diff --git a/ext/mixed/js/frame-client.js b/ext/js/comm/frame-client.js similarity index 100% rename from ext/mixed/js/frame-client.js rename to ext/js/comm/frame-client.js diff --git a/ext/mixed/js/frame-endpoint.js b/ext/js/comm/frame-endpoint.js similarity index 100% rename from ext/mixed/js/frame-endpoint.js rename to ext/js/comm/frame-endpoint.js diff --git a/ext/mixed/js/core.js b/ext/js/core.js similarity index 100% rename from ext/mixed/js/core.js rename to ext/js/core.js diff --git a/ext/mixed/js/timer.js b/ext/js/debug/timer.js similarity index 100% rename from ext/mixed/js/timer.js rename to ext/js/debug/timer.js diff --git a/ext/mixed/js/display-audio.js b/ext/js/display/display-audio.js similarity index 100% rename from ext/mixed/js/display-audio.js rename to ext/js/display/display-audio.js diff --git a/ext/mixed/js/display-generator.js b/ext/js/display/display-generator.js similarity index 100% rename from ext/mixed/js/display-generator.js rename to ext/js/display/display-generator.js diff --git a/ext/mixed/js/display-history.js b/ext/js/display/display-history.js similarity index 100% rename from ext/mixed/js/display-history.js rename to ext/js/display/display-history.js diff --git a/ext/mixed/js/display-notification.js b/ext/js/display/display-notification.js similarity index 100% rename from ext/mixed/js/display-notification.js rename to ext/js/display/display-notification.js diff --git a/ext/mixed/js/display-profile-selection.js b/ext/js/display/display-profile-selection.js similarity index 100% rename from ext/mixed/js/display-profile-selection.js rename to ext/js/display/display-profile-selection.js diff --git a/ext/mixed/js/display.js b/ext/js/display/display.js similarity index 99% rename from ext/mixed/js/display.js rename to ext/js/display/display.js index 8ddca54f..ffadd055 100644 --- a/ext/mixed/js/display.js +++ b/ext/js/display/display.js @@ -1571,8 +1571,8 @@ class Display extends EventDispatcher { }; await dynamicLoader.loadScripts([ - '/mixed/js/text-scanner.js', - '/mixed/js/frame-client.js', + '/js/language/text-scanner.js', + '/js/comm/frame-client.js', '/fg/js/popup.js', '/fg/js/popup-proxy.js', '/fg/js/popup-window.js', diff --git a/ext/mixed/js/document-focus-controller.js b/ext/js/dom/document-focus-controller.js similarity index 100% rename from ext/mixed/js/document-focus-controller.js rename to ext/js/dom/document-focus-controller.js diff --git a/ext/mixed/js/document-util.js b/ext/js/dom/document-util.js similarity index 100% rename from ext/mixed/js/document-util.js rename to ext/js/dom/document-util.js diff --git a/ext/mixed/js/dom-data-binder.js b/ext/js/dom/dom-data-binder.js similarity index 100% rename from ext/mixed/js/dom-data-binder.js rename to ext/js/dom/dom-data-binder.js diff --git a/ext/mixed/js/html-template-collection.js b/ext/js/dom/html-template-collection.js similarity index 100% rename from ext/mixed/js/html-template-collection.js rename to ext/js/dom/html-template-collection.js diff --git a/ext/mixed/js/panel-element.js b/ext/js/dom/panel-element.js similarity index 100% rename from ext/mixed/js/panel-element.js rename to ext/js/dom/panel-element.js diff --git a/ext/mixed/js/popup-menu.js b/ext/js/dom/popup-menu.js similarity index 100% rename from ext/mixed/js/popup-menu.js rename to ext/js/dom/popup-menu.js diff --git a/ext/mixed/js/selector-observer.js b/ext/js/dom/selector-observer.js similarity index 100% rename from ext/mixed/js/selector-observer.js rename to ext/js/dom/selector-observer.js diff --git a/ext/mixed/js/scroll.js b/ext/js/dom/window-scroll.js similarity index 100% rename from ext/mixed/js/scroll.js rename to ext/js/dom/window-scroll.js diff --git a/ext/mixed/js/cache-map.js b/ext/js/general/cache-map.js similarity index 100% rename from ext/mixed/js/cache-map.js rename to ext/js/general/cache-map.js diff --git a/ext/mixed/js/object-property-accessor.js b/ext/js/general/object-property-accessor.js similarity index 100% rename from ext/mixed/js/object-property-accessor.js rename to ext/js/general/object-property-accessor.js diff --git a/ext/mixed/js/task-accumulator.js b/ext/js/general/task-accumulator.js similarity index 100% rename from ext/mixed/js/task-accumulator.js rename to ext/js/general/task-accumulator.js diff --git a/ext/mixed/js/hotkey-handler.js b/ext/js/input/hotkey-handler.js similarity index 100% rename from ext/mixed/js/hotkey-handler.js rename to ext/js/input/hotkey-handler.js diff --git a/ext/mixed/js/hotkey-help-controller.js b/ext/js/input/hotkey-help-controller.js similarity index 100% rename from ext/mixed/js/hotkey-help-controller.js rename to ext/js/input/hotkey-help-controller.js diff --git a/ext/mixed/js/hotkey-util.js b/ext/js/input/hotkey-util.js similarity index 100% rename from ext/mixed/js/hotkey-util.js rename to ext/js/input/hotkey-util.js diff --git a/ext/mixed/js/dictionary-data-util.js b/ext/js/language/dictionary-data-util.js similarity index 100% rename from ext/mixed/js/dictionary-data-util.js rename to ext/js/language/dictionary-data-util.js diff --git a/ext/mixed/js/japanese.js b/ext/js/language/japanese-util.js similarity index 100% rename from ext/mixed/js/japanese.js rename to ext/js/language/japanese-util.js diff --git a/ext/mixed/js/text-scanner.js b/ext/js/language/text-scanner.js similarity index 100% rename from ext/mixed/js/text-scanner.js rename to ext/js/language/text-scanner.js diff --git a/ext/mixed/js/audio-system.js b/ext/js/media/audio-system.js similarity index 100% rename from ext/mixed/js/audio-system.js rename to ext/js/media/audio-system.js diff --git a/ext/mixed/js/media-loader.js b/ext/js/media/media-loader.js similarity index 100% rename from ext/mixed/js/media-loader.js rename to ext/js/media/media-loader.js diff --git a/ext/mixed/js/text-to-speech-audio.js b/ext/js/media/text-to-speech-audio.js similarity index 100% rename from ext/mixed/js/text-to-speech-audio.js rename to ext/js/media/text-to-speech-audio.js diff --git a/ext/mixed/js/dynamic-loader-sentinel.js b/ext/js/script/dynamic-loader-sentinel.js similarity index 100% rename from ext/mixed/js/dynamic-loader-sentinel.js rename to ext/js/script/dynamic-loader-sentinel.js diff --git a/ext/mixed/js/dynamic-loader.js b/ext/js/script/dynamic-loader.js similarity index 98% rename from ext/mixed/js/dynamic-loader.js rename to ext/js/script/dynamic-loader.js index bb4efb13..0464f151 100644 --- a/ext/mixed/js/dynamic-loader.js +++ b/ext/js/script/dynamic-loader.js @@ -150,7 +150,7 @@ const dynamicLoader = (() => { try { script.async = false; - script.src = '/mixed/js/dynamic-loader-sentinel.js'; + script.src = '/js/script/dynamic-loader-sentinel.js'; parent.appendChild(script); } catch (e) { yomichan.off(sentinelEventName, sentinelEventCallback); diff --git a/ext/mixed/js/yomichan.js b/ext/js/yomichan.js similarity index 100% rename from ext/mixed/js/yomichan.js rename to ext/js/yomichan.js diff --git a/ext/legal.html b/ext/legal.html index b8c1f1c5..644ad831 100644 --- a/ext/legal.html +++ b/ext/legal.html @@ -219,7 +219,7 @@ THE SOFTWARE. - + diff --git a/ext/manifest.json b/ext/manifest.json index c8178143..4ac53273 100644 --- a/ext/manifest.json +++ b/ext/manifest.json @@ -38,15 +38,15 @@ "file://*/*" ], "js": [ - "mixed/js/core.js", - "mixed/js/yomichan.js", - "mixed/js/comm.js", - "mixed/js/api.js", - "mixed/js/dynamic-loader.js", - "mixed/js/frame-client.js", - "mixed/js/text-scanner.js", - "mixed/js/document-util.js", - "mixed/js/hotkey-handler.js", + "js/core.js", + "js/yomichan.js", + "js/comm/cross-frame-api.js", + "js/comm/api.js", + "js/script/dynamic-loader.js", + "js/comm/frame-client.js", + "js/language/text-scanner.js", + "js/dom/document-util.js", + "js/input/hotkey-handler.js", "fg/js/dom-text-scanner.js", "fg/js/popup.js", "fg/js/text-source-range.js", diff --git a/ext/permissions.html b/ext/permissions.html index 2ea9f2a1..06dcf5bf 100644 --- a/ext/permissions.html +++ b/ext/permissions.html @@ -161,13 +161,13 @@ - - - - + + + + - - + + diff --git a/ext/pitch-accents-preview.html b/ext/pitch-accents-preview.html index b2885c92..9653b9c5 100644 --- a/ext/pitch-accents-preview.html +++ b/ext/pitch-accents-preview.html @@ -49,13 +49,13 @@ - - - - + + + + - - + + diff --git a/ext/popup-preview.html b/ext/popup-preview.html index 567dd201..18aec551 100644 --- a/ext/popup-preview.html +++ b/ext/popup-preview.html @@ -36,16 +36,16 @@ - - - - - - - + + + + + + + - - + + diff --git a/ext/popup.html b/ext/popup.html index 0203043a..274340ca 100644 --- a/ext/popup.html +++ b/ext/popup.html @@ -89,37 +89,37 @@
- - - - - + + + + + - + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/ext/search.html b/ext/search.html index e2c402bb..384493c8 100644 --- a/ext/search.html +++ b/ext/search.html @@ -75,34 +75,34 @@ - - - - - + + + + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/ext/settings-old.html b/ext/settings-old.html index 1fb4379f..26f7770b 100644 --- a/ext/settings-old.html +++ b/ext/settings-old.html @@ -1278,24 +1278,24 @@ - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/ext/settings.html b/ext/settings.html index 5773c6de..8fb715c1 100644 --- a/ext/settings.html +++ b/ext/settings.html @@ -3189,27 +3189,27 @@ - - - - - - + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/ext/sw.js b/ext/sw.js index 6516cdbf..2cc9a6c3 100644 --- a/ext/sw.js +++ b/ext/sw.js @@ -18,13 +18,13 @@ self.importScripts( '/lib/parse5.js', '/lib/wanakana.min.js', - '/mixed/js/core.js', - '/mixed/js/yomichan.js', - '/mixed/js/environment.js', - '/mixed/js/japanese.js', - '/mixed/js/cache-map.js', - '/mixed/js/dictionary-data-util.js', - '/mixed/js/object-property-accessor.js', + '/js/core.js', + '/js/yomichan.js', + '/js/background/environment.js', + '/js/language/japanese-util.js', + '/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', diff --git a/ext/template-renderer.html b/ext/template-renderer.html index 6f031d5d..11c19067 100644 --- a/ext/template-renderer.html +++ b/ext/template-renderer.html @@ -14,8 +14,8 @@ - - + + diff --git a/ext/welcome.html b/ext/welcome.html index a4138e60..4c7657c8 100644 --- a/ext/welcome.html +++ b/ext/welcome.html @@ -314,22 +314,22 @@ - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/test/test-cache-map.js b/test/test-cache-map.js index 4d19015b..b01f5ed8 100644 --- a/test/test-cache-map.js +++ b/test/test-cache-map.js @@ -21,7 +21,7 @@ const {VM} = require('../dev/vm'); const vm = new VM({console}); vm.execute([ - 'mixed/js/cache-map.js' + 'js/general/cache-map.js' ]); const CacheMap = vm.get('CacheMap'); diff --git a/test/test-core.js b/test/test-core.js index cb315c08..cf9a5c35 100644 --- a/test/test-core.js +++ b/test/test-core.js @@ -30,7 +30,7 @@ const vm = new VM({ } }); vm.execute([ - 'mixed/js/core.js' + 'js/core.js' ]); const [DynamicProperty, deepEqual] = vm.get(['DynamicProperty', 'deepEqual']); diff --git a/test/test-database.js b/test/test-database.js index 4ac0dae6..8b075fd4 100644 --- a/test/test-database.js +++ b/test/test-database.js @@ -23,8 +23,8 @@ const {DatabaseVM} = require('../dev/database-vm'); const vm = new DatabaseVM(); vm.execute([ - 'mixed/js/core.js', - 'mixed/js/cache-map.js', + 'js/core.js', + 'js/general/cache-map.js', 'bg/js/json-schema.js', 'bg/js/media-utility.js', 'bg/js/dictionary-importer.js', diff --git a/test/test-document-util.js b/test/test-document-util.js index 2311e25f..5c6a3894 100644 --- a/test/test-document-util.js +++ b/test/test-document-util.js @@ -97,7 +97,7 @@ async function testDocument1() { 'fg/js/dom-text-scanner.js', 'fg/js/text-source-range.js', 'fg/js/text-source-element.js', - 'mixed/js/document-util.js' + 'js/dom/document-util.js' ]); const [DOMTextScanner, TextSourceRange, TextSourceElement, DocumentUtil] = vm.get([ 'DOMTextScanner', diff --git a/test/test-hotkey-util.js b/test/test-hotkey-util.js index 1388c538..eb4cf0b3 100644 --- a/test/test-hotkey-util.js +++ b/test/test-hotkey-util.js @@ -26,7 +26,7 @@ function clone(value) { function createHotkeyUtil() { const vm = new VM(); - vm.execute(['mixed/js/hotkey-util.js']); + vm.execute(['js/input/hotkey-util.js']); const [HotkeyUtil] = vm.get(['HotkeyUtil']); return new HotkeyUtil(); } diff --git a/test/test-japanese.js b/test/test-japanese.js index e83b0c1b..e2be2315 100644 --- a/test/test-japanese.js +++ b/test/test-japanese.js @@ -22,7 +22,7 @@ const {VM} = require('../dev/vm'); const vm = new VM(); vm.execute([ 'lib/wanakana.min.js', - 'mixed/js/japanese.js', + 'js/language/japanese-util.js', 'bg/js/text-source-map.js' ]); const [JapaneseUtil, TextSourceMap, wanakana] = vm.get(['JapaneseUtil', 'TextSourceMap', 'wanakana']); diff --git a/test/test-object-property-accessor.js b/test/test-object-property-accessor.js index 920cfc81..b3f05c7e 100644 --- a/test/test-object-property-accessor.js +++ b/test/test-object-property-accessor.js @@ -20,7 +20,7 @@ const {testMain} = require('../dev/util'); const {VM} = require('../dev/vm'); const vm = new VM({}); -vm.execute('mixed/js/object-property-accessor.js'); +vm.execute('js/general/object-property-accessor.js'); const ObjectPropertyAccessor = vm.get('ObjectPropertyAccessor'); diff --git a/test/test-options-util.js b/test/test-options-util.js index e4bc4e94..3e3f93bc 100644 --- a/test/test-options-util.js +++ b/test/test-options-util.js @@ -47,8 +47,8 @@ function createVM(extDir) { const vm = new VM({chrome, fetch}); vm.execute([ - 'mixed/js/core.js', - 'mixed/js/cache-map.js', + 'js/core.js', + 'js/general/cache-map.js', 'bg/js/json-schema.js', 'bg/js/template-patcher.js', 'bg/js/options.js' diff --git a/test/test-profile-conditions.js b/test/test-profile-conditions.js index 40788920..7ceda8c4 100644 --- a/test/test-profile-conditions.js +++ b/test/test-profile-conditions.js @@ -22,8 +22,8 @@ const {VM} = require('../dev/vm'); const vm = new VM({}); vm.execute([ - 'mixed/js/core.js', - 'mixed/js/cache-map.js', + 'js/core.js', + 'js/general/cache-map.js', 'bg/js/json-schema.js', 'bg/js/profile-conditions.js' ]); diff --git a/test/test-schema.js b/test/test-schema.js index f0ebd669..2c48f5f5 100644 --- a/test/test-schema.js +++ b/test/test-schema.js @@ -21,8 +21,8 @@ const {VM} = require('../dev/vm'); const vm = new VM(); vm.execute([ - 'mixed/js/core.js', - 'mixed/js/cache-map.js', + 'js/core.js', + 'js/general/cache-map.js', 'bg/js/json-schema.js' ]); const JsonSchemaValidator = vm.get('JsonSchemaValidator'); diff --git a/test/test-translator.js b/test/test-translator.js index 778a7ce1..e1161a15 100644 --- a/test/test-translator.js +++ b/test/test-translator.js @@ -36,9 +36,9 @@ async function createVM() { // Set up VM const vm = new DatabaseVM(); vm.execute([ - 'mixed/js/core.js', - 'mixed/js/cache-map.js', - 'mixed/js/japanese.js', + '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',