Hi Andrew!
Didn't know that YUI had something similar built-in, though not quite sure how that works. The biggest advantage to my solution is that there are no inline JS, no script tags or anything - just a linked in JavaScript that Makes Stuff Work(tm). But then again, I'm a very huge fan of using JS where needed by assigning HTML classes. Need a date picker? <input type="text" class="date"/>. Need a required field? <input type="text" class="required"/>. Required AND date picker? class="required date" solves that. I find having a bunch of behavior defined by classes is not only convenient, it's easier to both develop for and create. But as always, YMMV.
That said, the main problem here, is, really, a classic AJAX problem. If you load some page content through AJAX, and you wish to apply some extra, nonstandard behaviour like TinyMCE, you need some way of telling the page to convert that specific textarea box to TinyMCE or whatever else you like. This can be done in two ways:
1. Embedded scripts in the content you load
2. By defining behaviour through classes and/or ids and then initialise this behaviour on page load
I like to do 2 whenever possible, since embedded scripts often tend to get unwieldy and cumbersome. But embedded scripts are great if you just want one specific behavior for one specific place, so it's a question of using the right tool at the right place.
So, what I need, basicly:
1. Click link, page content loads with AJAX2. Page content contains one or more "extra" (non-HTML) behaviours
3. Page content loads
4. ???
5. Page is fully operational
Where ??? Should be some sort of initialisation script that doesn't include everything under the sun, but instead a few lines using the already-included libraries to initialise a new instance. It'd be great if there were standard scripts in Moodle that could initialise these sort of things on a per-need basis (and perhaps with class based behaviour), but it's not a big deal if there isn't, as long as the hooks are there - which they seem to be.
Anyway, sorry for rambling, I hope I've made my point clearer. If not, well back to the workshop :D