[Proto-Scripty] Re: Extending Event has a Bug ?
On Dec 17, 11:52 pm, kangax kan...@gmail.com wrote: On Dec 17, 1:51 pm, fero elf...@gmail.com wrote: [...] I think it is quite a bug because I have to check for Prototype.Browser.IE variable. I'm pretty sure there's *no* bug in nonexistent `Event.addMethods` ; ) Yes, you are truly right ... it was just a joke :) Extending event objects is like playing with fire. This is meaningful :) Ok thank you for your answer BTW with function.methodize I didn't succeded too. fero --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Extending Event has a Bug ?
Hello, I'm pretty sure Prototype has a bug in adding methods to an Event. My code is: var MoreEventMethods = { absoluteOffsets : function (event) { var offset = this.pointer(); var scroll = document.viewport.getScrollOffsets(); return { left : offset.x + scroll.left, top : offset.y + scroll.top }; }, absoluteX : function (event) { var scroll = document.viewport.getScrollOffsets(); return event.pointerX() + scroll.left; }, absoluteY : function (event) { var scroll = document.viewport.getScrollOffsets(); return event.pointerY() + scroll.top; } }; if (Prototype.Browser.IE) { Object.extend(Event, MoreEventMethods); } else { Object.extend(Event.prototype, MoreEventMethods); } This is not in an onload window event handler, but I try to put it there and it does not work too. I think it is quite a bug because I have to check for Prototype.Browser.IE variable. If prototype supports IE and other browsers, in a very beautiful world I have never to do that check in my code :)) Futhermore would you please plan a method Event.addMethods ? Or at least give me some hints so I can develop it for the community ? (but I don't know if in this moment my javascript knowledge is enough) Thank you very much for all your work Listening for an answer... fero --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Is the new statement ever needed ?
On Dec 3, 3:19 pm, Jerod Venema [EMAIL PROTECTED] wrote: Follow the documentation. Those are classes, and do need the new. To avoid JSLint errors, simply use extra parens: (new Ajax.Request({foo:'bar'})); Thank you but I prefer to allocate a temp variable, since imo this is not too much lint :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: analogue clock?
Have you seen this ? I didn't tried but it seems wonderful :) http://randomibis.com/coolclock/ On Dec 3, 1:02 am, geoffcox [EMAIL PROTECTED] wrote: This is beautifully done! Cheers Geoff On Dec 2, 2:42 pm, Diodeus [EMAIL PROTECTED] wrote: This one's a classic and does it using native JavaScript. http://rainbow.arch.scriptmania.com/scripts/mouse_clock3.html On Dec 1, 5:55 pm, geoffcox [EMAIL PROTECTED] wrote: Hello, Is it possible to construct a javascript analogue clock using prototype/scriptaculous? In particular I want one where the speed of the hours/minutes/seconds hands can be increased/decreased. Cheers, Geoff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Is the new statement ever needed ?
As I read the Prototypejs documentation, I noticed that every example in using your classes begin with the new statement. So I have written all my code like new Ajax.Request , new Effect.SlideDown etc. This works very well for FF. Now I am porting my code to IE :( and as I got some (other) errors I discovered the wonderful a href=www.jslint.comJSLint/a which tells me that 'new' should not be used as a statement Since I don't really know too much of internals of Javascript: I was wondering if it is the same to do new Ajax.Request and Ajax.Request just to make JSLint not to bother me :) If it is the same, I think you should write a couple of lines in prototypejs documentation about this. Thank you very much fero --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Is Event.extend as smart as Element.extend ?
From http://prototypejs.org/learn/extensions: The extend() method is smart enough not to try to operate twice on the same element. What's even better, **the dollar function $() extends every element passed through it** with this mechanism. We are talking about Element.extend, but what about Event.extend ? is it smart enough too ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---