|
5 | 5 | @param Attachment attachment
|
6 | 6 | @param Message message
|
7 | 7 | @param boolean nsfw
|
| 8 | +@param int galleryIndex = 0 |
8 | 9 |
|
9 | 10 | <%--'data-type="video"' must be properly set, otherwise, some videos will download instead of opening the lightbox --%>
|
10 | 11 |
|
11 | 12 | @if(attachment.filename().startsWith("SPOILER_"))
|
12 | 13 | <div class="image spoilerImage">
|
13 | 14 | <input id="${attachment.id()}" type="checkbox">
|
14 | 15 | @if(AttachmentFormatUtils.isImage(attachment))
|
15 |
| - <a href="${attachment.url()}" class="glightbox"> |
| 16 | + <a href="${attachment.url()}" class="glightbox" data-gallery="${"gallery"+galleryIndex}"> |
16 | 17 | <img class="image img-fluid rounded-2"
|
17 | 18 | src="${attachment.url()}"
|
18 | 19 | alt="Image ${attachment.filename()} uploaded by ${message.getAuthor().name()}"
|
19 | 20 | loading="lazy">
|
20 | 21 | </a>
|
21 | 22 | @else
|
22 |
| - <a href="${attachment.url()}" class="glightbox" data-type="video"> |
| 23 | + <a href="${attachment.url()}" class="glightbox" data-type="video" data-gallery="${"gallery"+galleryIndex}"> |
23 | 24 | <video class="image img-fluid rounded-2"
|
24 | 25 | src="${attachment.url()}"
|
25 | 26 | preload="metadata"
|
|
34 | 35 | <div class="image spoilerImage">
|
35 | 36 | <input id="${attachment.id()}" type="checkbox">
|
36 | 37 | @if(AttachmentFormatUtils.isImage(attachment))
|
37 |
| - <a href="${attachment.url()}" class="glightbox"> |
| 38 | + <a href="${attachment.url()}" class="glightbox" data-gallery="${"gallery"+galleryIndex}"> |
38 | 39 | <img class="image img-fluid rounded-2"
|
39 | 40 | src="${attachment.url()}"
|
40 | 41 | alt="Image ${attachment.filename()} uploaded by ${message.getAuthor().name()}"
|
41 | 42 | loading="lazy">
|
42 | 43 | </a>
|
43 | 44 | @else
|
44 |
| - <a href="${attachment.url()}" class="glightbox" data-type="video"> |
| 45 | + <a href="${attachment.url()}" class="glightbox" data-type="video" data-gallery="${"gallery"+galleryIndex}"> |
45 | 46 | <video class="image img-fluid rounded-2"
|
46 | 47 | src="${attachment.url()}"
|
47 | 48 | preload="metadata"
|
|
56 | 57 | @else
|
57 | 58 | <div class="image">
|
58 | 59 | @if(AttachmentFormatUtils.isImage(attachment))
|
59 |
| - <a href="${attachment.url()}" class="glightbox"> |
| 60 | + <a href="${attachment.url()}" class="glightbox" data-gallery="${"gallery"+galleryIndex}"> |
60 | 61 | <img class="image img-fluid rounded-2"
|
61 | 62 | src="${attachment.url()}"
|
62 | 63 | alt="Image ${attachment.filename()} uploaded by ${message.getAuthor().name()}"
|
63 | 64 | loading="lazy">
|
64 | 65 | </a>
|
65 | 66 | @else
|
66 |
| - <a href="${attachment.url()}" class="glightbox" data-type="video"> |
| 67 | + <a href="${attachment.url()}" class="glightbox" data-type="video" data-gallery="${"gallery"+galleryIndex}"> |
67 | 68 | <%-- <span>potato</span>--%>
|
68 | 69 | <video class="image img-fluid rounded-2" controls src="${attachment.url()}" preload="metadata"></video>
|
69 | 70 | </a>
|
|
0 commit comments