diff options
author | 2011-09-03 11:48:12 -0400 | |
---|---|---|
committer | 2011-09-03 11:48:12 -0400 | |
commit | 22dca5aaa24df32b6b59b27b62944d28adcad9ca (patch) | |
tree | 7c32d9dad6206562624b1bb483a1c7b8bbdc4fec /doc/manual.tex | |
parent | 9d335a56ec401b63a35f0e42d6fb8b69cb686c90 (diff) |
New client-side, document-level event handlers
Diffstat (limited to 'doc/manual.tex')
-rw-r--r-- | doc/manual.tex | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/manual.tex b/doc/manual.tex index b223e02a..a3800e17 100644 --- a/doc/manual.tex +++ b/doc/manual.tex @@ -1971,6 +1971,18 @@ $$\begin{array}{l} \mt{val} \; \mt{onServerError} : (\mt{string} \to \mt{transaction} \; \mt{unit}) \to \mt{transaction} \; \mt{unit} \end{array}$$ +There are also functions to register standard document-level event handlers. + +$$\begin{array}{l} + \mt{val} \; \mt{onClick} : \mt{transaction} \; \mt{unit} \to \mt{transaction} \; \mt{unit} \\ + \mt{val} \; \mt{onDblclick} : \mt{transaction} \; \mt{unit} \to \mt{transaction} \; \mt{unit} \\ + \mt{val} \; \mt{onKeydown} : (\mt{int} \to \mt{transaction} \; \mt{unit}) \to \mt{transaction} \; \mt{unit} \\ + \mt{val} \; \mt{onKeypress} : (\mt{int} \to \mt{transaction} \; \mt{unit}) \to \mt{transaction} \; \mt{unit} \\ + \mt{val} \; \mt{onKeyup} : (\mt{int} \to \mt{transaction} \; \mt{unit}) \to \mt{transaction} \; \mt{unit} \\ + \mt{val} \; \mt{onMousedown} : \mt{transaction} \; \mt{unit} \to \mt{transaction} \; \mt{unit} \\ + \mt{val} \; \mt{onMouseup} : \mt{transaction} \; \mt{unit} \to \mt{transaction} \; \mt{unit} +\end{array}$$ + \subsubsection{Functional-Reactive Page Generation} Most approaches to ``AJAX''-style coding involve imperative manipulation of the DOM tree representing an HTML document's structure. Ur/Web follows the \emph{functional-reactive} approach instead. Programs may allocate mutable \emph{sources} of arbitrary types, and an HTML page is effectively a pure function over the latest values of the sources. The page is not mutated directly, but rather it changes automatically as the sources are mutated. |