[jQuery] jQuery Methods, a new plugin?

2006-11-14 Thread Paul Bakaus
Hi guys,I recently had the wish for extended functions on arrays, hashs and objects like Prototype provides with extending the Array() object. I often used features like without() and truncate(). I am really thinking of rewriting/porting a lot of stuff for jQuery and call it "jQuery Methods", but I

Re: [jQuery] jQuery Methods, a new plugin?

2006-12-15 Thread Alan Gutierrez
* Jörn Zaefferer <[EMAIL PROTECTED]> [2006-11-22 03:17]: > Alan Gutierrez schrieb: > > Extending prototype creates a lot of surprises. You're going to find > > yourself saying, yeah, that library isn't compatable with jQuery. > > > I don't quite get your point. Do you use for-in loops on Strings

Re: [jQuery] jQuery Methods, a new plugin?

2006-12-17 Thread John Beppu
I hope future versions of Javascript give us better ways to iterate. for-in is what's really broken. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

Re: [jQuery] jQuery Methods, a new plugin?

2006-12-18 Thread Paul McLanahan
This is pretty cool stuff. Not widely available yet, but it's in FF2.0. http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7#Iterators On 12/17/06, John Beppu <[EMAIL PROTECTED]> wrote: > I hope future versions of Javascript give us better ways to iterate. > > for-in is what's really broken

Re: [jQuery] jQuery Methods, a new plugin?

2006-12-18 Thread jyl
That Mozilla design is terrible: people should *NOT* use exceptions for flow control! Exceptions are designed to be exceptional and expensive.. --Jacob > This is pretty cool stuff. Not widely available yet, but it's in FF2.0. > > http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7#Iter

Re: [jQuery] jQuery Methods, a new plugin?

2006-12-19 Thread Alan Gutierrez
That was my gut reaction, but, I think that it's an example of explicit use of a new Iterator interface, a way to make any object work with for in . But, I didn't read it that closely. It took 6-8 years to get to get JavaScript and DOM stable enough for our current applications. I'm not holding my

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-14 Thread Brandon Aaron
I think this is where namespacing comes into play. We don't really want to conflict with other libraries again. I think the internal stucture should be: jQuery.array[method] jQuery.string[method] jQuery.number[method] jQuery.date[method] Then we can provide shortcuts (making sure we don't overwri

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Jörn Zaefferer
> I recently had the wish for extended functions on arrays, hashs and > objects > like Prototype provides with extending the Array() object. I often used > features like without() and truncate(). I am really thinking of > rewriting/porting a lot of stuff for jQuery and call it "jQuery Methods", > b

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Paul Bakaus
Jörn,you're true about that, but there are many who actually do it this way, and I don't want to write a plugin for us geeks only :-)As I am trying out now, $A([1,2,3,4,5]).without(1) seems to work quite well. Even chaining does work then. 2006/11/15, "Jörn Zaefferer" <[EMAIL PROTECTED]>: > I recen

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Brandon Aaron
On 11/15/06, Paul Bakaus <[EMAIL PROTECTED]> wrote: > Even chaining does work then. chaining... :) -- Brandon Aaron ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Paul Bakaus
:Pby the way, there's a first version in the SVN, in plugins/methods ! Feel free to add something.2006/11/15, Brandon Aaron <[EMAIL PROTECTED] >:On 11/15/06, Paul Bakaus <[EMAIL PROTECTED] > wrote:> Even chaining does work then. chaining... :)--Brandon Aaron_

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Jörn Zaefferer
> by the way, there's a first version in the SVN, in plugins/methods ! Feel > free to add something. I took a look at your implementation: It looks like you are extending a String or Array object instead of it's prototype. Won't that cause the same problems when used with for-in loops? -- Jörn

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Brandon Aaron
On 11/15/06, "Jörn Zaefferer" <[EMAIL PROTECTED]> wrote: > Won't that cause the same problems when used with for-in loops? Yes, but only on the object itself and for/in shouldn't be used for arrays. I don't believe there should be a conflict. ___ jQuery

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Brandon Aaron
I propose we break these out into their own plugins. Have a plugins/methods/strings, plugins/methods/arrays, etc. -- Brandon Aaron On 11/15/06, Paul Bakaus <[EMAIL PROTECTED]> wrote: > :P > > by the way, there's a first version in the SVN, in plugins/methods ! Feel > free to add something. > > 20

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Brandon Aaron
On 11/15/06, Brandon Aaron <[EMAIL PROTECTED]> wrote: > I propose we break these out into their own plugins. Have a > plugins/methods/strings, plugins/methods/arrays, etc. I also propose that we check to make sure the $A, $S, etc are not currently being used and if they are, archive it in _$A, _$S

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Jörn Zaefferer
> > Won't that cause the same problems when used with for-in loops? > > Yes, but only on the object itself and for/in shouldn't be used for > arrays. I don't believe there should be a conflict. My words for not using for-in. But if the problem can occur on the object again, I don't really see th

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Jörn Zaefferer
> > I propose we break these out into their own plugins. Have a > > plugins/methods/strings, plugins/methods/arrays, etc. > > I also propose that we check to make sure the $A, $S, etc are not > currently being used and if they are, archive it in _$A, _$S, etc. > > if ( typeof $A != "undefined" )

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Brandon Aaron
This is an interesting topic and you make a good point. I suppose the question is, are we going to use prototype or not? When I originally suggested using namespaces I didn't mean to extend the object as well as use a namespace. I personally don't think it is a good idea for a library to 'pollute'

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Jörn Zaefferer
> I still think that using a namespace and providing a short cut like $A > is the best way to handle this, instead of extending the element or > prototype. I think we could even get chaining to work properly if we > really wanted too. We could also probably provide a way to extend the > prototype i

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-15 Thread Klaus Hartl
Jörn Zaefferer schrieb: >> I still think that using a namespace and providing a short cut like $A >> is the best way to handle this, instead of extending the element or >> prototype. I think we could even get chaining to work properly if we >> really wanted too. We could also probably provide a way

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-16 Thread Paul Bakaus
Hi all! Good opinions there in your emails, I have thought about adding prototypes to Strings and Arrays alot, and I also think it's more natural than using a namespace. And Jörn, you are true that bad practise should not be promoted/supported. If it can be achieved, it may be nice to have the b

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-16 Thread Jörn Zaefferer
> Good opinions there in your emails, I have thought about adding prototypes > to Strings and Arrays alot, and I also think it's more natural than using > a > namespace. > And Jörn, you are true that bad practise should not be > promoted/supported. > > If it can be achieved, it may be nice to hav

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-16 Thread Jörn Zaefferer
> I recently had the wish for extended functions on arrays, hashs and > objects > like Prototype provides with extending the Array() object. I often used > features like without() and truncate(). I am really thinking of > rewriting/porting a lot of stuff for jQuery and call it "jQuery Methods", > b

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-16 Thread Brandon Aaron
On 11/16/06, "Jörn Zaefferer" <[EMAIL PROTECTED]> wrote: > > I recently had the wish for extended functions on arrays, hashs and > > objects > > like Prototype provides with extending the Array() object. I often used > > features like without() and truncate(). I am really thinking of > > rewriting/

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-16 Thread Jörn Zaefferer
> > Just commited string.js and array.js to the plugin repository. They are > extending Array and String prototypes with functions, when they do not > exist yet. Documentation and testsuite is in there, too. > > > > Source: > > http://jquery.com/dev/svn/trunk/plugins/methods/array.js?format=txt > >

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-16 Thread John Resig
> Just commited string.js and array.js to the plugin repository. They are > extending Array and String prototypes with functions, when they do not exist > yet. Documentation and testsuite is in there, too. I'm more-than-fine with extending the Array and String prototypes from a plugin. jQuery do

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-17 Thread Paul Bakaus
Good job! Let's see what I can contribute in the future. -Paul 2006/11/16, John Resig <[EMAIL PROTECTED]>: > Just commited string.js and array.js to the plugin repository. They are extending Array and String prototypes with functions, when they do not exist yet. Documentation and testsuite is

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-21 Thread Alan Gutierrez
I'm jumping in to say that I'm adopting jQuery precisely because it does not much around with the prototype definition of native objects, otherwise, I would have stuck with Prototype. Working with Prototype, I was running into incompatabilities with the Google Maps API. Apparently, it was iteratin

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-22 Thread Jörn Zaefferer
Alan Gutierrez schrieb: > Extending prototype creates a lot of surprises. You're going to find > yourself saying, yeah, that library isn't compatable with jQuery. > I don't quite get your point. Do you use for-in loops on Strings or Arrays? If yes, the new methods plugins are not good for you,

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-22 Thread Brandon Aaron
Maybe the argument doesn't matter anymore with Dean's new revelation. -- Brandon Aaron On 11/22/06, Jörn Zaefferer <[EMAIL PROTECTED]> wrote: > Alan Gutierrez schrieb: > > Extending prototype creates a lot of surprises. You're going to find > > yourself saying, yeah, that library isn't compatable

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-22 Thread Jörn Zaefferer
> Maybe the argument doesn't matter anymore with Dean's new revelation. I don't think so. Subclassing Array still isn't the same as extending the Array prototype. It allows to work with extended Arrays, but the creation is different. You cant create an array via bracket-syntax ([1,2,3].) -- Jör

Re: [jQuery] jQuery Methods, a new plugin?

2006-11-22 Thread Dave Methvin
>> Maybe the argument doesn't matter anymore with >> Dean's new revelation. > > I don't think so. Subclassing Array still isn't the same as > extending the Array prototype. It allows to work with > extended Arrays, but the creation is different. You cant > create an array via bracket-syntax ([1,2,3