Skip to content

Commit f74e544

Browse files
Revert "Update urls && baseurl in localstorage"
1 parent 0b3d403 commit f74e544

File tree

2 files changed

+7
-28
lines changed

2 files changed

+7
-28
lines changed

Auto-Image.js

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11
; (async () => {
2-
// Base URL configuration - checks localStorage first, falls back to GitHub
3-
const getBaseUrl = () => {
4-
try {
5-
const customBaseUrl = localStorage.getItem('wplace-autobot-base-url');
6-
if (customBaseUrl) {
7-
return customBaseUrl.endsWith('/') ? customBaseUrl.slice(0, -1) : customBaseUrl;
8-
}
9-
} catch (e) {
10-
console.warn('Could not access localStorage for base URL:', e);
11-
}
12-
return 'https://raw.githubusercontent.com/Wplace-AutoBot/WPlace-AutoBOT/main';
13-
};
14-
152
// CONFIGURATION CONSTANTS
163
const CONFIG = {
174
COOLDOWN_DEFAULT: 31000,
@@ -296,8 +283,8 @@ function applyTheme() {
296283
return loadedTranslations[language];
297284
}
298285

299-
// Load translations using base URL (checks localStorage, falls back to GitHub)
300-
const url = `${getBaseUrl()}/decoupled-translations/lang/${language}.json`;
286+
// Load translations from CDN
287+
const url = `https://staninna.github.io/WPlace-AutoBOT/decoupled-translations/lang/${language}.json`;
301288
const maxRetries = 3;
302289
const baseDelay = 1000; // 1 second
303290

@@ -2742,20 +2729,10 @@ function applyTheme() {
27422729
// Link external CSS files
27432730
const cssLink = document.createElement('link');
27442731
cssLink.rel = 'stylesheet';
2745-
cssLink.href = `${getBaseUrl()}/auto-image-styles.css`;
2732+
cssLink.href = 'https://staninna.github.io/WPlace-AutoBOT/decoupled-css/auto-image-styles.css'; // TODO: Before merge change to https://raw.githubusercontent.com/Wplace-AutoBot/WPlace-AutoBOT/refs/heads/main/auto-image-styles.css
27462733
cssLink.setAttribute('data-wplace-theme', 'true');
27472734
document.head.appendChild(cssLink);
27482735

2749-
// Dynamically load theme CSS files using base URL
2750-
const themeFiles = ['classic.css', 'classic-light.css', 'neon.css'];
2751-
themeFiles.forEach(themeFile => {
2752-
const themeLink = document.createElement('link');
2753-
themeLink.rel = 'stylesheet';
2754-
themeLink.href = `${getBaseUrl()}/themes/${themeFile}`;
2755-
themeLink.setAttribute('data-wplace-theme-file', themeFile);
2756-
document.head.appendChild(themeLink);
2757-
});
2758-
27592736
const container = document.createElement("div")
27602737
container.id = "wplace-image-bot-container"
27612738
container.innerHTML = `

auto-image-styles.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
/* Theme tokens (CSS vars) */
88
/* ========================= */
99

10-
/* Theme files are now loaded dynamically via JavaScript using the base URL from localStorage */
11-
/* See Auto-Image.js lines 2749-2757 for dynamic theme loading implementation */
10+
/* Import theme files - classic is default */
11+
@import url('https://staninna.github.io/WPlace-AutoBOT/decoupled-css/themes/classic.css');
12+
@import url('https://staninna.github.io/WPlace-AutoBOT/decoupled-css/themes/classic-light.css');
13+
@import url('https://staninna.github.io/WPlace-AutoBOT/decoupled-css/themes/neon.css');
1214

1315
/* Default :root CSS variables for 100% classic theme compliance */
1416
/* These ensure the bot works perfectly even if theme files fail to load */

0 commit comments

Comments
 (0)