Skip to content

Commit

Permalink
Fix scrollbars on info, legal, and issues; add theming to legal and i…
Browse files Browse the repository at this point in the history
…ssues (#1096)

* Add theming support to generic-page-main.js

* Mark scrollbars on info, issues, and legal

* Remove quick-start-guide-main.js in favor of generic-page-main.js

* Default body to hidden on issues and legal
  • Loading branch information
Kuuuube authored Jun 20, 2024
1 parent 9f4e595 commit 8f33cb7
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 48 deletions.
2 changes: 1 addition & 1 deletion ext/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<body hidden>

<!-- Main content -->
<div class="content-outer"><div class="content">
<div class="content-outer"><div class="content scrollbar">
<div class="content-left"></div>
<div class="content-center">

Expand Down
4 changes: 2 additions & 2 deletions ext/issues.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<link rel="stylesheet" type="text/css" href="/css/settings.css">
<script src="/js/pages/generic-page-main.js" type="module"></script>
</head>
<body>
<body hidden>

<!-- Main content -->
<div class="content-outer"><div class="content">
<div class="content-outer"><div class="content scrollbar">
<div class="content-left"></div>
<div class="content-center">

Expand Down
25 changes: 20 additions & 5 deletions ext/js/pages/generic-page-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,33 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import {ThemeController} from '../app/theme-controller.js';
import {Application} from '../application.js';
import {DocumentFocusController} from '../dom/document-focus-controller.js';
import {ExtensionContentController} from './common/extension-content-controller.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 primaryProfile = (profileCurrent >= 0 && profileCurrent < profiles.length) ? profiles[profileCurrent] : null;
if (primaryProfile !== null) {
themeController.theme = primaryProfile.options.general.popupTheme;
themeController.siteOverride = true;
themeController.updateTheme();
}
document.body.hidden = false;

/** Entry point. */
function main() {
const documentFocusController = new DocumentFocusController();
documentFocusController.prepare();

const extensionContentController = new ExtensionContentController();
extensionContentController.prepare();

document.documentElement.dataset.loaded = 'true';
}

main();
});
37 changes: 0 additions & 37 deletions ext/js/pages/quick-start-guide-main.js

This file was deleted.

4 changes: 2 additions & 2 deletions ext/legal.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<script src="/js/pages/generic-page-main.js" type="module"></script>
</head>

<body>
<body hidden>

<!-- Main content -->
<div class="content-outer">
<div class="content">
<div class="content scrollbar">
<div class="content-left"></div>
<div class="content-center">

Expand Down
2 changes: 1 addition & 1 deletion ext/quick-start-guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link rel="icon" type="image/png" href="/images/icon128.png" sizes="128x128">
<link rel="stylesheet" type="text/css" href="/css/material.css">
<link rel="stylesheet" type="text/css" href="/css/settings.css">
<script src="/js/pages/quick-start-guide-main.js" type="module"></script>
<script src="/js/pages/generic-page-main.js" type="module"></script>
</head>
<body hidden>

Expand Down

0 comments on commit 8f33cb7

Please sign in to comment.