[Prototype-core] Re: Date prototype functions [BUMP]

2007-08-23 Thread Nicolás Sanguinetti
As soon as I get some free time from work, I'll rewrite a lot of active support for js (http://code.google.com/p/active-support-for-javascript), including all necessary adjustments to work well with 1.6 (like removing the interpolation methods, which are now useless :)) Best regards, -Nicolas On

[Prototype-core] Suggestion: Form#focusFirstElement accepting an optional selector

2007-08-25 Thread Nicolás Sanguinetti
I've been using http://pastie.caboo.se/91025 so when a user has errors in the form, the focused element is the first erroneous field (and when there are no errors, it behaves "normally", focusing the first element). If the core team thinks it's useful I'll write a patch with proper tests :) Rega

[Prototype-core] Re: Patch review request: #8184 maxFrequency for Ajax.PeriodicalUpdater's decay functionality

2007-08-28 Thread Nicolás Sanguinetti
+1 for optional function -Nicolas On 8/29/07, Tom Gregory <[EMAIL PROTECTED]> wrote: > > I was thinking about this the other day as I was going through > Christophe's book ... I know I'm resurrecting an old thread, but stay > with me. > > Instead of adding a "maxFrequency" option, (really, "maxDe

[Prototype-core] Re: $('my-element').$$('a[href="foo"]');

2007-08-29 Thread Nicolás Sanguinetti
On 1.6.0 this has been aliased to select $("my-element").select("a[href=foo]") -Nicolas On 8/29/07, Jacob Rockowitz <[EMAIL PROTECTED]> wrote: > > Hi, > > I have been using Element#getElementsBySelector a lot and keep feeling > that the method's name is too verbose, couldn't it just be an Eleme

[Prototype-core] Re: iterable/$A

2007-08-30 Thread Nicolás Sanguinetti
On 8/30/07, Mislav Marohnić <[EMAIL PROTECTED]> wrote: > On 8/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > and is there any reason not to use String.replace([regexp], function() > > {} ) for a large part of the functions implemented by iterating > > through arrays? this can be blazingly

[Prototype-core] Re: simulated DOMContentReady event

2007-08-30 Thread Nicolás Sanguinetti
Dan Webb's LowPro[1] "solves" this kind of issue by registering a global Ajax.Responder that evaluates DOMContentReady behaviors onComplete. Thinking along similar lines, you could wrap Event.observe so that observers set for contentloaded are also stored into a queue that gets processed after e

[Prototype-core] Re: simulated DOMContentReady event

2007-09-01 Thread Nicolás Sanguinetti
On 9/1/07, Thomas Fuchs <[EMAIL PROTECTED]> wrote: > > IMHO, "contentloaded" should be fired once, when the DOM of the > initial page is completely loaded and parsed by the browser. > > ... > > I think making contentloaded too magic breaks POLS. Actually it works the other way around for me. My m

[Prototype-core] Element.addMethods

2007-09-04 Thread Nicolás Sanguinetti
How does the core team feel about letting Element.addMethods accept, other than a tagname, a specific node or an array of nodes and extend only those? For example, I want only certain rows of a table to have some methods available, and would love to do something like Element.addMethods("tr.comba

[Prototype-core] Element.wrap

2007-09-07 Thread Nicolás Sanguinetti
Quick question: why does Element.wrap return the wrapped element instead of the wrapper? I've yet to find somewhere where I use wrap that I don't do .wrap(...).up() Is it just me? -Nicolas --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Prototype-core] Re: Element.wrap

2007-09-07 Thread Nicolás Sanguinetti
On 9/7/07, Mislav Marohnić <[EMAIL PROTECTED]> wrote: > On 9/7/07, Nicolás Sanguinetti <[EMAIL PROTECTED]> wrote: > > > > Quick question: why does Element.wrap return the wrapped element > > instead of the wrapper? > > Consistency. Element.Mehods methods alw

[Prototype-core] Re: Element.update() speed boost

2007-09-14 Thread Nicolás Sanguinetti
Thought: what about declaring this method using a setter? Won't affect IE, and works fine in Mozilla, without touching Prototype's source. something along the lines of (haven't tested, thinking on gmail): HTMLElement.prototype.__defineSetter__("innerHTML", function(html) { var newEl = this.clon

[Prototype-core] Re: Element.update() speed boost

2007-09-14 Thread Nicolás Sanguinetti
do $("something").__defineSetter__ etc. and then $("something").innerHTML = "cuack" works fine :) Damn, it was a good idea :P On 9/14/07, Nicolás Sanguinetti <[EMAIL PROTECTED]> wrote: > Thought: what about declaring this method using a setter? Won't affect &g

[Prototype-core] Re: Superclass constructor

2007-09-20 Thread Nicolás Sanguinetti
You have to pass $super to the subclass' methods as its first argument and then call it from there. var Cat = Class.create(Animal, { initialize: function($super, name) { $super(name); alert('Cat : initialize'); } }); Best, -Nicolas On 9/20/07, Nicolás Sanguinetti &l

[Prototype-core] Re: Superclass constructor

2007-09-22 Thread Nicolás Sanguinetti
On 9/22/07, Les <[EMAIL PROTECTED]> wrote: > The OpenLayers API 2.5 (a maping API in part based on Prototype) > supports multiple inheritance, so why not Prototype? Mislav said: > Also, multiple inheritance isn't all that good. There is a reason Java and > C++ successors like Objective-C and C#

[Prototype-core] Re: No documentation on Event.fire().

2007-09-27 Thread Nicolás Sanguinetti
It's not in the documentation 'cause 1.6 is still a release candidate. When it goes final the docs will include everything in 1.6 :) On 9/27/07, Wiktor Ihárosi <[EMAIL PROTECTED]> wrote: > > On Sep 27, 12:09 pm, "Richard Quadling" <[EMAIL PROTECTED]> > wrote: > > This returns an event, as seen vi

[Prototype-core] Re: Superclass constructor

2007-09-28 Thread Nicolás Sanguinetti
I'm not gonna say to you that if you have something complex calling "destructors" isn't correct. I'm just gonna argue against it being in core, as IMHO it's something that not really many people need, and, since you have to call it manually, the best you can do is defining a naming convention, not

[Prototype-core] Re: Class.create and inheritance

2007-09-28 Thread Nicolás Sanguinetti
Yanick said: > I think that this is more Java-like (which is my opinion the best OOP > language), and it makes more sense than having an extra parameter in > the consstructor. Saying that in a list of ruby fans? (well, sort of) Watch your next words carefully, Persian: they might be your last ;)

[Prototype-core] Re: a uniq() way to name a function

2007-11-15 Thread Nicolás Sanguinetti
Prototype is inspired a lot by the ruby language, which names the method 'uniq'. Best, -Nicolas On Nov 15, 2007 2:14 PM, Jerome <[EMAIL PROTECTED]> wrote: > > Hey guys, > > You guys have this uniq() function in the Array API > It seems like an odd choice of a name, why not just name the function

[Prototype-core] Re: features request

2007-11-21 Thread Nicolás Sanguinetti
For the Cookies you have Prototype.Tidbits on livepipe: http://livepipe.net/projects/prototype_tidbits/ And I know someone had done Moo's Assets for Prototype, but can't find the link. Best, -Nicolas On Nov 21, 2007 8:35 AM, Mislav Marohnić <[EMAIL PROTECTED]> wrote: > These are useful, but I don

[Prototype-core] Re: API Request: Function.argumentNames(); Function.methodize();

2007-11-29 Thread Nicolás Sanguinetti
argumentNames just returns the names of the arguments passed to the function. ForEx you have function foo(bar, baz, qux) { alert("bar: " + bar + ", baz: " + baz + ", qux: " + qux); } foo.argumentNames() will return ["bar", "baz", "qux"], just as you declared them on the function. = metho

[Prototype-core] Very weird behavior with event tests

2007-12-17 Thread Nicolás Sanguinetti
I was trying to figure out the problem of a poster in the spinoffs list (http://groups.google.com/group/rubyonrails-spinoffs/browse_thread/thread/4ff06bf903aced80) about Event.observe throwing errors with the element. I saw the code, it was using Event.observe(unextended_node, ...), so I figured

[Prototype-core] Re: Is there an I18N support in prototype

2007-12-30 Thread Nicolás Sanguinetti
If you need "just" sprintf functionality, there's a nice wrapper around the Template class in String.interpolate http://www.prototypejs.org/api/string/interpolate Best, -Nicolas On Dec 30, 2007 1:08 PM, Severin Heiniger <[EMAIL PROTECTED]> wrote: > > There's already the powerful Template [1] f

[Prototype-core] Re: element.update( document.createTextNode( "hello" ) ); [object Text]

2008-01-07 Thread Nicolás Sanguinetti
element.update("hello") Element.update can take a string (in which case it's set as innerHTML), an Element object, or any object that responds to either toElement or toHTML (and which returns accordingly either an element or a string of html :)) (The same goes for Element.replace and Element.upd

[Prototype-core] Re: Javascript closures question

2008-01-08 Thread Nicolás Sanguinetti
On Jan 8, 2008 11:20 PM, Simon Thomas <[EMAIL PROTECTED]> wrote: > > Can anyone explain the difference in the folllowing and when and why > to use each of the methods. > (Or knows a better place to ask this question) > > 1) > var myVar = function(args){ >// inner functions and vars > }; This

[Prototype-core] Re: Javascript closures question

2008-01-08 Thread Nicolás Sanguinetti
r, if it's only > related to Core JavaScript, on any other JavaScript mailing list. > > Thanks! > > > > On Jan 9, 2008 2:36 AM, Nicolás Sanguinetti <[EMAIL PROTECTED]> wrote: > > > > > > On Jan 8, 2008 11:20 PM, Simon Thomas <[EMAIL PROTECTED]>

[Prototype-core] Re: Element.update on images. Bug or Feature Request?

2008-01-24 Thread Nicolás Sanguinetti
The thing is that someone who knows Prototype knows that update changes the innerHTML of an element. If another programmer sees your code and sees you're updating an image, he'll be a little puzzled :) If you use image.src = path, or image.setAttribute("src", path) or image.writeAttribute("src",

[Prototype-core] Re: Simple event delegation

2008-02-08 Thread Nicolás Sanguinetti
I'd normally respond that since adding this feature is only 5 lines away, it'd serve well as a plugin. *But*, event delegation is usually "such a good practice" that adding this to core could be a nice incentive for all those people that come into #prototype asking why do my 51238 cells in the tabl

[Prototype-core] Re: Simple event delegation

2008-02-09 Thread Nicolás Sanguinetti
On Feb 8, 2008 9:19 PM, Nicolás Sanguinetti <[EMAIL PROTECTED]> wrote: > I'd normally respond that since adding this feature is only 5 lines > away, On Feb 9, 2008 6:30 AM, kangax <[EMAIL PROTECTED]> wrote: > The implementation is NOT as simple as it seems to be. Teeh

[Prototype-core] Re: Can the Enumarable iterators be changed to accept scope as the first param (optionally)

2008-02-09 Thread Nicolás Sanguinetti
On Feb 9, 2008 7:07 AM, sambo99 <[EMAIL PROTECTED]> wrote: > On the other hand, I do think I am on to something with exploring > implementation of a hierarchy aware Object.extend. At the bare minimum > I think it may be worth exploring adding a function to Enumerable that > allows you to extend it

Re: [Prototype-core] Playing with Google's Closure Compiler and got a message for Prototype 1.7.0.0

2011-05-17 Thread Nicolás Sanguinetti
I like that it warns about *lack* of side effects. I mean, any functional programmer would think that's a great warning to have :) -foca On Tue, May 17, 2011 at 3:24 PM, Rick Waldron wrote: > Andrew, Richard > Not sure if this helps, but I figured it was worth the mention... jQuery no > longer u