[Greasemonkey] Rich text editor replacement for textarea

Edward Lee edilee at gmail.com
Tue Apr 26 00:48:35 EDT 2005

On 4/25/05, Edward Lee <edilee at gmail.com> wrote:
>  How do you get default text/styling into the iframe/document

I think I did this more complicated than it had to be... 


Click the page (not the frame) to change the []tags to actual
formatting. Right now you can see it update, but it could probably be
done on load without clicking and either hide the iframe through
display none (not sure if certain range/etc functions will still work)
or visibility hidden or opacity 0.

General idea behind the code is.. find the start tag, find the end
tag, remove them, create a selection using range and getselection,
apply the styling to that selection, deselect.

Or maybe there's a better way to apply a style without having to have
the user select the text or simulating selecting through
range/getselection... ?


More information about the Greasemonkey mailing list