[kupu-dev] Allowing javascript in Plone RichText field

Duncan Booth duncan.booth at suttoncourtenay.org.uk
Tue Mar 27 16:18:44 CEST 2007


"darian schramm" <darian.schramm at gmail.com> wrote:

> I'm attempting to allow adding javascript ad placements within the
> body field of article types in Plone 2.5.2 (subclassed RichDocument
> types).
> 
> Adding the code while in HTML editing mode works, but on save the code
> gets encoded, not allowing the js to run. Is there a way to bypass
> this from Kupu or is Plone doing the encoding?
> 
> I can see that on switching away from HTML editing mode is when it
> appears to be happening, making me believe this is something in Kupu
> and not Plone specific.
> 

I'm not convinced how usable kupu would be if you permit users to enter 
javascript (remember the javascript is going to try to run while you are 
editing), but if you post an example of what you mean by the code being 
encoded I'll see what I can suggest.

Is it not possible to achieve what you want by extracting the javascript 
out to a separate .js file and then linking it in to the appropriate DOM 
elements based on particular class names?



More information about the kupu-dev mailing list