// The only JavaScript in the members area: "are you sure?" before a form that // destroys something. // // It lives in a file rather than in onsubmit="" attributes because the // Content-Security-Policy set in app.py forbids inline script. An inline // handler under that policy is not an error anyone sees — the browser simply // ignores it, the dialog never appears, and the delete button quietly loses its // guard. One listener on the document covers every form, including ones added // to templates later. document.addEventListener("submit", function (event) { var message = event.target.getAttribute("data-confirm"); if (message && !window.confirm(message)) { event.preventDefault(); } }); // --- the writing boxes ---------------------------------------------------- // // The box shows the formatting as it is typed: bold is bold, a heading is a // heading. There is no preview pane — a second box beside the first is the // wrong shape on a phone — and nothing is sent anywhere while anybody writes. // // What is stored is still markdown, which is what keeps everything downstream // as it is: the file committed to git, the pipeline that translates it, Decap, // and above all `render.to_html` with raw HTML disabled, which is the whole of // the XSS defence. The server receives markdown and renders it itself; nothing // the browser sends is ever treated as HTML. // // The two directions are deliberately not symmetrical: // // opening something to edit — the *server* renders the stored markdown into // a