Sha256: 31c4082cc9df68a97de862893177b5464e8fc9b1d4cd46fe127b13d2246ad8ef
Contents?: true
Size: 824 Bytes
Versions: 13
Compression:
Stored size: 824 Bytes
Contents
// Choose a Block User Message template, get it by AJAX and add the Template in the justification textarea document.addEventListener("DOMContentLoaded", () => { const blockTemplateChooser = document.getElementById("block_template_chooser"); if (blockTemplateChooser) { blockTemplateChooser.addEventListener("change", () => { const dropdown = document.getElementById("block_template_chooser"); const url = dropdown.getAttribute("data-url"); const templateId = dropdown.value; if (templateId === "") { return; } fetch(`${new URL(url).pathname}?${new URLSearchParams({ id: templateId })}`). then((response) => response.json()). then((data) => { document.getElementById("block_user_justification").value = data.template; }) }); } });
Version data entries
13 entries across 13 versions & 1 rubygems