diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-01-13 22:50:51 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-01-13 22:50:51 +0100 |
commit | 641278c624a3a0c06856656255f648f2cf4f6a92 (patch) | |
tree | 49c47c4c61dd0704e89cfd75681bc16f171e7ad5 /doc/ref/javascript/binders.texi | |
parent | Add debug buttons in popup for dumping xcal and jcal. (diff) | |
parent | Document (vcompenent control). (diff) | |
download | calp-641278c624a3a0c06856656255f648f2cf4f6a92.tar.gz calp-641278c624a3a0c06856656255f648f2cf4f6a92.tar.xz |
Merge branch 'doc' into jcal
Diffstat (limited to '')
-rw-r--r-- | doc/ref/javascript/binders.texi | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/ref/javascript/binders.texi b/doc/ref/javascript/binders.texi new file mode 100644 index 00000000..2b64b230 --- /dev/null +++ b/doc/ref/javascript/binders.texi @@ -0,0 +1,47 @@ + +@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 |