Forum OpenACS Development: ad_form widget for textareas
- Enhanced text.
- WYSIWYG (if the browser is capable of doing this). Look at http://www.kevinroth.com/rte/demo.htm to know what I mean.
This should be an option in general for textareas, so all packages can make use of it without the need for further development. Furthermore, switching from WYSIWYG would take away the controls, but keep the generated HTML still in the textarea. Don't ask me how this is going to work, but this is my idea (I have a dream.... :)).
Does this make sense to you? Would you go and try to make one widget for all packages or would you split it up like it is done at the moment with Forums?
We are most likely willing to put some effort into it for Forums/Blogger/ETP, but I'd like to generate a solution that is appealing to the community at large. Well, and for sure get some feedback from people that have already done something like this.
It works nicely with ad_form. It is a multiple property widget that has the HTML content, mime-type and escaped html content.
This does most of what you want. I am not sure if it includes buttons to add bold, etc. Doesn't seem to work on Mozilla anyway :) Maybe on IE.
It's called 'richtext', and is very simple. Take a look at /acs-templating/tcl/richtext-procs.tcl.
It offers buttons for B, I, and links on IE. That's it.
Would be awesome to make it do WYSIWYG on IE and Mozilla, but that's going to be significantly harder.
And yes, all it really does is add the buttons, and do the line break, paragraph break, link, and email translation which the regular text-to-html conversion already does.
So it's like the normal text-formatting, but also allowing you to use HTML tags.
Most require IE 5.5 or greater but some like
are starting to support Mozilla on all platforms. I was planning on adding one of these to ETP for a project I might have to do soon and it seems straightforward to me but that's just from a cursory glance at the code.
If that could be added as a easy-to-use formbuilder widget, that would be absolutely awesome. Go! :)
The one I picked, htmlArea, uses a BSD licence and is for IE5.5 only but has an alpha version for Mozilla 1.3 which I didn't look at. I'm sure all the others including Malte's suggestion are similar.
To put this into ETP I did the following:
etp-master.tcladd the following
etp-master.adpadd the following line (I added it just after
etp-edit.tclchange the line:
to look like this:set widget "<textarea name=\"$attribute\" $html>[ad_quotehtml $value]</textarea>\n"
I'm not 100% about some of the templating stuff so it may not be the best way to modify pages
That's it. To see it working with IE5.5 or greater go to: http://lin.alatto.com:8086/news-test and login as email@example.com with a password of test
I think some of the other controls are better and some worse (e.g. in how they handle tables or images) but I think they're all pretty easy to integrate so it's a case of deciding on what one is the best.
set widget "<textarea name=\"$attribute\" $html>[ad_quotehtml $value]</textarea>\n"
anyone could update the modification to etp-edit.tcl in order to call htmlArea?
I have it running on a test server you can check out:
My favourite, with tables and context menu, but no spelling or full page supprt:
1/ it has crashed my mozilla once so far - but then my mozilla does crash from time to time...
2/ the spell checker uses a perl cgi. since it's not in a /cgi-bin/ or similar segregated directory, i couldn't figure out how to get aolserver to run it. wouldn't be hard to make the it link in from there though.