- use current techniques, best practice and technology
- be smaller ,lighter
- minimize the differences in output from different browsers
- simplify the toolbar whilst at the same time adding more features
- provide a simple means of extending to add your own controls, or even replace the entire toolbar with your own
Here's what I'm planning:
That in turn means that if you have customised your Whizzywig and used the existing global variables (e.g. sels, cssFile) then you'll have change your code to use the new version.
- The editor will be a contenteditable div, not an iframe. The contenteditable attribute has been in Internet Explorer since Adam was a boy and is in the W3C HTML 5 spec. It is deployed in all modern Class A browsers but won't work in older versions like Firefox 2.
Using contenteditable has 2 major advantages: it allows the code to be simpler and means that the editor will inherit all the CSS styles of the surrounding page. It will be much more likely that What You See IS What You Get. In most cases, you won't need the cssFile setting any more.
- The editor will have a very small and lightweight core: aiming for about half the size of the current Whizzywig version. It won't rely on any other files, not even an image sprite for the toolbar. This will make it very fast and simple to deploy.
- The font controls won't be on the toolbar by default: in the most common use case of creating HTML fragments to embed in a website, the output will conform to the websites styles as per the CSS rules. Font controls (Font size, Font family, color) will be available as an extension.
- There will be new controls to format Paragraphs (replacing the current [Choose style] pulldown) and Characters. The Character pulldown will introduce big, small, subscript, superscript, underline and remove format.
- There will be a new default control to embed HTML or text. This means you can add that YouTube video or widget code without having to resort to Source code view. You can take the Source button off the toolbar for most implementations which will be a lot safer. If you paste in text from Word, it will strip the HTML formatting but preserve the paragraphs. If you paste in a chunk of plain text, it will add paragraph tags appropriately.
- There will be context sensitive buttons for Left [⇐] and Right[⇒].
- If you select an image and click [⇒] it will float the image to the right of the text.
- If you are in a list or blockquote it will indent the current item.
- If you are in a text block it will align it to the right.
- It will provide more control over the output, making it possible to exclude tags, or write your own output generator (e.g. for BBcode or Textile). The default output will be efficient, valid xhtml. "Efficient" means no nested span tags to provide multiple formatting like color, font and italic.
- Extensions will be available for Font selection, Color selection, Tables, Special Characters.
- The editor will keep the textarea in sync after each change - no need to call syncTextarea.
- Independently there will be a new File/Image Manager, with upload.