Hi all,
I have 2 topics I am curious about, but will start a separate thread  
for the other one.

So, my question is, I want to tweak the event system to add some  
features, but I'm not sure if adding hooks to modify it is in the  
roadmap, or if the API is considered standard enough to extend.

Basically, there are some features that I would like to add:
1. Passing the scope of the event listener
We often have groups of methods that need to access common data that  
doesn't logically associate to just one DOM element.
I know the convention is to use closures, but this begins to add quite  
a bit to the memory footprint, especially when you have a lot of  
components, and in crappy but ubiquitous js engines  
(*cough*JScript*cough*).
I don't mean a partial apply, like Prototype's bind and  
bindAsEventListener, but just using a straight apply with the method  
and object that it should be scoped too.
I know for most common uses, it doesn't always make sense, but in  
large groups of applications the pennies become dollars pretty quickly.

2. Modifying the event object that's passed into the listener
I would like to add some custom helpers and constants to the event  
object that is passed into the listener, such as getXY() and ENTER,  
BACKSPACE (etc, where the keycodes are mapped to the constants),  
isChildOf(parentEl), etc.

3. Modifying the behavior of the event loop
Right now, if you return false from the loop, it does a  
event.stopPropagation() and event.preventDefault, but for custom  
events, I would like the behavior to completely halt the loop, and for  
events to be able to pass data between the listeners (which I think is  
already possible if you pass around an object).

I understand that a lot of these things just wouldn't make sense in  
the core, but I was wondering if there are plans to allow that sort of  
extension of the event system, or if the event api is safe enough to  
overwrite.

There are 2 things I would like to avoid, massive code duplication,  
and not being able to easily upgrade because the event system's API  
changed so drastically that upgrading would mean either massive  
refactoring on our part, or monstrous code duplication to emulate old  
behavior.

So, would you guys consider it safe enough to extend, are there  
existing plans, or are there existing ways to handle the methods above?

Thanks in advance for reading through all of this, and I appreciate  
any and all responses :)


Nate Cavanaugh
Director of User Interface Engineering
Liferay, Inc.
Enterprise. Open Source. For life.








Nate Cavanaugh
Director of User Interface Engineering
Liferay, Inc.
Enterprise. Open Source. For life.






--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to