Organize settings/main.js (#577)

This commit is contained in:
toasted-nutbread 2020-05-30 09:50:33 -04:00 committed by GitHub
parent 63a3e56367
commit 789da0206b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,7 +62,7 @@ async function setupEnvironmentInfo() {
} }
async function onReady() { (async () => {
api.forwardLogsToBackend(); api.forwardLogsToBackend();
await yomichan.prepare(); await yomichan.prepare();
@ -71,6 +71,7 @@ async function onReady() {
settingsPopulateModifierKeys(); settingsPopulateModifierKeys();
const optionsFull = await api.optionsGetFull(); const optionsFull = await api.optionsGetFull();
const settingsController = new SettingsController(optionsFull.profileCurrent); const settingsController = new SettingsController(optionsFull.profileCurrent);
settingsController.prepare(); settingsController.prepare();
@ -79,16 +80,28 @@ async function onReady() {
const genericSettingController = new GenericSettingController(settingsController); const genericSettingController = new GenericSettingController(settingsController);
genericSettingController.prepare(); genericSettingController.prepare();
new ClipboardPopupsController(settingsController).prepare();
new PopupPreviewController(settingsController).prepare(); const clipboardPopupsController = new ClipboardPopupsController(settingsController);
new AudioController(settingsController).prepare(); clipboardPopupsController.prepare();
new ProfileController(settingsController).prepare();
const popupPreviewController = new PopupPreviewController(settingsController);
popupPreviewController.prepare();
const audioController = new AudioController(settingsController);
audioController.prepare();
const profileController = new ProfileController(settingsController);
profileController.prepare();
const dictionaryController = new DictionaryController(settingsController, storageController); const dictionaryController = new DictionaryController(settingsController, storageController);
dictionaryController.prepare(); dictionaryController.prepare();
const ankiController = new AnkiController(settingsController); const ankiController = new AnkiController(settingsController);
ankiController.prepare(); ankiController.prepare();
new AnkiTemplatesController(settingsController, ankiController).prepare();
new SettingsBackup(settingsController).prepare();
}
$(document).ready(() => onReady()); const ankiTemplatesController = new AnkiTemplatesController(settingsController, ankiController);
ankiTemplatesController.prepare();
const settingsBackup = new SettingsBackup(settingsController);
settingsBackup.prepare();
})();