PageSourceSearch

https://basilform.com/assets/js/confirm-submit.js?v=208e0eeb77

js basilform.com collected 2026-09-30 11:12:54 UTC 1,492 bytes, 54 lines download raw bytes

1(function () {
2  if (window.__basilformConfirmSubmitBound) return;
3  window.__basilformConfirmSubmitBound = true;
4
5  function getConfirmMessage(target) {
6    if (!(target instanceof Element)) return null;
7
8    var confirmElement = target.matches("[data-confirm]")
9      ? target
10      : target.closest("[data-confirm]");
11
12    return confirmElement ? confirmElement.getAttribute("data-confirm") : null;
13  }
14
15  document.addEventListener("htmx:confirm", function (event) {
16    var detail = event.detail;
17    var target = detail && detail.elt ? detail.elt : event.target;
18    var message = getConfirmMessage(target);
19
20    if (!message || !detail || !detail.issueRequest) return;
21
22    event.preventDefault();
23
24    window.basilformDialog.confirm(message).then(function (confirmed) {
25      if (confirmed) detail.issueRequest(true);
26    });
27  });
28
29  document.addEventListener(
30    "submit",
31    function (event) {
32      var form = event.target;
33
34      if (window.htmx || !(form instanceof HTMLFormElement)) return;
35
36      var message = getConfirmMessage(form);
37      if (!message) return;
38      if (form.__basilformConfirmBypass) {
39        delete form.__basilformConfirmBypass;
40        return;
41      }
42
43      event.preventDefault();
44      event.stopImmediatePropagation();
45      window.basilformDialog.confirm(message).then(function (confirmed) {
46        if (confirmed) {
47          form.__basilformConfirmBypass = true;
48          form.requestSubmit();
49        }
50      });
51    },
52    true,
53  );
54})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.