From e3f18117dfc919677a9968984306d070aa3bef9b Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Mon, 7 May 2018 12:39:57 +0100 Subject: [Wiki] Fix an editor dumb: `not not` --- pysite/views/wiki/edit.py | 2 +- templates/wiki/page_edit.html | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pysite/views/wiki/edit.py b/pysite/views/wiki/edit.py index bb39ed2b..f5c8fd6a 100644 --- a/pysite/views/wiki/edit.py +++ b/pysite/views/wiki/edit.py @@ -61,7 +61,7 @@ class EditView(RouteView, DBMixin): rst = request.form.get("rst") title = request.form["title"] - if not rst or not not rst.strip(): + if not rst or not rst.strip(): raise BadRequest() if not title or not title.strip(): diff --git a/templates/wiki/page_edit.html b/templates/wiki/page_edit.html index 138292f9..34b59dca 100644 --- a/templates/wiki/page_edit.html +++ b/templates/wiki/page_edit.html @@ -37,7 +37,7 @@ let csrf_token = "{{ csrf_token() }}"; - function do_preview() { + function do_preview(_) { let oReq = new XMLHttpRequest(); oReq.addEventListener("load", function() { @@ -90,6 +90,7 @@ editor.setShowPrintMargin(false); editor.on("input", function() { + document.getElementById("submit").disabled = true; document.getElementById("rst").value = editor.getValue(); if (timer !== undefined) { @@ -113,7 +114,7 @@ timer = setTimeout(do_preview, 1000); }; - function refreshLock(){ + function refreshLock() { console.log("Refreshing lock"); let xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { -- cgit v1.2.3