restruct html/js and cleanup

This commit is contained in:
Vladimir Mandic
2023-06-01 17:44:12 -04:00
parent e10d929190
commit 251dc341f9
22 changed files with 78 additions and 117 deletions
+3 -3
View File
@@ -401,10 +401,10 @@ function preview_theme() {
if (name === 'black-orange' || name.startsWith('gradio/')) {
const el = document.getElementById('theme-preview') || create_theme_element();
el.style.display = el.style.display === 'block' ? 'none' : 'block';
if (name === 'black-orange') el.src = '/file=javascript/black-orange.jpg';
else el.src = `/file=javascript/${name.replace('/', '-')}.jpg`;
if (name === 'black-orange') el.src = '/file=html/black-orange.jpg';
else el.src = `/file=html/${name.replace('/', '-')}.jpg`;
} else {
fetch('/file=javascript/themes.json')
fetch('/file=html/themes.json')
.then((r) => r.json())
.then((themes) => {
const theme = themes.find((t) => t.id === name);