Re: [Prototype-core] Re: Event.observe(window, 'load'.. issue not fixed!

2010-04-19 Thread Демид Заянковский
No, unfortunately the order is till not preserved for DOM:LOADED event.
Thank you for your suggestion.

2010/4/15 Mislav Marohnić mislav.maroh...@gmail.com

 I think that dom:loaded handlers should execute in order, since it's a
 custom event. Try those instead of load.

 document.on(dom:loaded, function(){ ... })

 --
 You received this message because you are subscribed to the Google Groups
 Prototype: Core group.
 To post to this group, send email to prototype-core@googlegroups.com
 To unsubscribe from this group, send email to
 prototype-core-unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/prototype-core?hl=en


-- 
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en

Re: [Prototype-core] Re: Event.observe(window, 'load'.. issue not fixed!

2010-04-19 Thread Демид Заянковский
 In any case, I don't think it would be a fix
Well, that's a shame. I know that browsers do not gurantee the order in
which the event handlers execute, but it is such a convinient and
straightforward approach to do so, isn't it. That is why Firefox, Opera and
all the best browsers embraced it. IE is the outcast the ruins the picture.
If you look at the jQuery library, it does a fix for IE! Anyway, thank you
for your attention.

2010/4/15 T.J. Crowder t...@crowdersoftware.com

 Hi,

  Why isn't this issue still
  fixed?!

 You say still. Is there an _open_ bug report for it in
 Lighthouse[1]? Because if there isn't, it's not going to be fixed.

 In any case, I don't think it would be a fix, it would be an
 enhancement. As far as I know, Prototype does not make any guarantee
 as to the order in which multiple event handlers on an element will be
 called (because there is no guarantee provided by the underlying
 APIs). To do so, Prototype would have to replace the browser's list of
 event observers with its own, which would be overkill (IMHO).

 [1] http://prototype.lighthouseapp.com/projects/8886-prototype/overview
 --
 T.J. Crowder
 Independent Software Consultant
 tj / crowder software / com
 www.crowdersoftware.com


 On Apr 15, 2:03 pm, Dziamid dzia...@gmail.com wrote:
  Event.observe(window, 'load', function () {
alert('1');});
 
  Event.observe(window, 'load', function () {
alert('2');});
 
  Firefox, opera alerts 1 then 2, IE alerts 2 THEN 1!! Order is
  reversed and developeres are puzzled! Why isn't this issue still
  fixed?!

 --
 You received this message because you are subscribed to the Google Groups
 Prototype: Core group.
 To post to this group, send email to prototype-core@googlegroups.com
 To unsubscribe from this group, send email to
 prototype-core-unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/prototype-core?hl=en

 To unsubscribe, reply using remove me as the subject.


-- 
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en

Re: [Prototype-core] Re: Event.observe(window, 'load'.. issue not fixed!

2010-04-19 Thread Демид Заянковский
Well, to be honest, I've been focusing on Firefox and Opera mainly when
developing software and never even thought that order is not guaranteed,
before the task to support IE arrived! So there is plenty of code to
refactor, which is very frustrating. I know that relying on event order
isn't a best practice, but such a convinent one. jQuery guys would
understand me, because their events are always executing in defined order.

2010/4/15 Tom Gregory t...@byu.net

 I'm going to agree with others, and say a) this is not a bug, and b) isn't
 worth making the change. The observer pattern (on which the event
 architecture is based), by design, does not guarantee order; nor should it,
 as it would imply the observers are not orthogonal.

 If you have order dependencies, can I suggest reworking your code? One
 workaround Javascript provides is the ability to pass, assign, and wrap
 functions.  e.x.:

 var A = function() {alert('A');}
 var A2 = A;
 A = function() {alert('New A'); A2();}
 A();  // Alerts New A, then alerts A

 See also, Function#wrap in Prototype. [
 http://api.prototypejs.org/language/function/prototype/wrap/ ]

 If you choose that route, further questions on that feature should be sent
 to the users' group.


 TAG

 On Apr 15, 2010, at 11:51 AM, T.J. Crowder wrote:

  Hi,
 
  Why isn't this issue still
  fixed?!
 
  You say still. Is there an _open_ bug report for it in
  Lighthouse[1]? Because if there isn't, it's not going to be fixed.
 
  In any case, I don't think it would be a fix, it would be an
  enhancement. As far as I know, Prototype does not make any guarantee
  as to the order in which multiple event handlers on an element will be
  called (because there is no guarantee provided by the underlying
  APIs). To do so, Prototype would have to replace the browser's list of
  event observers with its own, which would be overkill (IMHO).
 
  [1] http://prototype.lighthouseapp.com/projects/8886-prototype/overview
  --
  T.J. Crowder
  Independent Software Consultant
  tj / crowder software / com
  www.crowdersoftware.com
 
 
  On Apr 15, 2:03 pm, Dziamid dzia...@gmail.com wrote:
  Event.observe(window, 'load', function () {
alert('1');});
 
  Event.observe(window, 'load', function () {
alert('2');});
 
  Firefox, opera alerts 1 then 2, IE alerts 2 THEN 1!! Order is
  reversed and developeres are puzzled! Why isn't this issue still
  fixed?!
 
  --
  You received this message because you are subscribed to the Google Groups
 Prototype: Core group.
  To post to this group, send email to prototype-core@googlegroups.com
  To unsubscribe from this group, send email to
 prototype-core-unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/prototype-core?hl=en
 
  To unsubscribe, reply using remove me as the subject.

 --
 You received this message because you are subscribed to the Google Groups
 Prototype: Core group.
 To post to this group, send email to prototype-core@googlegroups.com
 To unsubscribe from this group, send email to
 prototype-core-unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/prototype-core?hl=en


-- 
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en

Re: [Prototype-core] Re: Event.observe(window, 'load'.. issue not fixed!

2010-04-15 Thread Johan Arensman
Hello... Dziamid,

Please the tone of your message is far but polite. The developers of the
prototype project will do everything they can to address issues as they can.
It's not like they don't want to fix certain issues on purpose.

They are users also so if there are nasty bugs in prototype.js I'm sure they
will do every they can to get them out so they also get a better library.

A simple 'hello' and 'kind regards' would have been a lot nicer for everyone
to see in their mailbox. Yes, everyone receives this message, not only the
authors of prototype.js.

Greetings,
 Johan Arensman

On Thu, Apr 15, 2010 at 5:51 PM, T.J. Crowder t...@crowdersoftware.comwrote:

 Hi,

  Why isn't this issue still
  fixed?!

 You say still. Is there an _open_ bug report for it in
 Lighthouse[1]? Because if there isn't, it's not going to be fixed.

 In any case, I don't think it would be a fix, it would be an
 enhancement. As far as I know, Prototype does not make any guarantee
 as to the order in which multiple event handlers on an element will be
 called (because there is no guarantee provided by the underlying
 APIs). To do so, Prototype would have to replace the browser's list of
 event observers with its own, which would be overkill (IMHO).

 [1] http://prototype.lighthouseapp.com/projects/8886-prototype/overview
 --
 T.J. Crowder
 Independent Software Consultant
 tj / crowder software / com
 www.crowdersoftware.com


 On Apr 15, 2:03 pm, Dziamid dzia...@gmail.com wrote:
  Event.observe(window, 'load', function () {
alert('1');});
 
  Event.observe(window, 'load', function () {
alert('2');});
 
  Firefox, opera alerts 1 then 2, IE alerts 2 THEN 1!! Order is
  reversed and developeres are puzzled! Why isn't this issue still
  fixed?!

 --
 You received this message because you are subscribed to the Google Groups
 Prototype: Core group.
 To post to this group, send email to prototype-core@googlegroups.com
 To unsubscribe from this group, send email to
 prototype-core-unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/prototype-core?hl=en

 To unsubscribe, reply using remove me as the subject.


-- 
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en

Re: [Prototype-core] Re: Event.observe(window, 'load'.. issue not fixed!

2010-04-15 Thread Tom Gregory
I'm going to agree with others, and say a) this is not a bug, and b) isn't 
worth making the change. The observer pattern (on which the event architecture 
is based), by design, does not guarantee order; nor should it, as it would 
imply the observers are not orthogonal.

If you have order dependencies, can I suggest reworking your code? One 
workaround Javascript provides is the ability to pass, assign, and wrap 
functions.  e.x.:

var A = function() {alert('A');}
var A2 = A;
A = function() {alert('New A'); A2();}
A();  // Alerts New A, then alerts A

See also, Function#wrap in Prototype. [ 
http://api.prototypejs.org/language/function/prototype/wrap/ ]

If you choose that route, further questions on that feature should be sent to 
the users' group.


TAG

On Apr 15, 2010, at 11:51 AM, T.J. Crowder wrote:

 Hi,
 
 Why isn't this issue still
 fixed?!
 
 You say still. Is there an _open_ bug report for it in
 Lighthouse[1]? Because if there isn't, it's not going to be fixed.
 
 In any case, I don't think it would be a fix, it would be an
 enhancement. As far as I know, Prototype does not make any guarantee
 as to the order in which multiple event handlers on an element will be
 called (because there is no guarantee provided by the underlying
 APIs). To do so, Prototype would have to replace the browser's list of
 event observers with its own, which would be overkill (IMHO).
 
 [1] http://prototype.lighthouseapp.com/projects/8886-prototype/overview
 --
 T.J. Crowder
 Independent Software Consultant
 tj / crowder software / com
 www.crowdersoftware.com
 
 
 On Apr 15, 2:03 pm, Dziamid dzia...@gmail.com wrote:
 Event.observe(window, 'load', function () {
   alert('1');});
 
 Event.observe(window, 'load', function () {
   alert('2');});
 
 Firefox, opera alerts 1 then 2, IE alerts 2 THEN 1!! Order is
 reversed and developeres are puzzled! Why isn't this issue still
 fixed?!
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Prototype: Core group.
 To post to this group, send email to prototype-core@googlegroups.com
 To unsubscribe from this group, send email to 
 prototype-core-unsubscr...@googlegroups.com
 For more options, visit this group at 
 http://groups.google.com/group/prototype-core?hl=en
 
 To unsubscribe, reply using remove me as the subject.

-- 
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en