[jifty-devel] Chart plugin: Handling scripts in regions

Dobrica Pavlinusic dpavlin at rot13.org
Mon Aug 6 02:23:10 EDT 2007

On Sun, Aug 05, 2007 at 04:02:33PM -0400, Thomas Sibley wrote:
>> A new problem I see now is that if you place a PlotKit chart inside of a 
>> region and then replace that with another region containing PlotKit 
>> charts, the charts never render because the script tags are stripped. I 
>> was trying to think of a better way to handle this and was wondering if we 
>> might render a table containing the data for the chart, which would then 
>> be replaced by a PlotKit chart when the next Behaviour.apply() call is 
>> made. This could be a standard facility provided by the plugin rather than 
>> by the renderer since I expect other renderers to need something like it. 
>> If PlotKit failed to render, at least there'd be a table showing the data.
> I thought we eval'ed any scripts in the new region after it's been inserted 
> (and had some settle time).  It seems that we do (jifty.js, line 966).  I 
> imagine it's not working because the chart rendering is being triggered as 
> an onLoad event for the window.  It should probably change to an 
> onAvailable event for the div being inserted.

I have same problem with CodePress plugin. Since jifty has onLoadHook
which is triggered on page load, wouldn't it be reasonable for jifty to
have hook which is triggered both on page and region load? (in other
words should I hack on it or are there better suggestions?)

Dobrica Pavlinusic               2share!2flame            dpavlin at rot13.org
Unix addict. Internet consultant.             http://www.rot13.org/~dpavlin

More information about the jifty-devel mailing list