aboutsummaryrefslogtreecommitdiff
path: root/doc/ref/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ref/javascript')
-rw-r--r--doc/ref/javascript/components/tab_group_element.texi4
-rw-r--r--doc/ref/javascript/components/vevent_description.texi6
-rw-r--r--doc/ref/javascript/formatters.texi16
-rw-r--r--doc/ref/javascript/lib.texi33
-rw-r--r--doc/ref/javascript/types.texi5
-rw-r--r--doc/ref/javascript/user-additions.texi18
-rw-r--r--doc/ref/javascript/vevent.texi1
7 files changed, 65 insertions, 18 deletions
diff --git a/doc/ref/javascript/components/tab_group_element.texi b/doc/ref/javascript/components/tab_group_element.texi
index 7d9ca412..67f3a359 100644
--- a/doc/ref/javascript/components/tab_group_element.texi
+++ b/doc/ref/javascript/components/tab_group_element.texi
@@ -13,14 +13,14 @@ Each tab consists of two parts, a label which is used for selecting
it, and a tab-element, which contains the actual content. These two
should refer to each other as follows:
-@verbatim
+@example
+---------------+ +----------------+
| TabLabel | | Tab |
+---------------+ +----------------+
| id |<----| aria-labeledby |
| aria-controls |---->| id |
+---------------+ +----------------+
-@end verbatim
+@end example
Further information about tabs in HTML can be found here:
@url{https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Tab_Role}
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..16a988c4
--- /dev/null
+++ b/doc/ref/javascript/formatters.texi
@@ -0,0 +1,16 @@
+@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
+
+@deftypevr {Window Value} {Map<string, (e:HTMLElement, s:string) => void>} formatters
+Same object as @xref{formatters-proc}. Provided for @xref{user-additions.js}.
+@end deftypevr
diff --git a/doc/ref/javascript/lib.texi b/doc/ref/javascript/lib.texi
index e5b13383..a3fb0697 100644
--- a/doc/ref/javascript/lib.texi
+++ b/doc/ref/javascript/lib.texi
@@ -116,22 +116,29 @@ This means that the @var{utc} field is @code{false}, and that
Formats a Date object according to the format specification @var{str}.
Keeping with Guile each format specifier starts with a ~.
-@c table formatting borrowed from Gulie Reference (SRFI-19 Date to string)
-@multitable {MMMM} {MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM}
-@item @nicode{~~} @tab literal ~
+@table @samp
+@item ~~
+literal ~
@c Almost all fields are left padded. How do I signify this
@c with a single footnote?
-@item @nicode{~Y} @tab year, left-padding with zeroes.
-@item @nicode{~m} @tab month number, left padded with zeroes.
-@item @nicode{~d} @tab day of month.
-@item @nicode{~H} @tab hour
-@item @nicode{~M} @tab minute
-@item @nicode{~S} @tab second
-@item @nicode{~Z} @tab 'Z' if Date is UTC, otherwise nothing
-
-@item @nicode{~L} @tab Converts the date to local time
+@item ~Y
+year, left-padding with zeroes.
+@item ~m
+month number, left padded with zeroes.
+@item ~d
+day of month.
+@item ~H
+hour
+@item ~M
+minute
+@item ~S
+second
+@item ~Z
+'Z' if Date is UTC, otherwise nothing
+@item ~L
+Converts the date to local time
(@pxref{to_local}) (doesn't modify source object). Outputs nothing
-@end multitable
+@end table
@end defmethod
@defun format_date date str
diff --git a/doc/ref/javascript/types.texi b/doc/ref/javascript/types.texi
index b9e6dbbf..6f518f53 100644
--- a/doc/ref/javascript/types.texi
+++ b/doc/ref/javascript/types.texi
@@ -57,9 +57,8 @@ Alias of @code{'string'}.
Alias for a record consisting of
@itemize @bullet
@item the name of the type, as a string
-@item All parameters of the object, as a @code{Record<string, any}@
- @footnote{Which is simply a regular javascript object, mapping
- strings to anything}.
+@item All parameters of the object, as a @code{Record<string, any>}
+@footnote{Which is simply a regular javascript object, mapping strings to anything}.
@item An @code{ical_type} value, noting the type of the final field(s)
@item And one or more values of the type specified by the third field.
@end itemize
diff --git a/doc/ref/javascript/user-additions.texi b/doc/ref/javascript/user-additions.texi
new file mode 100644
index 00000000..706b1dd4
--- /dev/null
+++ b/doc/ref/javascript/user-additions.texi
@@ -0,0 +1,18 @@
+@node user-additions.js
+@section user-additions.js
+
+Some things in the JavaScript code is built to be user-extendable.
+The HTML-page attempts to load @code{/static/user/user-additions.js}.
+
+
+Currently; this only entails @ref{formatters}, where you could, for
+example, parse all HTTP-links in a description.
+
+@example
+window.formatters.set('description', (el, d) => @{
+ el.innerHTML = d.replaceAll(/https?:\/\/\S+/g, '<a href="$&">$&</a>');
+@})
+@end example
+
+Remember that the documents are X-HTML, so be @emph{extremely} careful
+with innerHTML.
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