aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-13 01:49:17 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-13 01:49:17 +0200
commita8df6d53a53e34c289154fa0e24226c6d7080f18 (patch)
treec61a7e4d432a5f5e45cad03c7e75f7ab57b2ecee
parentFix popup movement. (diff)
downloadcalp-a8df6d53a53e34c289154fa0e24226c6d7080f18.tar.gz
calp-a8df6d53a53e34c289154fa0e24226c6d7080f18.tar.xz
Minor cleanup.
-rw-r--r--module/entry-points/server.scm2
-rw-r--r--module/output/html.scm12
-rw-r--r--static/script.js2
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 <a> 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";