Improve paste-to-upload UX with a modal dialog; drop media file preview in My Projects

This commit is contained in:
2026-07-08 14:27:07 +02:00
parent 0ccbef45a1
commit 8ec6e3fd50
7 changed files with 108 additions and 53 deletions
+5 -6
View File
@@ -14,9 +14,12 @@
<div class="mb-3">
<label class="text-white">Logo</label>
<img id="logoPreview" style="display:none;width:64px;height:64px;object-fit:contain;background:#fff;border-radius:6px;padding:4px;" class="mb-2" />
<img id="logoPreview" style="display:none;width:64px;height:64px;object-fit:contain;background:#fff;border-radius:6px;padding:4px;" class="mb-2 d-block" />
<input id="logoFile" type="file" name="logoFile" class="form-control bg-dark text-white" accept="image/*" />
<small class="text-muted">PNG, JPG, WEBP or GIF. You can also paste (Ctrl+V) an image directly.</small>
<button type="button" class="btn btn-outline-light btn-sm mt-2" onclick="PasteImageModal.open('#logoFile', '#logoPreview')">
<i class="fa-solid fa-paste me-1"></i>Paste image
</button>
<small class="text-muted d-block mt-1">PNG, JPG, WEBP or GIF.</small>
</div>
<div class="mb-3">
@@ -54,7 +57,3 @@
<button class="btn btn-success">Save</button>
}
<script>
enablePasteUpload('#logoFile', '#logoPreview');
</script>