Sunday, April 02, 2006

Nevow + WYSIWYG Editors

nevow :: formal :: javascript

Due to pressing needs of a couple projects, I finally sat down today
and reviewed some of the JavaScript WYSIWYG textarea widgets/HTML
editors. Because of my exposure to Zope and Plone,
Kupu and
were the ones that leapt most readily to mind. A quick google exposed
two others that I had forgotten about:
TinyMCE and

The nice thing about the latter two is the fact that they can more or
less be used with any web-based application. Kupu is striving for that,
but (as far as I can tell) it's still somewhat of a pain integrating
it. Tiny and FCK have options for integration via simple JavaScript
hooks. My preference is for Tiny, given that it loads WAY faster,
provides exactly what I need, has a code base orders of magnitude
smaller (only kidding a little bit), and has a cleaner look.

I'm a pretty big fan of the
library (formerly know as "forms") by Matt Goodall of
I've used it a fair amount when building Nevow apps and the only
limitation I've personally run across involved trying to get it to work
with cred logins (probably *my* limitation). Today, I needed to add
support for WYSIWYG editors, and it was super easy. I wrote up some
examples on the wiki
but it really just boils down to adding the JavaScript hooks in the
HTML "title" (using stan or *TML templates). The image attached to this
blog post is a screenshot of the "formal" example I put together to
demonstrate functionality. For the curious, here is my set of
TinyMCE toolbar customizations.

It really is the little things, though. Users of the Nevow apps where I
will be adding this are now ecstatic. And to be honest, I'm very stoked
too. It's almost as much fun as MochiKit, but that's for another blog

1 comment:

  1. Thanks for adding the wiki page! We've had a few problems with wysiwg htmleditors with some clients (because wys isn't always wyg) and we've been experimenting with using restructured text. If you look in the widgets directory in forms you'll see a rest widget that lets you preview restructured text documents using a little javascript magic (there is an example in the examples folder too). Clients see it as a little wierd at first but once they get used to it they don't have to worry about rendering anymore (although we do still have the odd comment about 'how do I make the text bigger' etc). Hopefully we've got a couple of projects coming up that will let us add fully customisable widget templating soon (in a similar way to Ian Bicking's forms package - although we've not worked on a project yet where the 'out of the box' form html and some css didn't cope).