aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-01-13 01:26:06 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-01-13 22:49:05 +0100
commite968ccd55b59a36d6f29eaa2beeee9ec8e3fdb7f (patch)
tree2945a708d7dd31adf24652c9d28a4362852649ae /doc
parentAdd subsection "Components". (diff)
downloadcalp-e968ccd55b59a36d6f29eaa2beeee9ec8e3fdb7f.tar.gz
calp-e968ccd55b59a36d6f29eaa2beeee9ec8e3fdb7f.tar.xz
Wrote binders.texi.
Diffstat (limited to 'doc')
-rw-r--r--doc/ref/javascript/binders.texi43
-rw-r--r--doc/ref/javascript/script.texi2
2 files changed, 45 insertions, 0 deletions
diff --git a/doc/ref/javascript/binders.texi b/doc/ref/javascript/binders.texi
index d3cd8802..2b64b230 100644
--- a/doc/ref/javascript/binders.texi
+++ b/doc/ref/javascript/binders.texi
@@ -2,3 +2,46 @@
@node binders
@subsection binders.js
+The bind system allows HTML-elements to specify that they want to be
+updated whenever its corresponding (vcalendar) object changes.
+The bind system is currently set up in
+@code{bind_properties} (@pxref{bind_properties})
+(which at the time of writing is (badly) located in @ref{script}).
+
+All (HTML) components with the class @code{bind} are bound. By default
+the (HTML) attribute @code{data-property} is checked for a property
+name, and @code{object.innerHTML} is set whenever that property field
+changes.
+Alternatively an (HTML) component may specify a specific binder
+through the HTML attribute @code{data-bindby}, which should be the
+name of a JavaScript function taking two arguments, an @TODO{event
+component}
+@footnote{Root ``root'' HTML component of a given calendar event
+(something which @code{get_property} can be called on},
+and the component in question.
+
+@c Also sets up event listeners, which most doesn't do.
+
+Binder functions are generally placed in @file{binders.js}, and
+shouldn't be called manually.
+
+@defun bind_recur el e
+Handles recurrence rules.
+Uses a sub-binder system on components with class containing
+``bind-rr''.
+@end defun
+
+@defun bind_edit el e
+Cases for @code{input} and @code{textarea} elements @TODO{(should also
+handle @code{select}s?)}
+@end defun
+
+@defun bind_view el e
+The same as the default binder????
+@end defun
+
+@defun bind_wholeday el e
+Binder for the wholeday toggle button.
+While CSS would suffice, this sets the disabled flags on the time
+inputs, giving a better user experience.
+@end defun
diff --git a/doc/ref/javascript/script.texi b/doc/ref/javascript/script.texi
index fbb8baa4..a60343e4 100644
--- a/doc/ref/javascript/script.texi
+++ b/doc/ref/javascript/script.texi
@@ -44,6 +44,8 @@ Returns the @emph{value} slot of given field in @var{event}, creating it if need
@end defun
@defun bind_properties el [wide_event=false]
+@anchor{bind_properties}
+@ref{binders}
Properties are icalendar properties.
p['name'] to get and set value (also updates any connected slots)