[Prototype-core] $super and Function.toString()

2007-11-11 Thread Artemy Tregoubenko
Hello Latest version of Prototype uses Function.toString() method to find names of function arguments and detect presence of $super argument. However, some time ago one of Opera developers warned in his blog (http://my.opera.com/hallvors/blog/2007/03/28/a-problem-with-john-resigs-addevent)

[Prototype-core] Re: $super and Function.toString()

2007-11-11 Thread Artemy Tregoubenko
probably yes if disabled toString() is the only limitation Yeah, the $super argument is a hack. Class instances will misbehave if the JavaScript interpreter is unable to serialize functions. But this issue aside, can we expect the rest of the framework to work if the JS interpreter is

[Prototype-core] Re: $super and Function.toString()

2007-11-11 Thread Artemy Tregoubenko
I see. Actually I haven't studied js spec, but if it says so then I agree on using Function.toString is absolutely fair. It should also be noted that this behavior does not comply with ECMA-262, which states that Function.prototype.toString shall return a string that has the syntax of a

[Prototype-core] Re: Lost scope this in class method Ajax onComplete event

2007-12-16 Thread Artemy Tregoubenko
yes, in handler functions scope is usually lost you can fight it this way: onComplete: function() { this.ReadResponse(); }.bind(this) Ok, could someoe explain, I'm losing scope for this, see below the line this.ReadResponse(); This has no scope. Why? What does work is the next line, where

[Prototype-core] Selector.assertions.attr() and Element.readAttribute() - null

2008-01-20 Thread Artemy Tregoubenko
Hello. I think I discovered a bug in latest prototype. There's function Selector.assertions.attr: attr: function(element, matches) { var nodeValue = Element.readAttribute(element, matches[1]); return Selector.operators[matches[2]](nodeValue, matches[3]); } In my FF2

[Prototype-core] Re: Selector.assertions.attr() and Element.readAttribute() - null

2008-01-20 Thread Artemy Tregoubenko
Can anyone confirm this? Should I submit a patch to trac? Please do! done http://dev.rubyonrails.org/ticket/10870 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group,

[Prototype-core] methodize parseInt parseFloat

2008-01-28 Thread artemy tregoubenko
Hello! What do you think about making parseInt parseFloat string methods too? -- arty ( http://arty.name ) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email

[Prototype-core] Re: methodize parseInt parseFloat

2008-01-29 Thread artemy tregoubenko
); } }; Object.extend(String.prototype, _ruby_methods); Object.extend(Number.prototype, _ruby_methods); })(); On Jan 28, 2:37�pm, artemy tregoubenko [EMAIL PROTECTED] wrote: Hello! What do you think about making parseInt parseFloat string methods too? -- arty (http://arty.name) -- arty

[Prototype-core] Re: methodize parseInt parseFloat

2008-01-30 Thread Artemy Tregoubenko
Btw, isn't there a site for sharing such small extensions for prototype? I have lots of them, and I understand most will never make it into prototype core library. I'd like to see it make it into the framework but if I have to add it to extensions.js (my 'extra' methods for prototype) then

[Prototype-core] Re: methodize parseInt parseFloat

2008-01-30 Thread Artemy Tregoubenko
thanks for this link, but I thought scripteka was for quite large extensions, while mine are mostly functions less then 10 lines of code artemy; scripteka! http://scripteka.com/ On Jan 31, 2008 6:34 AM, Artemy Tregoubenko [EMAIL PROTECTED] wrote: Btw, isn't there a site

[Prototype-core] Re: Adding Prototype.Revision

2008-02-03 Thread artemy tregoubenko
Latest Prototype here: http://prototypejs.org/assets/2008/1/25/prototype-1.6.0.2.js has following lines at the top: var Prototype = { Version: '1.6.0.2', Isn't this enough? I think using revision number is mostly replacing one readable number with another unreadable. I believe versions are

[Prototype-core] Re: Adding Prototype.Revision

2008-02-03 Thread artemy tregoubenko
I previously had success at comparing version numbers as string like that: '1.6' '1.6.0.2' true '1.5.0.1' '1.6' true Thus I am surprised that you parse these strings On Sun, 03 Feb 2008 21:39:56 +0300, Nick Stakenburg [EMAIL PROTECTED] wrote: I think we should have both version string

[Prototype-core] Re: Adding Prototype.Revision

2008-02-03 Thread artemy tregoubenko
I see, thanks Artemy, 1.6.0 1.6.0_rc1 false Best, Tobie On Feb 3, 8:22 pm, artemy tregoubenko [EMAIL PROTECTED] wrote: I previously had success at comparing version numbers as string like that: '1.6' '1.6.0.2' true '1.5.0.1' '1.6' true Thus I am surprised that you parse

[Prototype-core] Re: Adding Prototype.Revision

2008-02-03 Thread artemy tregoubenko
On Sun, 03 Feb 2008 22:47:59 +0300, Fabian Lange [EMAIL PROTECTED] wrote: You will have problems in a few releases: '1.6' '1.10.1' false On Sun, 03 Feb 2008 20:00:47 +0300, Mislav Marohnić [EMAIL PROTECTED] wrote: That is because none of the version fragments will ever be bigger than 9. --

[Prototype-core] onXYZ handlers in Ajax.Responders

2008-02-08 Thread artemy tregoubenko
Hi, My site will respond with 503 http code while in maintenance. I want to handle this response in ajax requests. Prototype's onXYZ ajax handlers suit perfectly for this task. Except for one thing: these handlers aren't called when specified in Ajax.Responders, so I will have to include

[Prototype-core] Re: Simple event delegation

2008-02-08 Thread artemy tregoubenko
I doubt you really want to stop mismatching events : ) Concerning sugar, you might be interested in syntax of behaviours library Hey, after reading up a bit about event delegation vs. event handling (http://icant.co.uk/sandbox/eventdelegation), I put together this little bit:

[Prototype-core] Re: Simple event delegation

2008-02-08 Thread artemy tregoubenko
. Are you referring to the sample HTML page? On Feb 8, 2:55�pm, artemy tregoubenko [EMAIL PROTECTED] wrote: I doubt you really want to stop mismatching events : ) Concerning sugar, you might be interested in syntax of behaviours library Hey, after reading up a bit about event delegation

[Prototype-core] Re: Event.isLeftClick() vs. click event in IE

2008-02-11 Thread artemy tregoubenko
results On Feb 11, 2:42 pm, artemy tregoubenko [EMAIL PROTECTED] wrote: Hello, Event.isLeftClick() is told to differ left clicks from right and middle clicks. However when I run document.observe('click', function(event){ alert(event.isLeftClick()); }) in IE and then left-click page, I see

[Prototype-core] Event.isLeftClick() vs. click event in IE

2008-02-11 Thread artemy tregoubenko
Hello, Event.isLeftClick() is told to differ left clicks from right and middle clicks. However when I run document.observe('click', function(event){ alert(event.isLeftClick()); }) in IE and then left-click page, I see 'false' in alert. This starts working if you listen to 'mousedown' or

[Prototype-core] Re: Event.isLeftClick() vs. click event in IE

2008-02-12 Thread artemy tregoubenko
BTW, your example in IE6 produces following results: for click: Left click: You clicked with your button. Event.button = 0 and Event.which = undefined Right and middle click: no effect, as expected for mousedown, as expected: Left click: You clicked with your Left button. Event.button = 1 and

[Prototype-core] Re: Event.isLeftClick() vs. click event in IE

2008-02-12 Thread artemy tregoubenko
On 2/12/08, Richard Quadling [EMAIL PROTECTED] wrote: On 12/02/2008, artemy tregoubenko [EMAIL PROTECTED] wrote: You'll be surprised that click _can_ be toggled via keyboard (FF, Opera for sure). You may easily test this. And my first example shows how isLeftClick is broken in IE6. I

[Prototype-core] Re: Opera 9.5 and document.viewport

2008-03-05 Thread artemy tregoubenko
I can confirm this. Found it some time ago and decided to wait till release. On 3/6/08, Matthew [EMAIL PROTECTED] wrote: The relevant code in version 1.6.0.2 is: dimensions[d] = (B.WebKit !document.evaluate) ? self['inner' + D] : (B.Opera) ? document.body['client' + D] :

[Prototype-core] opera 9.5 and Selectors API

2008-03-08 Thread artemy tregoubenko
Hi Afaik, Prototype in opera uses xpath for selecting nodes. However since 9.02 (http://www.opera.com/docs/changelogs/windows/902/) opera supports presumably faster methods selectNodes and selectSingleNode, predecessors of Selector API methods. I think it's a good idea to use them when

[Prototype-core] Re: typeof returning object for certain 'native' functions in IE

2008-06-06 Thread artemy tregoubenko
Some other functions: typeof setTimeout object typeof clearTimeout object typeof setInterval object typeof clearInterval object Thus: typeof setTimeout.defer undefined typeof setTimeout.delay undefined typeof setTimeout.curry undefined On Fri, 06 Jun 2008 14:08:24 +0400, T.J. Crowder

[Prototype-core] Re: Observe events in iframe

2008-06-24 Thread artemy tregoubenko
Prototype shortcuts are tailored to work in current window. However you can use generic prototype methods like this: Event.observe(iframe.contentWindow.document, 'mouseup', function (e){}) On Tue, 24 Jun 2008 16:52:28 +0400, AlannY [EMAIL PROTECTED] wrote: Is it possible to observe events