[Prototype-core] Event.stopObserving() doesn't work for window as only argument.

2009-08-11 Thread Allen
easons that window cannot be extended, I would also like to know what those are. Thanks! Allen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to p

[Prototype-core] Re: Code to add

2009-08-12 Thread Allen
I do something similar to this. However, IE's support of visibility only works for hidden and visible, not the other two, so it is questionable depending on browser support how you would handle showv in your example above. In general, since IE doesn't fully support visibility I don't use the other

[Prototype-core] Re: Template Class

2009-08-12 Thread Allen
You should use Strings interpolate function for this. A template is meant to be reused many times with many different filler values. On Jun 14, 10:41 am, Yaffle wrote: > var Template = Class.create({ >   initialize: function(template, pattern){ >     var parts = template.toString().split(pattern

[Prototype-core] Re: Code to add

2009-08-12 Thread Allen
n how collapse and inherit are handled. On Aug 12, 10:17 am, "joe t." wrote: > Allen makes a good point on distinct method names, but i had my > mutation of these written before i knew better, and mine simply wrap > the existing methods and look for a "truthy" argum

[Prototype-core] Re: Event.stopObserving() doesn't work for window as only argument.

2009-08-12 Thread Allen
gt; On Aug 11, 4:20 pm, Allen wrote: > > > > > > > When I do: > > Event.observe(window, 'resize', alert); //Note: alert is the common > > javascript alert function, but it will be called with no params. > > > Then I can do the follo

[Prototype-core] Re: Template Class

2009-08-12 Thread Allen
Template class instead of Template#evaluate. > So if you will use Template#evaluate many times for one Template > object, you will save a little time. > > On Aug 12, 6:41 pm, Allen wrote: > > > > > You should use Strings interpolate function for this. A template is &g

[Prototype-core] Array#intersect and Array#without inconsistency

2009-09-03 Thread Allen
Hi all, I was looking into some of the array methods and noticed this inconsistency. >>> [1].without("1"); [] >>> [1].intersect(["1"]); [] Basically, without uses an == comparison, whereas intersect uses an === comparison. IMHO, I think == is more appropriate. As such, I have forked the prototyp

[Prototype-core] Re: On demand js load

2009-08-14 Thread Allen Madsen
're problem is likely that javascript is technically CDATA, so you can't just insert it into script tags. Also, you shouldn't post this kind of stuff on Prototype-Core.Try http://groups-beta.google.com/group/prototype-scriptaculous Allen Madsen On Fri, Aug 14, 2009 at 11:07 AM, Fray wrote:

[Prototype-core] Re: Form#serializeElement's 'submit' option, doc could use another pair of eyes

2009-08-21 Thread Allen Madsen
I've looked it over and your description appears to be correct. Allen Madsen On Fri, Aug 21, 2009 at 11:47 AM, T.J. Crowder wrote: > > Hi folks, > > I fixed ticket #21 today with this commit (my branch, not core): > > http://github.com/tjc

[Prototype-core] Re: change DOM on select option

2009-08-27 Thread Allen Madsen
stead of directly setting the onWhatever property. This is the preferred way of doing things in prototype. For future reference, this isn't the place to post questions like this. Instead, go to http://groups-beta.google.com/group/prototype-scriptaculous Allen Madsen http://www.allenmadsen

[Prototype-core] Re: $ and $$ in top-level scope

2009-08-30 Thread Allen Madsen
+1 for what tobie said. I would prefer not to have extra $ method's that do the same thing if possible. Thanks, Allen Madsen http://www.allenmadsen.com On Sun, Aug 30, 2009 at 5:32 AM, Tobie Langel wrote: > > A more elegant solution to this problem is to use a closure around th

[Prototype-core] Re: A more efficient $super for Prototype 2

2009-09-04 Thread Allen Madsen
Hi, I think the speed improvement definitely merits going into. I would suggest the helper be called $super so when converting, the relationship is evident. I have to admit that passing arguments in feels odd to me though. Allen Madsen http://www.allenmadsen.com On Fri, Sep 4, 2009 at 9:09 AM

[Prototype-core] Re: A more efficient $super for Prototype 2

2009-09-05 Thread Allen Madsen
not > > defined. This works: > I think you need "this.nifty.$super.call(this, foo);" Allen Madsen http://www.allenmadsen.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype: Core"

[Prototype-core] Re: Array#intersect and Array#without inconsistency

2009-09-05 Thread Allen Madsen
and booleans, which I don't see as very harmful. Allen Madsen http://www.allenmadsen.com On Thu, Sep 3, 2009 at 6:20 PM, kangax wrote: > > On Sep 3, 1:55 pm, Allen wrote: > > Hi all, > > > > I was looking into some of the array methods and noticed this > > incon

[Prototype-core] Re: Array#intersect and Array#without inconsistency

2009-09-07 Thread Allen Madsen
Tobie, Do you have any input on this? Allen Madsen http://www.allenmadsen.com On Mon, Sep 7, 2009 at 8:00 AM, Joran wrote: > > Re: Array.uniq and Array.include and '==': > > There's a bug in the existing Array.uniq where [false, 0].uniq() > returns [fa

[Prototype-core] Re: A more efficient $super for Prototype 2

2009-09-07 Thread Allen Madsen
ifty() }, crappy: function(){ this.nifty.$super(); //calls super of another function } }); Allen Madsen http://www.allenmadsen.com On Sun, Sep 6, 2009 at 5:38 AM, T.J. Crowder wrote: > > > > I think you need "this.nifty.$super.call(this, foo);" > > > > You do

[Prototype-core] Re: Simplify working with Hash selections

2009-09-08 Thread Allen Madsen
type, { toHash: function(){ var hash = $H(); this.each(function(value, i){ hash.set(i, value); }); return hash; } } IMHO, this doesn't belong in core. Allen Madsen http://www.allenmadsen.com On Tue, Sep 8, 2009 at 6:03 AM, Green wrote: > > Often I have to

[Prototype-core] Re: Array#intersect and Array#without inconsistency

2009-09-08 Thread Allen Madsen
There seems to be more support for strict equality, so I'll write up a patch with that and modify some test cases around the change. Allen Madsen http://www.allenmadsen.com On Tue, Sep 8, 2009 at 7:33 AM, Tobie Langel wrote: > > > Tobie, > > Do you have any input on this? &

[Prototype-core] Re: A more efficient $super for Prototype 2

2009-09-08 Thread Allen Madsen
call super (disregarding callee), it would be nice if defining that was simplified. So something like: var A = Class.create({ nifty: function(){} }); var B = Class.create(A, function(){ function nifty(){ nifty.$super.call(this); } return {nifty: nifty}; }); Allen Madsen

[Prototype-core] Re: A more efficient $super for Prototype 2

2009-09-08 Thread Allen Madsen
Oh, also, you may want to throw something into update helper about your new method of getting super. Allen Madsen http://www.allenmadsen.com On Tue, Sep 8, 2009 at 9:56 AM, Allen Madsen wrote: > Hey TJ, > For your two suggested additions. I don't think I have ever had a use for &g

[Prototype-core] Re: A more efficient $super for Prototype 2

2009-09-08 Thread Allen Madsen
pets relate to the source. Allen Madsen http://www.allenmadsen.com On Tue, Sep 8, 2009 at 11:18 AM, T.J. Crowder wrote: > > @Allen, > > > For your two suggested additions. I don't think I have ever had a use for > > either. > > Thanks. > > > One thing I wo

[Prototype-core] Re: A more efficient $super for Prototype 2

2009-09-08 Thread Allen Madsen
(){} function nifty(){ privateFunction(); privateVar = 3; } return {nifty: nifty}; }); I'd much rather see it in this form. Allen Madsen http://www.allenmadsen.com On Tue, Sep 8, 2009 at 10:12 AM, Jim Higson wrote: > > On Tuesday 08 September 2009 14:56:06 Allen Madsen wrote:

[Prototype-core] Re: A more efficient $super for Prototype 2

2009-09-08 Thread Allen Madsen
e questions are around selector's or the AJAX stuff. From my experience most newbies don't even use Class. Allen Madsen http://www.allenmadsen.com On Tue, Sep 8, 2009 at 2:43 PM, Robert Kieffer wrote: > > On Sep 8, 8:44 am, "T.J. Crowder" wrote: >>    

[Prototype-core] Re: A more efficient $super for Prototype 2

2009-09-09 Thread Allen Madsen
reasonable to allow each individual developer to handle it as they see fit. Allen Madsen http://www.allenmadsen.com On Wed, Sep 9, 2009 at 7:29 AM, T.J. Crowder wrote: > > Hi all, > > I thought of a wrinkle today:  Mixins.  This new mechanism modifies > function instances if

[Prototype-core] Re: True Hashes using objects as keys

2009-09-11 Thread Allen Madsen
I'm with kangax on this one. I have never needed this functionality. Allen Madsen http://www.allenmadsen.com On Fri, Sep 11, 2009 at 11:59 AM, James Aimonetti wrote: > > My interest was piqued when reading > http://www.timdown.co.uk/jshashtable/index.html if that helps furthe

[Prototype-core] Re: True Hashes using objects as keys

2009-09-12 Thread Allen Madsen
Arty, I believe that use case is used by element storage now. Instead of a hash of DOM element to data, you can simply use an array of DOM elements and they will have their storage attached. The speed would probably be faster than a true hash. Allen Madsen http://www.allenmadsen.com On Sat

[Prototype-core] Re: $H({}).get('__proto__') in Firefox =)

2009-09-22 Thread Allen Madsen
kangax, there are no collisions if everything is prefixed like Yaffle suggests. Allen Madsen http://www.allenmadsen.com On Tue, Sep 22, 2009 at 8:03 AM, kangax wrote: > > On Sep 21, 4:40 pm, Yaffle wrote: >> base2.js uses prefix for it's "Map" Class > >

[Prototype-core] Re: Function.EMPTY and Function.K

2009-09-25 Thread Allen Madsen
I think Function.identity is fine. If somebody is unsure of what it it they can check the docs. Allen Madsen http://www.allenmadsen.com On Fri, Sep 25, 2009 at 6:22 AM, T.J. Crowder wrote: > >> Hmm, whilst technically correct, the term "identity" may not be what &g

[Prototype-core] Re: Memory Leak in IE

2009-10-02 Thread Allen Madsen
Agreed +1 Allen Madsen http://www.allenmadsen.com On Fri, Oct 2, 2009 at 2:42 PM, Simon Charette wrote: > Element#destroy would definitely be useful. +1 > > I really think this is a better idea then making a public interface to > reach destroyCache since it resolves into one funct

[Prototype-core] Re: Suggestion: String#isEmpty instead String#empty

2009-10-02 Thread Allen Madsen
I'd prefer isEmpty as well. Allen Madsen http://www.allenmadsen.com On Fri, Oct 2, 2009 at 3:34 PM, joneff wrote: > > I've been pondering on this one for quite a long time -- why is it > String#empty instead of String#isEmpty? To me String.empty should be a > field e

[Prototype-core] Re: Observing objects

2009-10-07 Thread Allen Madsen
Jim, Check this modification of Tobie's code out. http://gist.github.com/203978 The problem you're describing is fixed by using a unique element to fire the events from. Allen Madsen http://www.allenmadsen.com On Wed, Oct 7, 2009 at 5:59 AM, Tobie Langel wrote: > > Hi ag

[Prototype-core] Re: Units Of Measurement Options Stated Using Lowest Common Denominator Unit Practical

2009-10-09 Thread Allen Madsen
Joran, The type of number extensions you described aren't part of prototype. Therefore, it is simpler for developers who aren't using such an extension to use seconds. I'm not opposed to the switch, but I wanted to throw out a possible explanation for the way it is today. Al

[Prototype-core] Re: Suggestion: "Prototype.Compatibility" (was "Units of Measurement...")

2009-10-11 Thread Allen Madsen
I have to agree with T.J. In addition to complexity, there is also a concern for size. If I am using the newest version of the code, why would I want the added weight of compatibility stuff I will never use? Allen Madsen http://www.allenmadsen.com On Sun, Oct 11, 2009 at 3:25 AM, T.J. Crowder

[Prototype-core] Re: Multiple eventName's for Event observe?

2009-10-22 Thread Allen Madsen
solutions you mention though, I would prefer the first. Allen Madsen http://www.allenmadsen.com On Thu, Oct 22, 2009 at 1:50 PM, Ngan Pham wrote: > It would be nice if Event#observe's eventName argument was able to take an > array, or perhaps a comma delimited string so that it ca

Re: [Prototype-core] Genereic Function Benchmark

2009-11-19 Thread Allen Madsen
You could try unittest_js'[1] benchmark function. It's at the very end of the file. It'll help with the timing. Other than that, you may like the page speed extension for firebug. [1] http://github.com/tobie/unittest_js/blob/master/assets/unittest.js Allen Madsen http://www.allenm

Re: [Prototype-core] Server push capabilities

2009-11-29 Thread Allen Madsen
project. Allen Madsen http://www.allenmadsen.com On Thu, Nov 26, 2009 at 8:16 AM, Sebastien wrote: > Hi everybody. > > First of all, I want to congratulate your great work on this > framework. > I'm writing this to propose you a great improvement for the > framework : the serve

Re: [Prototype-core] parameters Encoding differents in Ajax Request

2009-12-03 Thread Allen Madsen
Try setting the page encoding. For example, for html use: or for xhtml use: Though, I'm not sure this will fix your problem. It's just a guess. Allen Madsen http://www.allenmadsen.com On Wed, Dec 2, 2009 at 5:33 PM, John wrote: > If I sent a parameter with "bogotá&quo

Re: [Prototype-core] Re: parameters Encoding differents in Ajax Request

2009-12-11 Thread Allen Madsen
Does it break if you use "htmlentities($searchParameter,ENT_COMPAT,'UTF-8');" for all browsers? Allen Madsen http://www.allenmadsen.com On Fri, Dec 11, 2009 at 2:42 PM, John wrote: > > the page has this meta-tag > > but I get the same bug :( > >

Re: [Prototype-core] Re: For() loops, ++i, i++, i+=1

2009-12-16 Thread Allen Madsen
I tried running your test on IE8 and it just kept prompting me with script unresponsive. Allen Madsen http://www.allenmadsen.com On Wed, Dec 16, 2009 at 7:01 AM, Robert Kieffer wrote: > I whipped up a quick JSLitmus test to try out a handful of empty loops > (using i++, ++i, i+=1, and a

Re: [Prototype-core] Re: Class inheritance by reference

2009-12-23 Thread Allen Madsen
Yea, addMethods is what you want. You can't just add them directly to the klass object. Allen Madsen http://www.allenmadsen.com On Wed, Dec 23, 2009 at 4:27 AM, T.J. Crowder wrote: > Hi, > > > I ran into problems when I tried > > to change a class that another class was

Re: [Prototype-core] Re: Ajax.Request Interface

2009-12-29 Thread Allen Madsen
+1 for static methods. Not sure about the implications of the rest yet. Allen Madsen http://www.allenmadsen.com On Tue, Dec 29, 2009 at 7:13 AM, Joran Greef wrote: > Propose: > > Http.get(uri, options) and Http.post(uri, options). > > Where: > > options = { > he

Re: [Prototype-core] DOM Events Mutation event types

2010-01-14 Thread Allen Madsen
I wouldn't mind if this made it into core either. Allen Madsen http://www.allenmadsen.com On Tue, Jan 12, 2010 at 3:21 PM, matti wrote: > Is there a reason why Prototypejs doesn't fire mutation events > ( > http://www.w3.org/TR/DOM-Level-2-Events/events.html#Ev

Re: [Prototype-core] Re: DOM Events Mutation event types

2010-01-28 Thread Allen Madsen
that case DOM modification events are useful. However, I wasn't aware of all the complications Andrew brought up. I'll play around with this and see what I come up with. Allen Madsen http://www.allenmadsen.com On Wed, Jan 20, 2010 at 5:01 PM, Diego Perini wrote: > Andrew, >

Re: [Prototype-core] Where is keyCode ?

2010-03-05 Thread Allen Madsen
.click(); }); $(document.body).hotkey('ctrl+shift+s', function(event){ alert('you found the secret key combination'); }); Allen Madsen http://www.allenmadsen.com On Thu, Mar 4, 2010 at 4:56 PM, Capripot wrote: > Where is the attribute "keyCode" of Event in t

Re: [Prototype-core] Roadmap

2010-04-07 Thread Allen Madsen
I agree that a road map would be helpful. In addition to the reasons gf3 mentioned, I think it would make it easier to contribute. Allen Madsen http://www.allenmadsen.com On Wed, Apr 7, 2010 at 4:53 PM, gf3 wrote: > This is a continuation of the discussion started here: > http://gith

Re: [Prototype-core] Any intention of providing a function.throttle?

2010-04-23 Thread Allen Madsen
I have used something like this in a project as well. I wouldn't mind seeing it in core. I don't particularly care what its called. Allen Madsen http://www.allenmadsen.com On Fri, Apr 23, 2010 at 9:00 AM, Titi Alailima wrote: > On Fri, Apr 23, 2010 at 6:28 AM, Mislav Maro

Re: [Prototype-core] Re: proposal: function to validate HTML

2010-05-08 Thread Allen Madsen
I agree with T.J. Allen Madsen http://www.allenmadsen.com On Sat, May 8, 2010 at 2:07 AM, T.J. Crowder wrote: > Hi, > > Validating HTML against a DOCTYPE is a non-trivial task, and it should > be (IMHO) an authoring-time task (using tools like the W3C > Validator[1]) rather

Re: [Prototype-core] Documentation for second parameter to AJAX callbacks.

2010-06-02 Thread Allen Madsen
Hi Richard, I may be misunderstanding what you are asking, but the documentation doesn't mention a second parameter. Rather, it says the headerJSON is a property on the first parameter passed into your onSuccess/onFailure methods. Hope that helps! Allen Madsen http://www.allenmadsen.com

Re: [Prototype-core] Re: Why are all children of an 'update'd element being purged?

2010-07-03 Thread Allen Madsen
Element#replace may be what you are looking for. Allen Madsen http://www.allenmadsen.com On Sat, Jul 3, 2010 at 6:00 AM, Viktor Kojouharov wrote: > I understand that. And I was using update to clear the container and > add a new element. My problem was, I have a reference to the pr