Some more info that might help -- from <a href="http://www.thefutureoftheweb.com/blog/2005/11/onafterpaste">http://www.thefutureoftheweb.com/blog/2005/11/onafterpaste</a><br><br>"Internet Explorer has onBeforePaste and onPaste events, but no
onAfterPaste. onPaste fires when the user pastes, but before the HTML
actually goes into the editor. The idea is that the developer has a
chance to look into the clipboard using window.clipboardData.getData().
Unfortunately, you can only retrieve the contents in URL or Text
format, not HTML. Instead, it would be easier to allow the HTML to be
pasted, then process the editor contents afterwards.
To accomplish this in Internet Explorer, we can simply set a timeout
in the onPaste event. This works by allowing the browser time to finish
its internal onPaste event before executing the code in the timeout."<br><br>"Just to let you know, Mozilla supports an onInput event which can be
used for pasting. It is conveniently launched AFTER the data is pasted
in to a field."<br><br><br><div><span class="gmail_quote">On 12/3/06, <b class="gmail_sendername">Johnny deBris</b> <<a href="mailto:johnny@debris.demon.nl">johnny@debris.demon.nl</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
George Lee wrote:<br>><br>> Technically how do browsers paste -- by typing in character by character<br>> what's in the pasted selection? If so it seems like it'd be hard to<br>> trigger an HTML cleanup since it couldn't be called after each character
<br>> ("<" "d" "i" "v") was inserted.<br><br>In browsers, paste is a single action. In IE, certain events<br>(onbeforepaste and something like onpaste or onafterpaste, or even both)
<br>are emitted, but not in Mozilla. I think in Mozilla it's not possible to<br>automatically trigger cleanups on paste (actually spent some time<br>looking at this something like two years ago, perhaps things changed,<br>
but as far as I know, Mozilla still only supports the 'standard', and<br>not IE's extended, events).<br><br>> Alternatively, is there a way to<br>> override "paste" within browsers with a custom paste function?
<br><br>There's no hook or anything.<br><br>> Or to<br>> disable it and create another way like right-click, paste defined<br>> through Kupu?<br>><br>I'm not sure if you can disable it. I do know you can trigger paste from
<br>JavaScript (some execCommand call iirc), but in Mozilla it's not allowed<br>by default and has to be allowed on a per-domain basis by tweaking some<br>config file somewhere (the details are a little fuzzy, it's been a
<br>while, I just remembered it was cumbersome).<br><br>><br>> Where is this code?<br>><br>It's in common/kupucontentfilters.js, and if not, it was there at some<br>moment so check SVN history...<br><br>><br>> How does the filtering and HTML tidying of kupu, work in conjunction
<br>> with non-kupu users? If someone is entering HTML manually, through epoz,<br>> etc., if that uses different tidying standards, then isn't this going to<br>> wreak havoc as different users edit the same content with different
<br>> methods? Or is there a way to enforce tidying across the board -- for<br>> instance using a KupuRichWidget which doesn't have to use kupu but will<br>> still tidy the HTML according to the same standards whenever it is edited?
<br>><br>I'll leave this one for Duncan to answer, also because it's Plone<br>related (partially, I guess the answer in general would be something<br>like 'let's just hope they're all flexible enough, and at the same time
<br>produce clean enough results, so that they can cooperate nicely)...<br><br>Cheers,<br><br>Guido<br></blockquote></div><br>