Organize main settings script

This commit is contained in:
toasted-nutbread 2019-12-01 16:18:29 -05:00
parent a4de2d425a
commit 767a480a84

View File

@ -204,27 +204,6 @@ async function onFormOptionsChanged(e) {
} }
} }
async function onReady() {
showExtensionInformation();
formSetupEventListeners();
appearanceInitialize();
await audioSettingsInitialize();
await profileOptionsSetup();
await dictSettingsInitialize();
ankiTemplatesInitialize();
storageInfoInitialize();
chrome.runtime.onMessage.addListener(onMessage);
}
$(document).ready(() => onReady());
/*
* Remote options updates
*/
function settingsGetSource() { function settingsGetSource() {
return new Promise((resolve) => { return new Promise((resolve) => {
@ -258,10 +237,6 @@ function onMessage({action, params}, sender, callback) {
} }
/*
* Information
*/
function showExtensionInformation() { function showExtensionInformation() {
const node = document.getElementById('extension-info'); const node = document.getElementById('extension-info');
if (node === null) { return; } if (node === null) { return; }
@ -269,3 +244,21 @@ function showExtensionInformation() {
const manifest = chrome.runtime.getManifest(); const manifest = chrome.runtime.getManifest();
node.textContent = `${manifest.name} v${manifest.version}`; node.textContent = `${manifest.name} v${manifest.version}`;
} }
async function onReady() {
showExtensionInformation();
formSetupEventListeners();
appearanceInitialize();
await audioSettingsInitialize();
await profileOptionsSetup();
await dictSettingsInitialize();
ankiTemplatesInitialize();
storageInfoInitialize();
chrome.runtime.onMessage.addListener(onMessage);
}
$(document).ready(() => onReady());