aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages/settings/settings-main.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-01 10:00:59 -0500
committerGitHub <noreply@github.com>2024-02-01 15:00:59 +0000
commitdfd42bad0b46845ad88d1fdc5fa82b4f03bab0f3 (patch)
tree04686b943b84b33b8927238be17e4bc0dda7eb62 /ext/js/pages/settings/settings-main.js
parent2356223942a21d1683ac38eed8e7b9485f453d87 (diff)
Application refactor (#591)
* Rename Yomitan class to Application, change initialization style * Rename file * Update init * Update config * Remove dead code
Diffstat (limited to 'ext/js/pages/settings/settings-main.js')
-rw-r--r--ext/js/pages/settings/settings-main.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/js/pages/settings/settings-main.js b/ext/js/pages/settings/settings-main.js
index 7e458043..c3391173 100644
--- a/ext/js/pages/settings/settings-main.js
+++ b/ext/js/pages/settings/settings-main.js
@@ -16,10 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+import {Application} from '../../application.js';
import {log} from '../../core/logger.js';
import {DocumentFocusController} from '../../dom/document-focus-controller.js';
import {querySelectorNotNull} from '../../dom/query-selector.js';
-import {yomitan} from '../../yomitan.js';
import {ExtensionContentController} from '../common/extension-content-controller.js';
import {AnkiController} from './anki-controller.js';
import {AnkiTemplatesController} from './anki-templates-controller.js';
@@ -78,7 +78,8 @@ async function main() {
document.documentElement.dataset.loadingStalled = 'true';
}, 1000);
- await yomitan.prepare();
+ const application = new Application();
+ await application.prepare();
if (prepareTimer !== null) {
clearTimeout(prepareTimer);
@@ -91,10 +92,10 @@ async function main() {
const modalController = new ModalController();
modalController.prepare();
- const settingsController = new SettingsController();
+ const settingsController = new SettingsController(application);
await settingsController.prepare();
- const persistentStorageController = new PersistentStorageController();
+ const persistentStorageController = new PersistentStorageController(application);
persistentStorageController.prepare();
const storageController = new StorageController(persistentStorageController);
@@ -154,10 +155,10 @@ async function main() {
const extensionKeyboardShortcutController = new ExtensionKeyboardShortcutController(settingsController);
extensionKeyboardShortcutController.prepare();
- const popupWindowController = new PopupWindowController();
+ const popupWindowController = new PopupWindowController(application.api);
popupWindowController.prepare();
- const mecabController = new MecabController();
+ const mecabController = new MecabController(application.api);
mecabController.prepare();
const collapsibleDictionaryController = new CollapsibleDictionaryController(settingsController);