Add extra prompts, endless generation, random character default, and small fixes
- Add extra positive/negative prompt textareas to all 9 detail pages with session persistence - Add Endless generation button to all detail pages (continuous preview generation until stopped) - Default character selector to "Random Character" on all secondary detail pages - Fix queue clear endpoint (remove spurious auth check) - Refactor app.py into routes/ and services/ modules - Update CLAUDE.md with new architecture documentation - Various data file updates and cleanup Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
55
fix_image_modal.py
Normal file
55
fix_image_modal.py
Normal file
@@ -0,0 +1,55 @@
|
||||
import glob
|
||||
import re
|
||||
|
||||
files = glob.glob('templates/*/detail.html') + ['templates/detail.html']
|
||||
|
||||
for filepath in files:
|
||||
with open(filepath, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# We need to replace:
|
||||
# data-bs-toggle="modal" data-bs-target="#imageModal" onclick="showImage(this.querySelector('img').src)"
|
||||
# with:
|
||||
# onclick="openGallery([this.querySelector('img') ? this.querySelector('img').src : ''], 0)"
|
||||
|
||||
# Or in some places:
|
||||
# data-bs-toggle="modal" data-bs-target="#imageModal" onclick="showImage(this.querySelector('img') ? this.querySelector('img').src : '')"
|
||||
# and:
|
||||
# data-bs-toggle="modal" data-bs-target="#imageModal" onclick="showImage(this.src)"
|
||||
|
||||
# Also there are instances like:
|
||||
# onclick="showImage(this.querySelector('img').src)"
|
||||
# and
|
||||
# onclick="showImage(this.src)"
|
||||
|
||||
content = re.sub(
|
||||
r'data-bs-toggle="modal"\s+data-bs-target="#imageModal"\s*onclick="showImage\([^"]+\)"',
|
||||
r'onclick="openGallery([this.querySelector(\'img\') ? this.querySelector(\'img\').src : this.src || \'\'], 0)"',
|
||||
content
|
||||
)
|
||||
|
||||
# Catch any remaining data-bs-toggle
|
||||
content = re.sub(
|
||||
r'data-bs-toggle="modal"\s+data-bs-target="#imageModal"',
|
||||
r'',
|
||||
content
|
||||
)
|
||||
|
||||
# Catch any remaining showImage(...)
|
||||
content = re.sub(
|
||||
r'onclick="showImage\([^"]+\)"',
|
||||
r'onclick="openGallery([this.querySelector(\'img\') ? this.querySelector(\'img\').src : this.src || \'\'], 0)"',
|
||||
content
|
||||
)
|
||||
|
||||
# Remove the old function showImage(src) { ... }
|
||||
content = re.sub(
|
||||
r'function showImage\(src\) \{\s*document\.getElementById\(\'modalImage\'\)\.src = src;\s*\}',
|
||||
r'',
|
||||
content
|
||||
)
|
||||
|
||||
with open(filepath, 'w') as f:
|
||||
f.write(content)
|
||||
|
||||
print(f"Fixed {filepath}")
|
||||
Reference in New Issue
Block a user