see
http://www.TiddlyTools.com/#InlineJavascriptPlugin
Usage:
<script label="..." title="..." key="...">
...
any javascript you want
...
</script>
Note that this syntax is not a *macro*... it is an extension to the
TWCore "formatters" that allows you to specify a label, along with
optional tooltip ("title") and accelerator key (e.g. CTRL-SHIFT-X)
definitions and then use ANY script code you want in between the
<script> and </script> markers, including use of multiple lines with
the code block, as well as embeddeding both single- and double-quotes
within the code syntax, and even using ">>" (the 'end-of-macro'
sequence) without problems.
You can have the script generate and insert output into the current
tiddler, simply by constructing a text string with the desired output
and then returning it as the last action of the script:
<script label="show time">
var t="The time is now: "+new Date().formatString("0hh:0mm:0ss");
return t;
</script>
In addition, when processing the script code, all calls to
document.write() are automatically converted and their output buffered
in order to prevent them from corrupting the running TW document
content. The buffered output is then processed for wiki-syntax
formatting and displayed immediately following the embedded script.
The plugin also gives you access to the current 'place' (the DOM
element container where output is being placed), so that you can also
write your own custom code to generate and insert DOM elements
directly into the tiddler output.
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
"Small Tools for Big Ideas!"(tm)
--------------------------------
TiddlyTools needs your ongoing financial support to pay the bills:
http://www.TiddlyTools.com/#Donations
Please contribute as generously and as often as you can.
--------------------------------