Enhance logging messages in SeasonalsManager for better clarity

This commit is contained in:
CodeDevMLH
2026-02-04 14:05:41 +01:00
parent 503e9addee
commit c55e900c0f

View File

@@ -237,10 +237,10 @@ const SeasonalsManager = {
if (response.ok) { if (response.ok) {
this.config = await response.json(); this.config = await response.json();
window.SeasonalsPluginConfig = this.config; window.SeasonalsPluginConfig = this.config;
console.log('Seasonals Config loaded:', this.config); console.log('Seasonals: Config loaded:', this.config);
} }
} catch (error) { } catch (error) {
console.error('Error fetching Seasonals config:', error); console.error('Seasonals: Error fetching config:', error);
} }
// Initialize Settings UI // Initialize Settings UI
@@ -249,13 +249,13 @@ const SeasonalsManager = {
// User Preference Check // User Preference Check
const isEnabled = SettingsManager.getSetting('enabled', 'true') === 'true'; const isEnabled = SettingsManager.getSetting('enabled', 'true') === 'true';
if (!isEnabled) { if (!isEnabled) {
console.log('Seasonals disabled by user preference.'); console.log('Seasonals: Disabled by user preference.');
return; return;
} }
// Determine Theme // Determine Theme
const themeName = this.selectTheme(); const themeName = this.selectTheme();
console.log(`Selected theme: ${themeName}`); console.log(`Seasonals: Selected theme: ${themeName}`);
if (!themeName || themeName === 'none') { if (!themeName || themeName === 'none') {
return; return;
@@ -269,7 +269,7 @@ const SeasonalsManager = {
// Check local override // Check local override
const forcedTheme = SettingsManager.getSetting('theme', 'auto'); const forcedTheme = SettingsManager.getSetting('theme', 'auto');
if (forcedTheme !== 'auto') { if (forcedTheme !== 'auto') {
console.log(`User forced theme: ${forcedTheme}`); console.log(`Seasonals: User forced theme: ${forcedTheme}`);
return forcedTheme; return forcedTheme;
} }
@@ -317,7 +317,7 @@ const SeasonalsManager = {
applyTheme(themeName) { applyTheme(themeName) {
const theme = ThemeConfigs[themeName]; const theme = ThemeConfigs[themeName];
if (!theme) { if (!theme) {
console.error(`Theme "${themeName}" not found.`); console.error(`Seasonals: Theme "${themeName}" not found.`);
return; return;
} }
@@ -326,7 +326,7 @@ const SeasonalsManager = {
if (theme.css) this.loadResource('css', theme.css); if (theme.css) this.loadResource('css', theme.css);
if (theme.js) this.loadResource('js', theme.js); if (theme.js) this.loadResource('js', theme.js);
console.log(`Theme "${themeName}" applied.`); console.log(`Seasonals: Theme "${themeName}" applied.`);
}, },
updateThemeContainer(containerClass) { updateThemeContainer(containerClass) {
@@ -355,14 +355,14 @@ const SeasonalsManager = {
link.rel = 'stylesheet'; link.rel = 'stylesheet';
link.href = path; link.href = path;
// link.href = resolvePath(cssPath); // link.href = resolvePath(cssPath);
link.onerror = () => console.error(`Failed to load CSS: ${path}`); link.onerror = () => console.error(`Seasonals: Failed to load CSS: ${path}`);
document.body.appendChild(link); document.body.appendChild(link);
} else if (type === 'js') { } else if (type === 'js') {
const script = document.createElement('script'); const script = document.createElement('script');
script.src = path; script.src = path;
// script.src = resolvePath(jsPath); // script.src = resolvePath(jsPath);
script.defer = true; script.defer = true;
script.onerror = () => console.error(`Failed to load JS: ${path}`); script.onerror = () => console.error(`Seasonals: Failed to load JS: ${path}`);
document.body.appendChild(script); document.body.appendChild(script);
} }
} }