1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-09-09 01:09:54 +00:00

fixes and dynamic prompts

This commit is contained in:
Laura
2025-08-18 04:46:17 +02:00
parent e0fdaa6cdf
commit b28c1987b0
14 changed files with 165 additions and 42 deletions

View File

@@ -54,6 +54,18 @@ function make(tag, ...classes) {
return el;
}
function fillSelect($select, options, callback) {
$select.innerHTML = "";
for (const option of options) {
const el = document.createElement("option");
callback(el, option);
$select.appendChild(el);
}
}
function escapeHtml(text) {
return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
}