diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-03-15 01:36:07 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-03-15 02:25:27 +0100 |
commit | bb7b8ee00bd2c7d26e82c2eb4a0571023e821d9f (patch) | |
tree | b142e1dc98835237d679ab83029f5c1371453113 /doc/ref/javascript/user-additions.texi | |
parent | Introduce concept of VEvent formatters in frontend. (diff) | |
download | calp-bb7b8ee00bd2c7d26e82c2eb4a0571023e821d9f.tar.gz calp-bb7b8ee00bd2c7d26e82c2eb4a0571023e821d9f.tar.xz |
Introduce user-additions in frontend.
Along with an initial example of their use.
Diffstat (limited to 'doc/ref/javascript/user-additions.texi')
-rw-r--r-- | doc/ref/javascript/user-additions.texi | 18 |
1 files changed, 18 insertions, 0 deletions
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. |