macro
This commit is contained in:
1 parent
d73f01c5f5
commit
f2559bc63e
3 files changed
+71
-42
No files matched your search
+14
-22
@@ -17,30 +17,22 @@
|
||||
></textarea>
|
||||
<input type="submit" value="ahh" />
|
||||
</form>
|
||||
|
||||
{% if queue_items %}
|
||||
<ol>
|
||||
{% for item in queue_items %}
|
||||
<li>
|
||||
<a href="{{ item }}" target="_blank" rel="noreferrer noopener">
|
||||
{{ item }}
|
||||
<div class="qrcode"></div>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/qrcode.js"></script>
|
||||
<script>
|
||||
window.addEventListener("load", (_) => {
|
||||
document.querySelectorAll(".qrcode").forEach((e) => {
|
||||
const a = e.parentElement.textContent.trim();
|
||||
new QRCode(e, {
|
||||
text: a,
|
||||
correctLevel: QRCode.CorrectLevel.L,
|
||||
});
|
||||
});
|
||||
/**@type {HTMLTextAreaElement} */
|
||||
(
|
||||
// lifted from google search ai
|
||||
document.getElementById("l")
|
||||
).addEventListener("keydown", function (e) {
|
||||
// Check for Ctrl+Enter (Windows/Linux) or Command+Enter (Mac)
|
||||
if ((e.ctrlKey || e.metaKey) && e.key === "Enter") {
|
||||
e.preventDefault(); // Prevent the default newline character
|
||||
// Submit the form associated with this textarea
|
||||
this.form.submit();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
{% from "macros.html" import qrcode_queue %} {% if queue_items %}
|
||||
<p>total: {{ queue_items|length }}</p>
|
||||
{% endif %} {{ qrcode_queue(queue_items) }}
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user