From 16091fbfa64dca43f442d315a576f42f652d41fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 30 Jul 2020 21:04:36 +0200 Subject: Start embedding more data for css and js in the html doc. --- module/output/html.scm | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'module/output/html.scm') diff --git a/module/output/html.scm b/module/output/html.scm index 4365270c..49a634ee 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -181,11 +181,21 @@ "som iCal")) (li (a (@ (href "/calendar/" ,(prop ev 'UID) ".xcs")) "som xCal")))))) - (when (edit-mode) + ;; Only display sxml when in debug mode. See below for other case + (when (debug) `(("" ,((@ (output xcal) ns-wrap) ((@ (output xcal) vcomponent->sxcal) - ev)))))))))) + ev))))))) + (div (@ (style "display:none !important;")) + ;; NOTE This can be limited to only when edit-mode is enabled but debug + ;; mode is not. That would however require a few more cases for the + ;; javascript to work. + ,(when (and (not (debug)) ; (edit-mode) + ) + ((@ (output xcal) ns-wrap) + ((@ (output xcal) vcomponent->sxcal) + ev))))))) @@ -673,6 +683,16 @@ (meta (@ (name end-time) (content ,(date->string (date+ end-date (date day: 1)) "~s")))) + (script + "EDIT_MODE=true;") + + (style ,(format #f "html { + --editmode: 1.0; + --event-font-size: 8pt; + --gray: #757575; + --btn-height: 0.5ex; +}")) + ,(include-css "/static/style.css") ,(include-alt-css "/static/dark.css" '(title "Dark")) ,(include-alt-css "/static/light.css" '(title "Light")) -- cgit v1.2.3