🐛 — update gallery, zip and random URLs when closing image dialog box

This commit is contained in:
Luc Didry
2023-12-29 07:43:26 +01:00
parent 5d6f715396
commit a76b240ed8
3 changed files with 9 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ Revision history for Lutim
- ⬆️ UUpdate jQuery
- 💥 BREAKING CHANGE: no more twitter cards
- 🎨 — Use template literals in js
- 🐛 — Gallery, zip and random URLs are now updated when closing image dialog box
0.15.0 2023-12-19
- ✨ — Add --nuke option to image command

View File

@@ -49,7 +49,7 @@ function buildMessage(success, msg) {
</a>
</div>` : '';
return `<div class="alert alert-success" id="alert-${msg.real_short}">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<button id="close-${msg.real_short}" type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<div class="row">${thumb}
<div class="col-sm-11">
<h4>
@@ -208,6 +208,12 @@ function bindddz(firstview, deleteday) {
</div>`);
}
$('.messages').append(buildMessage(data.success, data.msg));
$(`#close-${data.msg.real_short}`).on('click', function(e) {
e.preventDefault();
rmFromShortHash(`${data.msg.short}.${data.msg.ext}`);
rmFromZipHash(data.msg.short);
rmFromRandomHash(data.msg.short);
});
$(`#del-${data.msg.real_short}`).on('click', function(e) {
e.preventDefault();
rmFromShortHash(`${data.msg.short}.${data.msg.ext}`);

View File

@@ -8,7 +8,7 @@ function buildMessage(success, msg) {
</a>
</div>` : '';
return `<div class="alert alert-success" id="alert-${msg.real_short}">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<button id="close-${msg.real_short}" type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<div>${thumb}
<div>
<h4>