Re: [jQuery] jQuery 1.1 API improvements (macros, events)

2006-11-29 Thread Klaus Hartl
Andrea Ercolino schrieb: dave.methvin wrote: Then there is the classic ambiguity of .unload(). Does it call an onunload handler, or does it unbind all onload handlers? There is no doubt with .un(load) or .on(unload, fn) which are only a few characters longer. OK. But I don't think that

[jQuery] jQuery 1.1 API improvements (macros, events)

2006-11-27 Thread Jörn Zaefferer
Hi folks, the discussion so far led to the conclusion to remove all those macros for css() and attr(), eg. color() or val(). css() and attr() are already quite flexible: Both allow you to get a single property, set a single property or set a set of properties. I wonder if it would help to

Re: [jQuery] jQuery 1.1 API improvements (macros, events)

2006-11-27 Thread Sam Collett
On 27/11/06, Jörn Zaefferer [EMAIL PROTECTED] wrote: Hi folks, the discussion so far led to the conclusion to remove all those macros for css() and attr(), eg. color() or val(). css() and attr() are already quite flexible: Both allow you to get a single property, set a single property or set

Re: [jQuery] jQuery 1.1 API improvements (macros, events)

2006-11-27 Thread Jörn Zaefferer
Sam Collett schrieb: The problem with removing all the helper methods is that some are very heavily used (especially val and click). While that may reduce jQuery's file size, it will increase the size of many plugins and pages that use jQuery. The basic problem: The API cluttering. There

Re: [jQuery] jQuery 1.1 API improvements (macros, events)

2006-11-27 Thread Brandon Aaron
On 11/27/06, Sam Collett [EMAIL PROTECTED] wrote: The problem with removing all the helper methods is that some are very heavily used (especially val and click). While that may reduce jQuery's file size, it will increase the size of many plugins and pages that use jQuery. In addition to what

Re: [jQuery] jQuery 1.1 API improvements (macros, events)

2006-11-27 Thread Brandon Aaron
On 11/27/06, Jörn Zaefferer [EMAIL PROTECTED] wrote: Currently I favor an interface that looks like this: $().bind(type of event, eventHandler, {amount: 5, data: additionalStuff}) $().trigger(type of event, {bubble: true, data: moreStuff}); This avoids any type checking of arguments and

Re: [jQuery] jQuery 1.1 API improvements (macros, events)

2006-11-27 Thread Jörn Zaefferer
Brandon Aaron schrieb: I think I prefer the suggestion made by Dave Methvin of using on() and un() instead of bind. $().on('click') $().un('click') Thanks Brandon, just forgot to mention that. Also maybe event.bind and event.trigger should have 'Data' appended to the end to be more

Re: [jQuery] jQuery 1.1 API improvements (macros, events)

2006-11-27 Thread Andrea Ercolino
Jörn Zaefferer wrote: ... The big so far unsolved question: What should the API methods look like? How to pass the additional data to the event handler? Currently I favor an interface that looks like this: $().bind(type of event, eventHandler, {amount: 5, data: additionalStuff})

Re: [jQuery] jQuery 1.1 API improvements (macros, events)

2006-11-27 Thread Brandon Aaron
On 11/27/06, Andrea Ercolino [EMAIL PROTECTED] wrote: I hope the event shortcuts will remain, like click( handler ) to bind and click() to trigger. They will stick around but in a compatibility plugin. As for the bind style, I think the handler should always be the last argument, because to

Re: [jQuery] jQuery 1.1 API improvements (macros, events)

2006-11-27 Thread Jörn Zaefferer
Andrea Ercolino schrieb: I hope the event shortcuts will remain, like click( handler ) to bind and click() to trigger. So far bind() would be on() and unbind() would be un(). The shortcuts would be removed from the default distribution, but still available as a compatibility plugin. As

Re: [jQuery] jQuery 1.1 API improvements (macros, events)

2006-11-27 Thread Andrea Ercolino
Jörn Zaefferer wrote: So far bind() would be on() and unbind() would be un(). The shortcuts would be removed from the default distribution, but still available as a compatibility plugin. Don't remove the shortcuts, please! They are very convenient for the events. I can understand that

Re: [jQuery] jQuery 1.1 API improvements (macros, events)

2006-11-27 Thread Dave Methvin
Don't remove the shortcuts, please! They are very convenient for the events. I can understand that css() and attr() can be enough. But click() as it is now is Easy and Clear and Convenient. The unbind could be incorporated into click() too, for example by using click( null ); Event

Re: [jQuery] jQuery 1.1 API improvements (macros, events)

2006-11-27 Thread Dave Methvin
The problem with removing all the helper methods is that some are very heavily used (especially val and click). While that may reduce jQuery's file size, it will increase the size of many plugins and pages that use jQuery. I don't think it will increase plugins or user code by more than a few