From a8df6d53a53e34c289154fa0e24226c6d7080f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 13 Jul 2020 01:49:17 +0200 Subject: Minor cleanup. --- module/entry-points/server.scm | 2 ++ module/output/html.scm | 12 ++++++++---- static/script.js | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/module/entry-points/server.scm b/module/entry-points/server.scm index fc832c13..64204b9d 100644 --- a/module/entry-points/server.scm +++ b/module/entry-points/server.scm @@ -70,6 +70,8 @@ (return '((content-type text/html)) (sxml->html-string '(a (@ (href "/today")) "Gå till idag")))) + ;; TODO any exception in this causes the whole page to fail + ;; It would be much better if most of the page could still make it. (GET "/week/:start-date.html" (start-date) (let* ((start-date (start-of-week (parse-iso-date start-date) diff --git a/module/output/html.scm b/module/output/html.scm index e3a247d4..70c14cf3 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -219,9 +219,8 @@ (inner (+ x w) (left-subtree tree)) (inner x (right-subtree tree)))))) -(define* (make-block ev optional: (extra-attributes '())) - - (define popup-id (symbol->string (gensym "popup"))) +(define* (make-block ev optional: (extra-attributes '()) + key: (popup-id (symbol->string (gensym "popup")))) `((a (@ (href "#" ,(html-id ev)) (class "hidelink")) @@ -730,6 +729,11 @@ "idag")) (div (@ (class "jump-to")) + ;; Firefox's accessability complain about each date + ;; component, meaning that it's broken. This label + ;; is for the whole input, which can be enabled + ;; if wanted. + ;; (label (@ (for "date")) "Hoppa till") (form (@ (action "/today")) (input (@ (type hidden) (name "view") @@ -827,7 +831,7 @@ (caddar ; strip tag (make-block (car (children cal)) `((class " generated ") - (style " width: calc(100% * var(--editmode)) "))))))))))) + (style "width:calc(100%*var(--editmode));"))))))))))) diff --git a/static/script.js b/static/script.js index 8a314bb9..c9934f42 100644 --- a/static/script.js +++ b/static/script.js @@ -315,7 +315,6 @@ window.onload = function () { c.onmouseup = create_event_finisher( function (event) { let popupElement = event.querySelector(".popup-container"); - /* TODO ensure input elements */ open_popup(popupElement); popupElement.querySelector("input[name='dtstart']").focus(); @@ -326,6 +325,7 @@ window.onload = function () { for (let nav of document.getElementsByClassName("popup-control")) { nav.onmousedown = function (e) { + /* Ignore mousedown on children */ if (e.target != nav) return; nav.style.cursor = "grabbing"; nav.dataset.grabbed = "true"; -- cgit v1.2.3