From e7cfac47aa0bdcf617b8688de0d571d75ef2f547 Mon Sep 17 00:00:00 2001 From: James Maa Date: Tue, 5 Nov 2024 10:49:42 -0800 Subject: [PATCH] Add support page (#1562) * Add support page * Comments --- ext/info.html | 10 ++++---- ext/js/pages/support-main.js | 41 +++++++++++++++++++++++++++++++++ ext/support.html | 44 ++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 ext/js/pages/support-main.js create mode 100644 ext/support.html diff --git a/ext/info.html b/ext/info.html index d663a93bef..7c85b80be3 100644 --- a/ext/info.html +++ b/ext/info.html @@ -66,11 +66,13 @@
diff --git a/ext/js/pages/support-main.js b/ext/js/pages/support-main.js new file mode 100644 index 0000000000..5f35b7960f --- /dev/null +++ b/ext/js/pages/support-main.js @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Yomitan Authors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import {ThemeController} from '../app/theme-controller.js'; +import {Application} from '../application.js'; +import {SettingsController} from './settings/settings-controller.js'; + +await Application.main(true, async (application) => { + const settingsController = new SettingsController(application); + await settingsController.prepare(); + + /** @type {ThemeController} */ + const themeController = new ThemeController(document.documentElement); + themeController.prepare(); + const optionsFull = await application.api.optionsGetFull(); + const {profiles, profileCurrent} = optionsFull; + const defaultProfile = (profileCurrent >= 0 && profileCurrent < profiles.length) ? profiles[profileCurrent] : null; + if (defaultProfile !== null) { + themeController.theme = defaultProfile.options.general.popupTheme; + themeController.siteOverride = true; + themeController.updateTheme(); + } + + document.body.hidden = false; + + document.documentElement.dataset.loaded = 'true'; +}); diff --git a/ext/support.html b/ext/support.html new file mode 100644 index 0000000000..00bcf3e819 --- /dev/null +++ b/ext/support.html @@ -0,0 +1,44 @@ + + + + + + Support Yomitan + + + + + + + + + + + + + + +
+
+
+ + + +

Support Yomitan ❤️

+ +

Here are some ways to support Yomitan:

+
+
+ +
+
+
+
+
+ + +