mirror of
https://github.com/ellite/Wallos.git
synced 2026-07-30 17:55:53 -04:00
feat: option for the week to start on sunday feat: redesign login / registration pages feat: more statistics feat: declarative oidc settings feat: grid view for subscriptions feat: subscription details popup feat: translate categories with ai feat: google image search with serpapi feat: selfh.st image search feat: dashboard icons image search fix: improve background removal feature for logos feat: v2.0 api - write endpoints fix: include todays subscriptions on amount due this month fix: calendar occurrences to respect subscription start date fix: honor configured outbound proxy for logo search without reopening httpoxy SSRF bypass fix: remove hardcode string from the admin page fix: ssrf via http proxy env var in payments logo search fix: require cron auth guard on storetotalyearlycost.php fix: validate per-user smtp host against ssrf fix: escape iCal property values to prevent crlf injection
38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
function applyAuthThemeIcon() {
|
|
const darkCss = document.getElementById('dark-theme');
|
|
const icon = document.querySelector('#theme-toggle i');
|
|
if (!darkCss || !icon) {
|
|
return;
|
|
}
|
|
icon.className = 'fa-solid ' + (darkCss.disabled ? 'fa-moon' : 'fa-sun');
|
|
}
|
|
|
|
function toggleAuthTheme() {
|
|
const darkCss = document.getElementById('dark-theme');
|
|
if (!darkCss) {
|
|
return;
|
|
}
|
|
const next = darkCss.disabled ? 'dark' : 'light';
|
|
darkCss.disabled = next === 'light';
|
|
|
|
const expirationDate = new Date();
|
|
expirationDate.setFullYear(expirationDate.getFullYear() + 1);
|
|
document.cookie = 'theme=' + next + '; expires=' + expirationDate.toUTCString() + '; SameSite=Lax';
|
|
|
|
const themeColorMetaTag = document.querySelector('meta[name="theme-color"]');
|
|
if (themeColorMetaTag) {
|
|
themeColorMetaTag.setAttribute('content', next === 'dark' ? '#12151C' : '#FFFFFF');
|
|
}
|
|
|
|
applyAuthThemeIcon();
|
|
}
|
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
const toggle = document.getElementById('theme-toggle');
|
|
if (toggle) {
|
|
toggle.addEventListener('click', toggleAuthTheme);
|
|
}
|
|
// Sync the icon after login.js may have applied the OS preference
|
|
applyAuthThemeIcon();
|
|
});
|