From 2d35caa4b3e025a57c626f89c665da31ffbfe27d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 15 Mar 2022 01:14:45 +0100 Subject: Introduce concept of VEvent formatters in frontend. --- doc/ref/javascript/components/vevent_description.texi | 6 ++++++ doc/ref/javascript/formatters.texi | 12 ++++++++++++ doc/ref/javascript/vevent.texi | 1 + 3 files changed, 19 insertions(+) create mode 100644 doc/ref/javascript/formatters.texi (limited to 'doc/ref/javascript') 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 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 -- cgit v1.2.3