[kupu-dev] Pasting HTML into Kupu

Joao Eiras joao.eiras at gmail.com
Mon Dec 4 06:50:17 CET 2006


George Lee <georgeleejr at gmail.com> escreveu:

> "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."
>
> "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."


While this is not standard, other browser might support Mutation Events.


More information about the kupu-dev mailing list