This commit is contained in:
lda committed 2025-12-19 01:24:23 +07:00
1 parent a05e4d2804
commit c5ba6860f8
4 files changed
+30 -15

No files matched your search

+15 -10
View File
@@ -29,10 +29,11 @@ queue_items %}
{% for item in queue_items %}
<li>
<a href="{{ item }}" target="_blank" rel="noreferrer noopener">
{{ item }} {% if not loop.index > qr_limit %}
<div class="qrcode"></div>
{% endif %}
{{ item }}
</a>
{% if not loop.index > qr_limit %}
<div class="qrcode"></div>
{% endif %}
</li>
{% endfor %}
</ol>
@@ -40,13 +41,17 @@ queue_items %}
<script>
window.addEventListener("load", (_) => {
document.querySelectorAll(".qrcode").forEach((e) => {
const a = e.parentElement.textContent.trim();
new QRCode(e, {
text: a,
correctLevel: QRCode.CorrectLevel.L,
width: 256,
height: 256,
});
// Find the sibling <a> tag within the same <li>
const link = e.parentElement.querySelector("a");
const a = link ? link.textContent.trim() : "";
if (a) {
new QRCode(e, {
text: a,
correctLevel: QRCode.CorrectLevel.L,
width: 256,
height: 256,
});
}
});
});
</script>