Fix HTMX expired-session handling, CSP-blocked form behaviors, reorder recovery, billing currency display, plan/checkout guards, FedWiki quota edge cases, and operator/member empty/error states. Add entitlement uniqueness migrations, canonical migration source wiring, and regression coverage for the remediated flows. Update status docs with the audit triage and model inventory.
20 lines
799 B
JavaScript
20 lines
799 B
JavaScript
// Workspace create form: auto-generate a URL-safe slug from the workspace
|
|
// name as the member types. CSP forbids inline oninput handlers, so this
|
|
// listens via delegation on document — the create form is loaded into the
|
|
// DOM via HTMX, and a document-level listener survives swaps without
|
|
// needing to be re-bound after every fragment load.
|
|
(function () {
|
|
document.addEventListener("input", function (evt) {
|
|
var nameInput = evt.target.closest(".js-workspace-name");
|
|
if (!nameInput) return;
|
|
var form = nameInput.closest("form");
|
|
if (!form) return;
|
|
var slugInput = form.querySelector(".js-workspace-slug");
|
|
if (!slugInput) return;
|
|
slugInput.value = nameInput.value
|
|
.toLowerCase()
|
|
.replace(/[^a-z0-9]+/g, "-")
|
|
.replace(/^-|-$/g, "");
|
|
});
|
|
})();
|