I have a JavaScript macro, GenChartFamilyTreeData, that generates a chart/report in HTML based on a few parameters. I want a tiddler that will contain a button to trigger this macro to generate the HTML content, providing an export/download for the user of the resulting HTML file.
Currently, I have a button that copies the HTML content to the clipboard, where I wikify the output of the content from GenChartFamilyTreeData macro for use in the button… something like this:
\define copyfamilytreebutton(proband, folderdepth, direction, theme)
<$wikify name=charting text=<<GenChartFamilyTreeData """$proband$""">> type="text" output=text >
<$button message="tm-copy-to-clipboard" param=<<charting>>>{{$:/core/images/copy-clipboard}} Copy HTML for family chart of $proband$ to clipboard</$button></$wikify>
\end
There are two disadvantages to the current mechanism. 1. Extra work for the user to save the HTML file, and 2. When the tiddler is open or other tiddlers change GenChartFamilyTree runs, which takes a couple of seconds. I only want it to run when the user clicks the button.
So, I want to change my copy to clipboard button to an export button.
Thanks for any help,
Craig