[jifty-devel] prototype and script.aculo.us update

Wolfgang Kinkeldei wolfgang at kinkeldei.de
Thu Dec 28 03:18:56 EST 2006

Am 27.12.2006 um 21:25 schrieb Nelson Elhage:

> On Wed, Dec 27, 2006 at 09:15:55PM +0100, Wolfgang Kinkeldei wrote:
>> Hi,
>> I just played around a bit with the latest versions of the javascript
>> libraries Prototype and Scriptaculous and wondered if there were a
>> possibility to let them work inside Jifty.
>> After testing prototype 1.5 and script.aculo.us 1.7beta, all
>> "onclick" handlers did not work anymore... The reason is a function
>> "Element.Methods.update" which is defined in prototype and is applied
>> to all Objects. This function has precedence over Jifty's "update"
>> function and always returns a true value. Thus, all onclick handlers
>> behave like no JavaScript is available.
> Having Jifty's update() method in the global namespace is probably  
> Wrong,
> anyways; It should probably be named Jifty.update() or similar. I
> imagine making this change would fix the problem, and *shoudn't* breat
> back-compat, since Jifty should be the only thing generating calls to
> update(), anyways. Does this make sense to other people?

I also think, this makes a lot of sense. If changes need to get done,  
I think that some minor cleaning could be good as well. eg. the "dom- 
drag.js" is not used inside Jifty, as far as I have seen and all  
dragging-operations can be done with scriptaculous.

What I was breaking my head about the last few days: Is there an  
elegant way of applying an effect _before_ doing an update to a  
region? Technically this is not a problem, using the 'afterFinish'  
hook of an effect to fire the region update. To allow this, there  
would be a need to keep something like a TODO list inside the  
"Jifty.update()" method that triggers its next item by a final hook  
of the previous item. Everything concerning the same region would  
have to run sequentially, different regions could run in parallel.

And: changing the "onclick" handler logic inside Jifty to allow an  
effect to run without any region-changes or enable a developer to  
change an image would be great.

Does this make sense?
Should we discuss more about this and try to outline some possible  
expansions to the onclick-args and the consequences for the generated  
JS Code or do you have different plans?


Wolfgang Kinkeldei


' /\_/\ ' .print[split??,"".(($/=q|Cms)+-03467:;<=|)=~tr!C-z -B! -z!)x
'( o.o )' .$/]->[hex]foreach split qr<>,qq+1ecd039ad65b025b8063475b+||
' > ^ < ' .q<!-- Wolfgang Kinkeldei - mailto:wolfgang at kinkeldei.de -->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2425 bytes
Desc: not available
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20061228/8c5f6d73/smime.bin

More information about the jifty-devel mailing list