Hello, The latest (1.6.4) of script.aculo.us and its included prototype.js frequently uses JS variable ''window.opera'' but it is never defined in any of JS files. This causes exceptions in te Effects library and I spent a few hours to track it down. It is trivial to fix but this seems too obvious to be ignored by others. Did I miss something here? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Not sure where it''s being used, but I''d assume mostly in browser-specific functions that shouldn''t cause errors if you''re not using opera... http://www.howtocreate.co.uk/operaStuff/operaObject.html Do you have a particular line thats causing a problem? -Jerod On 10/22/06, Hacking Bear <hackingbear-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hello, > > The latest (1.6.4) of script.aculo.us and its included prototype.js > frequently uses JS variable ''window.opera'' but it is never defined in > any of JS files. This causes exceptions in te Effects library and I > spent a few hours to track it down. > > It is trivial to fix but this seems too obvious to be ignored by > others. Did I miss something here? > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Opera defined the variable by itself. If you open a new Opera-window and do a javascript:alert(window.opera) you''ll get [object Opera] back. Martin On 10/23/06, Hacking Bear <hackingbear-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello, > > The latest (1.6.4) of script.aculo.us and its included prototype.js > frequently uses JS variable ''window.opera'' but it is never defined in > any of JS files. This causes exceptions in te Effects library and I > spent a few hours to track it down. > > It is trivial to fix but this seems too obvious to be ignored by > others. Did I miss something here? > > > > >-- burnfield.com/martin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
I know it is defined for Opera but it is not dfined for IE! I can easily fix it by adding a line in prototyp.js if (typeof window.opera == ''undefined'') window.opera = false; But I hope it is added to the "official" release. This variable is used in many place. Do a grep. Example: Effect.Opacity = Class.create(); Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), { initialize: function(element) { this.element = $(element); if(!this.element) throw(Effect._elementDoesNotExistError); // make this work on IE on elements without ''layout'' if(/MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout)) this.element.setStyle({zoom: 1}); var options = Object.extend({ from: this.element.getOpacity() || 0.0, to: 1.0 }, arguments[1] || {}); this.start(options); }, update: function(position) { this.element.setOpacity(position); } }); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
On 10/23/06, Hacking Bear <hackingbear-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I know it is defined for Opera but it is not dfined for IE!And not in Safari, Firefox or any other browser.> can easily fix itFix what?> if(/MSIE/.test(navigator.userAgent) && !window.opera && > (!this.element.currentStyle.hasLayout))When window.opera is undefined, !window.opera evaluates to true. A script engine has no problem referencing an undefined variable, it just yields "undefined", a proper native JS type. When window.opera is undefined, accessing window.opera will not throw an error, but accessing window.opera.version would. Use the MS script debugger to find out what the real problem is. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---