17th
Trying to use the YUI WYSIWYG RTE as a code editor
Our CityGates app uses the YUI WYSIWYG Rich Text Editor to for all large text areas. Unfortunately, it does not have code / source editing support out of the box. To implement it, you must use some custom code to toggle the textarea / WYSIWYG visibility.
The example from YUI does not use handleSubmit. This means that when a user submits the form from the WYSIWYG editor the textarea does not get updated with the modified information from the iframe when the form is submitted. The user must toggle to the code view to trigger the update to the textarea. Result: a broken WYSIWYG editor.
The obvious solution: set handleSubmit to “true”. But this causes the converse bad behavior to kick in: When submitting from the code view, the textarea is updated with outdated information from the iframe before the form is submitted. The user must toggle to the WYSIWYG view to update the WYSIWYG. Result: a broken code editor.
This is what we had setup, and our users were starting to notice.
So a couple of weeks ago I spent some time trying to figure out what was going on, and figured out a crude way to toggle between the handleSubmit behaviors when the user toggles between the views. It isn’t very pretty, but it works.
I’m looking forward to when this gets integrated into the final RTE.
Side Note on Our Choice of Editor
We chose to use the YUI RTE because of it’s ability to integrate into any backend system and support image upload and inserting. We love using TinyMCE and their slick uploader on PHP projects, but CityGates is Ruby on Rails.