[Prototype-core] OpenAjax support

2008-01-25 Thread [EMAIL PROTECTED]
Hi all, Does anyone know if there is an intention to implement openAjax support standard in the future? Cheers, Shy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group,

[Prototype-core] Re: NPE in Element.remove

2008-01-25 Thread Mislav Marohnić
Hey Zmitro, If the element has no parent (which means it is not part of the document tree), how do you expect Element#remove() to work then? In my opinion, an error is what *should* happen in this case: var div = new Element() div.remove() Are you suggesting it should silently fail? I don't

[Prototype-core] Ajax.Updater - update vs replace

2008-01-25 Thread Andrew Kaspick
Hi, Not sure if this has come up before, but I was thinking that an option for Ajax.Updater to allow for a 'replace' call instead of the current 'update' would be useful. I find that I don't always want to update a given section of html, but would rather replace it entirely. Thoughts? As an

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

2008-01-25 Thread dynamo517
I understand what you're saying, however I'm more interested in making the functionality of Prototype's update function worthwhile for all the elements which are extended to use it. Like I said, currently calling .update on an image does nothing. My point is Why waste it?. When updating an

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

2008-01-25 Thread Mislav Marohnić
On Jan 26, 2008 8:12 AM, kangax [EMAIL PROTECTED] wrote: $('myImage').setSrc('images/blah.jpg'); sarcasm Wow, Kangax! That method really takes the pain out of writing $('myImage').src = 'images/blah.jpg'; /sarcasm --~--~-~--~~~---~--~~ You received this

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

2008-01-25 Thread Mislav Marohnić
On Jan 26, 2008 3:00 AM, dynamo517 [EMAIL PROTECTED] wrote: I'm sure there will be more appreciative people than puzzled people if the functionality I propose makes it's way in. Quite the contrary. I remember Sam saying that he dislikes functions that have the same name, but do different

[Prototype-core] Re: NPE in Element.remove

2008-01-25 Thread kangax
Well, of course, but I don't really see it as a problem. When element.parentNode == null it means that element is either a top level one (i.e. document) or has not yet been inserted into a DOM. It makes no sense to call remove in either of these cases. Am I missing something? - kangax

[Prototype-core] NPE in Element.remove

2008-01-25 Thread Zmitro Lapcjonak
Hi. The remove function texts: Element.Methods = { ... remove: function(element) { element = $(element); element.parentNode.removeChild(element); return element; }, ... This code fails when element.parentNode == null I use prototype v 1.6

[Prototype-core] Re: methodized String functions

2008-01-25 Thread Thomas Fuchs
basically, because number.round() is much shorter to type than Math.round(number). :) -Thomas Am 18.01.2008 um 23:49 schrieb Tobie Langel: Then the question is, why do it for the Math functions but not the String functions? AFAIK, because the Math ones were needed for script.aculo.us

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

2008-01-25 Thread kangax
As Nicolás pointed out, making Element.update change src attribute of an image is NOT the way to go. Not only is it unintuitive but redefining existent methods could lead to some serious bugs in future maintenance/upgrades, etc. If you feel like Element.writeAttribute is too verbose, I would

[Prototype-core] Re: NPE in Element.remove

2008-01-25 Thread Jon L.
If the Element doesn't have a parent node, then it's not in a context that it can be removed from. So, either leave it for garbage collection...or, just delete it... var div = new Element(); delete div; If needed, surround it in a simple test to make sure: var div = new Element();

[Prototype-core] Re: Ajax.Updater - update vs replace

2008-01-25 Thread kangax
Simple subclassing should do the job (haven't tested but it should work): Ajax.Replacer = Class.create(Ajax.Updater, { initialize: function($super, container, url, options) { options = options || { }; options.onComplete = (options.onComplete || Prototype.emptyFunction)