aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-03-15 01:14:45 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-03-15 01:43:12 +0100
commit2d35caa4b3e025a57c626f89c665da31ffbfe27d (patch)
treef22ad2d5c07626f116ca7c3a8762fd2fe68d6855 /doc
parentMake make-routes pre-compile all regexes. (diff)
downloadcalp-2d35caa4b3e025a57c626f89c665da31ffbfe27d.tar.gz
calp-2d35caa4b3e025a57c626f89c665da31ffbfe27d.tar.xz
Introduce concept of VEvent formatters in frontend.
Diffstat (limited to 'doc')
-rw-r--r--doc/ref/javascript.texi1
-rw-r--r--doc/ref/javascript/components/vevent_description.texi6
-rw-r--r--doc/ref/javascript/formatters.texi12
-rw-r--r--doc/ref/javascript/vevent.texi1
4 files changed, 20 insertions, 0 deletions
diff --git a/doc/ref/javascript.texi b/doc/ref/javascript.texi
index 7510e4f5..434b556f 100644
--- a/doc/ref/javascript.texi
+++ b/doc/ref/javascript.texi
@@ -17,6 +17,7 @@ All elements are initialized in elements.ts
@include javascript/vevent.texi
@include javascript/globals.texi
@include javascript/server_connect.texi
+@include javascript/formatters.texi
@node General Components
@section General Components
diff --git a/doc/ref/javascript/components/vevent_description.texi b/doc/ref/javascript/components/vevent_description.texi
index 492c8dff..54dda7e3 100644
--- a/doc/ref/javascript/components/vevent_description.texi
+++ b/doc/ref/javascript/components/vevent_description.texi
@@ -7,4 +7,10 @@
A text representation of a VEvent. Used as the summary tab of our
popup windows, and in the sidebar.
+
+When redrawn, it looks for an HTML-tag inside its template having the
+attribute @code{data-property} matching the properties name. If one is
+found, it looks in the @code{formatters} table
+(@ref{formatters-proc}), for a field matching the property value, and
+defaults to the key @code{default}.
@end deftp
diff --git a/doc/ref/javascript/formatters.texi b/doc/ref/javascript/formatters.texi
new file mode 100644
index 00000000..65df48c4
--- /dev/null
+++ b/doc/ref/javascript/formatters.texi
@@ -0,0 +1,12 @@
+@node formatters
+@subsection formatters
+
+Formatting procedures used by some components.
+@c TODO can we have a backref of every node containing @ref{formatters-proc}?
+
+@deftypevar {Map<string, (e:HTMLElement, s:any) => void>} formatters
+@anchor{formatters-proc}
+
+Each procedure takes two arguments. The HTML-element which contents
+should be replaced, along with the target value, as returned by @ref{VEvent.getProperty}.
+@end deftypevar
diff --git a/doc/ref/javascript/vevent.texi b/doc/ref/javascript/vevent.texi
index ae54cfd4..4ceaa380 100644
--- a/doc/ref/javascript/vevent.texi
+++ b/doc/ref/javascript/vevent.texi
@@ -31,6 +31,7 @@ through @code{calendar}). Almost all changes through these interfaces
are logged, and can be viewed in @var{_changelog}.
@deftypemethod VEvent {any?} getProperty {key: string}
+@anchor{VEvent.getProperty}
Returns the value of the given property if set, or undefined otherwise.
For the keys