Tiny WYSIWYG / Rich text editor (Less than 5KB gzipped, 1 file including images)
- Basic WYSIWYG editing functions
- HTML edit mode
- Easy to use
- Free to modify and distribute however you see fit
- Tested on (so far) PC in Chrome 44, Firefox 40, Microsoft Edge, Internet Explorer 9 (emu), 10 (emu) and 11
- Less than 5KB gzipped, non minified, including graphics (all in just one JS file)
- No external dependencies
Sample
How to use
Download and include
WYSIWYG.js
Create an element, preferably a div, with an id, in this case "editor".
Add some script:
var editor = WYSIWYG.Create({ id: 'a_unique_id', head: 'styles and what not, for the created iframe', contents: 'body content', div: WYSIWYG.E("editor"), width: 700, height: 300 });
And when you need the content from the editor, just call editor.GetHTML();
You can select which buttons, and in what order, by assigning an array of button ids to "buttons" when calling WYSIWYG.Create(), for ids etc, check the source.
When you are done, just call editor.Destroy();
Why?
I wanted a small, simple rich text editor to play with, that worked in the current crop of browsers. Smallest I could find was around 40KB, with a large number of referenced images and a couple of style sheets, I needed something smaller.
© Anders Hammervald, 2024