I’ve really stumbled into a huge mess trying to use dhtml rich text editors in a cross browser application. I’m mostly documenting this so that, should some other (cough: idiot) come along, hopefully they’ll see where the limits of these RTEs are in the browser. And partially as a rant.
The problem feature: Be able to Cut from Microsoft Word and Paste into a browser’s RTE and have it apparently “do the right thing”. So, this means OS X, standard flavors of Win32, and Firefox, IE and Safari, running various versions of Microsoft Word. We’d like a bulleted list to appear as a bulleted list.
Each version of Word has a different Paste flavor that it prefers out of the box, and they can be further customized by the user. AARGH! So, we don’t know what we’re getting. I think the browser will take text and html though, so it will accept the two flavors of html that Word can choose to spit out.
So I implemented a paste warning, but again Firefox and IE both support different events on different elements - see this helpful chart. And, finding the YUI RTE’s iframe div was a bit convoluted..
Apparently all dhtml RTEs are thin facades over a built-in browser feature - on Firefox its Midas, the rich text editor component! So although it seems like there are a bunch of different browser based RTEs like FCK, etc. - that is mostly window dressing. I had an early hint of this before I knew about midas when I saw what the YUI editor did with tables, which was incredibly similar to what Writely (now google docs) was doing. However, the YUI editor apparently didn’t support table editing so I thought maybe I’d hit upon a “pre-release” feature..
I’m developing a new kind of hatred for the more mature javascript and dhtml.. Fifteen years later(!) I know things can be more coherent. Even though the browsers have all this cool stuff, we’re still fighting standards battles and having to do everything twice or more times to deal with various differences and brokenness. CSS is a really good step in the direction of not needing to do this to make things *look right*. However, at the end of the day I’m not sure that I’ll accept tweening effects as a payoff for all this pain. The pain/reward ratio seemed better for the multiple body color hack.