Hi Jacopo,

On Nov 12, 4:29 pm, jacoz <jacopo.nu...@gmail.com> wrote:
> Hi Eric,
> thanks for your suggests!
> Well, now I answer all of your questions ;)
> - I named Element.ajaxRequest() in that way because by default it
> updates the element, but you can change the "onSuccess" function!

OK, but if you don't change the element in the onSuccess, there is no
point using this method instead of Ajax.Request.

> - I've written String#len and String#getType because some newbies may
> not knows that attributes ;)

Well, you must not forget that every single byte you add to the
library will be loaded by every single page using the library.
Peoples are already complaining because prototype is "big", so if we
start to add useless things, it will be worst.
Moreover, newbies should better learn about length and the DOM
attributes instead of some exotic name not portable (and slower)
methods

> - I've re-written Array#compact: now the control is not recursive

It wasn't recursive, it was slow :o)

But still, "return value != null" is the same than "return value" (at
least when passed to Enumerable.select) and it is exactly what
Prototype.K function does.
> (thanks)
>
> Here is the code:http://tr.im/EBEPthe Array#comapct starts at at
> line 128
>
> Which methods do you suggest me to propose??

Well it is up to you, but Element.ajaxUpdate, Object.isBoolean or your
change to Array.compact sounds like useful features to me.

Eric


> Thanks,
> Jacopo.
>
> On Nov 12, 11:15 am, Eric <lefauv...@gmail.com> wrote:
>
> > Hi,
>
> > This has some nice ideas like Element.ajaxRequest() (which I would
> > have called Element.ajaxUpdate() since it is what it does :o) ), but
> > also some features I fail to see any utility to.
> > I.E., what's the point to use 'string'.len() instead of
> > 'string'.length?
> > Same thing for $('someElement').getType() instead of $
> > ('someElement').nodeName
>
> > Also, try to limit the impact on performances by avoiding tests in
> > loops when you can do them outside of the loop.
> > I.E, in your Array.compact version, you may replace :
> >   compact: function(strict) {
> >     return this.select(function(value) {
> >       return strict === true ? value != null && value.strip() != '' :
> > value != null;
> >     });}
> > ...by something like:
> >   compact: function(strict) {
> >     return this.select(strict === true ? function(value) { return
> > value != null && value.strip() != '' } : Prototype.K);}
>
> > The procedure to submit contributions is described 
> > here:http://www.prototypejs.org/contribute
> > You may propose some of yours (I'd recommend proposing only the more
> > interesting methods) once you've validated that they don't break the
> > test cases.
>
> > HTH,
> > Eric
>
> > On Nov 10, 10:07 am, Jacopo Andrea Nuzzi <jacopo.nu...@gmail.com>
> > wrote:
>
> > > Hi Tobie,
> > > thanks for you suggest: here it is:http://tr.im/EBEP
>
> > > Jacopo
>
> > > On Mon, Nov 9, 2009 at 9:35 PM, Tobie Langel <tobie.lan...@gmail.com> 
> > > wrote:
>
> > > > Hi jacoz,
>
> > > > Seems like your Array#add would benefit from using Array#splice.
>
> > > >https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Object...
>
> > > > Best,
>
> > > > Tobie
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to