summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-01 16:18:29 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-01 17:02:01 -0500
commit767a480a847b641768b94b835a6ac10c1c3d69bf (patch)
tree92f97923bf0833c51efe26006f409b83d471ba4a /ext/bg
parenta4de2d425a160954aa0311c7a501a5ec83449502 (diff)
Organize main settings script
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/settings/main.js43
1 files changed, 18 insertions, 25 deletions
diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js
index 5724cdb3..a9edab78 100644
--- a/ext/bg/js/settings/main.js
+++ b/ext/bg/js/settings/main.js
@@ -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() {
return new Promise((resolve) => {
@@ -258,10 +237,6 @@ function onMessage({action, params}, sender, callback) {
}
-/*
- * Information
- */
-
function showExtensionInformation() {
const node = document.getElementById('extension-info');
if (node === null) { return; }
@@ -269,3 +244,21 @@ function showExtensionInformation() {
const manifest = chrome.runtime.getManifest();
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());