[Greasemonkey] Rich Text Editor
darktempler at gmail.com
Sun Aug 21 02:53:32 EDT 2005
> ---------- Forwarded message ----------
> From: "WHITEMARE2" <whitemare2 at delphiforums.com>
> To: greasemonkey at mozdev.org
> Date: Sat, 20 Aug 2005 12:13:38 +0000
> Subject: Re: [Greasemonkey] Rich Text Editor
> Your editor looks very nice. Here is a screenshot of mine:
> "why dont you use addEventListener and listen for clicks on each of your
> buttons insted of binding the functions to the window?"
> script by using someone else's, and they were binding the buttons to
> windows. I will see if I can convert those to eventListener's instead.
:D try to because its alot better if you dont depend on the click attribute.
"also i notice you wait untill the load of the window before activating
> design mode , you can just wait till the iframe itself has loaded iframe."
> This is where I was unsure how events were handled. DelphiForums has two
> pages that the editor can be used on, and they have different HTML
> structures. Depending on who is using the editor, they may or may not be
> able to post HTML. So I need to detect whether there is a certain checkbox
> or button on the page before I display the editor, so that I don't display
> it if they can't post HTML. That is why I waited for the onload of the
> window. Is it possible to do that checking before the onload event?
if it has two pages could you use something like below to match the url?
var url = window.location.href;
//run the rich text editor
greasemonkey loads your script when the dom is availible so most likley you
can do those checks beforehand.
also using my editor people cant post html , most forums have it disabled so
i use xPaths to replace html into bbcode. maby you could do something like
that on those pages?
my wysiwyg editor code is here..
you want to use it as a refence but the code is kinda messy...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Greasemonkey