Hello,
I’ve recently discovered TiddlyWiki and it’s excellent. I’ve always wanted notes that are somewhat interactive-automatic reminders based on the data I put in, managing tasks right inside notes etc.-and TW seems to be wonderful for that sort of thing.
to that effect, though, I needed some custom functionality. I’d like to have timers, where I’d get an audio indication when the timer is done. After reading around for a while, making a custom action widget seems my best bet-I’d like to use webaudio, and from what I know JS macros don’t allow me access to the DOM.
What I want to know is…is there a way to have persistent data inside widgets, such that an expensive computation only takes place once, perhaps when the wiki starts? right now I’m planning to store sound files as base64-encoded data, either inside the widget directly or as a tiddler (somewhat ugly, to be sure, but it seems like the most portable solution) and decoding this data into an audio buffer would take non-negligible time. I would prefer not having to create an audio buffer each refresh cycle.
More fundamentally…my question is-do widgets get recreated every refresh cycle? or do they only get created once, perhaps when wikification happens, and then they just have refresh called on them?
(Maybe a startup plugin would work well for this, too. I’m not quite sure-I’ve read quite too much in the past few days, without having enough actual experience to turn all my knowledge into a working product.)
Thanks,
Dhruv