Admin Panel v6

This commit is contained in:
dingo
2025-12-25 13:11:34 -05:00
parent b2a1735358
commit 30b7d89a70
10 changed files with 1372 additions and 12 deletions
+18 -6
View File
@@ -281,15 +281,25 @@
@section Scripts {
<script>
const cdnBase = '@Model.CdnBaseUrl';
const cdnBase = '@Html.Raw(Model.CdnBaseUrl)';
function updatePreview() {
const path = document.getElementById('spritePath').value;
const img = document.getElementById('spritePreview');
const placeholder = document.getElementById('spritePlaceholder');
if (path) {
img.src = cdnBase + '/' + path;
placeholder.classList.add('hidden');
if (path && path.trim()) {
const fullUrl = cdnBase + '/' + path.trim();
console.log('Loading preview:', fullUrl);
img.onload = function() {
img.classList.remove('hidden');
placeholder.classList.add('hidden');
};
img.onerror = function() {
console.log('Failed to load:', fullUrl);
img.classList.add('hidden');
placeholder.classList.remove('hidden');
};
img.src = fullUrl;
} else {
img.classList.add('hidden');
placeholder.classList.remove('hidden');
@@ -304,7 +314,9 @@
}
// Init
updatePreview();
toggleMaxStack();
document.addEventListener('DOMContentLoaded', function() {
updatePreview();
toggleMaxStack();
});
</script>
}