Enhance logging messages in SeasonalsManager for better clarity
This commit is contained in:
@@ -237,10 +237,10 @@ const SeasonalsManager = {
|
||||
if (response.ok) {
|
||||
this.config = await response.json();
|
||||
window.SeasonalsPluginConfig = this.config;
|
||||
console.log('Seasonals Config loaded:', this.config);
|
||||
console.log('Seasonals: Config loaded:', this.config);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching Seasonals config:', error);
|
||||
console.error('Seasonals: Error fetching config:', error);
|
||||
}
|
||||
|
||||
// Initialize Settings UI
|
||||
@@ -249,13 +249,13 @@ const SeasonalsManager = {
|
||||
// User Preference Check
|
||||
const isEnabled = SettingsManager.getSetting('enabled', 'true') === 'true';
|
||||
if (!isEnabled) {
|
||||
console.log('Seasonals disabled by user preference.');
|
||||
console.log('Seasonals: Disabled by user preference.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine Theme
|
||||
const themeName = this.selectTheme();
|
||||
console.log(`Selected theme: ${themeName}`);
|
||||
console.log(`Seasonals: Selected theme: ${themeName}`);
|
||||
|
||||
if (!themeName || themeName === 'none') {
|
||||
return;
|
||||
@@ -269,7 +269,7 @@ const SeasonalsManager = {
|
||||
// Check local override
|
||||
const forcedTheme = SettingsManager.getSetting('theme', 'auto');
|
||||
if (forcedTheme !== 'auto') {
|
||||
console.log(`User forced theme: ${forcedTheme}`);
|
||||
console.log(`Seasonals: User forced theme: ${forcedTheme}`);
|
||||
return forcedTheme;
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ const SeasonalsManager = {
|
||||
applyTheme(themeName) {
|
||||
const theme = ThemeConfigs[themeName];
|
||||
if (!theme) {
|
||||
console.error(`Theme "${themeName}" not found.`);
|
||||
console.error(`Seasonals: Theme "${themeName}" not found.`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ const SeasonalsManager = {
|
||||
if (theme.css) this.loadResource('css', theme.css);
|
||||
if (theme.js) this.loadResource('js', theme.js);
|
||||
|
||||
console.log(`Theme "${themeName}" applied.`);
|
||||
console.log(`Seasonals: Theme "${themeName}" applied.`);
|
||||
},
|
||||
|
||||
updateThemeContainer(containerClass) {
|
||||
@@ -355,14 +355,14 @@ const SeasonalsManager = {
|
||||
link.rel = 'stylesheet';
|
||||
link.href = path;
|
||||
// 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);
|
||||
} else if (type === 'js') {
|
||||
const script = document.createElement('script');
|
||||
script.src = path;
|
||||
// script.src = resolvePath(jsPath);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user