I just wrote a stupid little JS object to rotate DOM Elements (mainly images) using Prototype and Script.aculo.us as support. Everything seems to work well on IE and Firefox Linux but on FireFox Windows I am getting a slight flash prior to transition. I was wondering if a effects guru could take a quick look and see if anything jumps out. I can live with the flash for my current project but it would be great if I could get rid of it. The source code is freely available at: http://afaik.us/element_rotate/rotate_test.html and is not licensed (public domain). Anybody can feel free to use it if they want. Eric
Subject correction. Guess I am just so used to IE being the one that gives me problems. :) Eric
Can you put up a public example of this in action so that we don''t have to setup the code ourselves to see it? On 5/19/06, Eric Anderson <eric-ANzg6odk14w@public.gmane.org> wrote:> I just wrote a stupid little JS object to rotate DOM Elements (mainly > images) using Prototype and Script.aculo.us as support. Everything seems > to work well on IE and Firefox Linux but on FireFox Windows I am getting > a slight flash prior to transition. > > I was wondering if a effects guru could take a quick look and see if > anything jumps out. I can live with the flash for my current project but > it would be great if I could get rid of it. > > The source code is freely available at: > http://afaik.us/element_rotate/rotate_test.html > > and is not licensed (public domain). Anybody can feel free to use it if > they want. > > Eric > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
Ok, forget that message. Somebody already posted that in another thread for this. On 5/19/06, Andrew Kaspick <akaspick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Can you put up a public example of this in action so that we don''t > have to setup the code ourselves to see it? > > On 5/19/06, Eric Anderson <eric-ANzg6odk14w@public.gmane.org> wrote: > > I just wrote a stupid little JS object to rotate DOM Elements (mainly > > images) using Prototype and Script.aculo.us as support. Everything seems > > to work well on IE and Firefox Linux but on FireFox Windows I am getting > > a slight flash prior to transition. > > > > I was wondering if a effects guru could take a quick look and see if > > anything jumps out. I can live with the flash for my current project but > > it would be great if I could get rid of it. > > > > The source code is freely available at: > > http://afaik.us/element_rotate/rotate_test.html > > > > and is not licensed (public domain). Anybody can feel free to use it if > > they want. > > > > Eric > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >
There is one. It is that small green dome. I missed it too the first time but then I started reading the documentation and noticed there was a slick little globe rotating images... -Andrew Martinez -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Andrew Kaspick Sent: Friday, May 19, 2006 5:25 PM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] Content Rotate, unwanted flashing on IE. Can you put up a public example of this in action so that we don''t have to setup the code ourselves to see it? On 5/19/06, Eric Anderson <eric-ANzg6odk14w@public.gmane.org> wrote:> I just wrote a stupid little JS object to rotate DOM Elements (mainly > images) using Prototype and Script.aculo.us as support. Everything seems > to work well on IE and Firefox Linux but on FireFox Windows I am getting > a slight flash prior to transition. > > I was wondering if a effects guru could take a quick look and see if > anything jumps out. I can live with the flash for my current project but > it would be great if I could get rid of it. > > The source code is freely available at: > http://afaik.us/element_rotate/rotate_test.html > > and is not licensed (public domain). Anybody can feel free to use it if > they want. > > Eric > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Oh, that kind of rotate. :) I saw that there too, but was looking for something that was actually rotating images, like rotating an object 10 degree, etc. Gotcha On 5/19/06, Martinez, Andrew <Andrew.Martinez-9sMr025MA47QT0dZR+AlfA@public.gmane.org> wrote:> There is one. It is that small green dome. I missed it too the first time but then I started reading the documentation and noticed there was a slick little globe rotating images... > > -Andrew Martinez > > -----Original Message----- > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Andrew Kaspick > Sent: Friday, May 19, 2006 5:25 PM > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: Re: [Rails-spinoffs] Content Rotate, unwanted flashing on IE. > > Can you put up a public example of this in action so that we don''t > have to setup the code ourselves to see it? > > On 5/19/06, Eric Anderson <eric-ANzg6odk14w@public.gmane.org> wrote: > > I just wrote a stupid little JS object to rotate DOM Elements (mainly > > images) using Prototype and Script.aculo.us as support. Everything seems > > to work well on IE and Firefox Linux but on FireFox Windows I am getting > > a slight flash prior to transition. > > > > I was wondering if a effects guru could take a quick look and see if > > anything jumps out. I can live with the flash for my current project but > > it would be great if I could get rid of it. > > > > The source code is freely available at: > > http://afaik.us/element_rotate/rotate_test.html > > > > and is not licensed (public domain). Anybody can feel free to use it if > > they want. > > > > Eric > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
So, basically it does a subset of what I put on the list a few months back, which I made for my wife''s photography site. http://www.rachelamandahill.com Source here: http://www.rachelamandahill.com/content/jbhv/web/default/js/scriptaculou s/slideshow.js Anyhoo, I didn''t notice a flicker on Firefox 1.5.3 on Windows XP. Are you using an older version of Firefox? I know some things had problems on 1.0.x. Greg> -----Original Message----- > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org[mailto:rails-spinoffs-> bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Andrew Kaspick > Sent: Friday, May 19, 2006 3:31 PM > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: Re: [Rails-spinoffs] Content Rotate, unwanted flashing on IE. > > Oh, that kind of rotate. :) I saw that there too, but was looking for > something that was actually rotating images, like rotating an object > 10 degree, etc. > > Gotcha > > On 5/19/06, Martinez, Andrew <Andrew.Martinez-9sMr025MA47QT0dZR+AlfA@public.gmane.org> wrote: > > There is one. It is that small green dome. I missed it too the first > time but then I started reading the documentation and noticed therewas a> slick little globe rotating images... > > > > -Andrew Martinez > > > > -----Original Message----- > > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails- > spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Andrew Kaspick > > Sent: Friday, May 19, 2006 5:25 PM > > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > Subject: Re: [Rails-spinoffs] Content Rotate, unwantedflashing> on IE. > > > > Can you put up a public example of this in action so that we don''t > > have to setup the code ourselves to see it? > > > > On 5/19/06, Eric Anderson <eric-ANzg6odk14w@public.gmane.org> wrote: > > > I just wrote a stupid little JS object to rotate DOM Elements(mainly> > > images) using Prototype and Script.aculo.us as support. Everything > seems > > > to work well on IE and Firefox Linux but on FireFox Windows I am > getting > > > a slight flash prior to transition. > > > > > > I was wondering if a effects guru could take a quick look and seeif> > > anything jumps out. I can live with the flash for my currentproject> but > > > it would be great if I could get rid of it. > > > > > > The source code is freely available at: > > > http://afaik.us/element_rotate/rotate_test.html > > > > > > and is not licensed (public domain). Anybody can feel free to useit> if > > > they want. > > > > > > Eric > > > > > > _______________________________________________ > > > Rails-spinoffs mailing list > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Andrew Kaspick wrote:> Oh, that kind of rotate. :) I saw that there too, but was looking for > something that was actually rotating images, like rotating an object > 10 degree, etc.Nope, nothing fancy. Like I said in my post. Just a stupid little object to remove some need for Flash. Eric
OK trying to say this as tactfully as possible, because it's not targeted specifically at this script, it only serves as a useful example. A lot of people are releasing useful scripts based on Prototype, wich is great and you get a real sense of a healthy ecosystem developing. BUT Prototype does some things in the global namespace that some might consider naughty. That's not really a problem when you want to use Prototype for everything. However it seems to encourage others, myself included, to do likewise. This can only create a huge mess as everyone tries to muck around treading on each others global namespace claims. I propose that all contributors of Prototype based user scripts create their on namespaced objects and leave the global namespace to Prototype. I'd go a little further and suggest for sanity's sake we also leave any namespace created by Prototype well alone too. This image rotation script, while useful, I would not be confident in using because it, adds to the Prototype Element object, it adds to the Prototype object, it adds an image cache to the String object (???). If everyone wrote scripts like this it may well be incompatibility hell to use a bunch of them together. So I say lets all play it safe and leave the global namespace pollution to Prototype :) and write scripts that use Prototype but wont cause problems for each other. On 20/05/06, Andrew Kaspick <akaspick@gmail.com> wrote:> Oh, that kind of rotate. :) I saw that there too, but was looking for > something that was actually rotating images, like rotating an object > 10 degree, etc. > > Gotcha > > On 5/19/06, Martinez, Andrew <Andrew.Martinez@paetec.com> wrote: > > There is one. It is that small green dome. I missed it too the first time but then I started reading the documentation and noticed there was a slick little globe rotating images... > > > > -Andrew Martinez > > > > -----Original Message----- > > From: rails-spinoffs-bounces@lists.rubyonrails.org [mailto:rails-spinoffs-bounces@lists.rubyonrails.org] On Behalf Of Andrew Kaspick > > Sent: Friday, May 19, 2006 5:25 PM > > To: rails-spinoffs@lists.rubyonrails.org > > Subject: Re: [Rails-spinoffs] Content Rotate, unwanted flashing on IE. > > > > Can you put up a public example of this in action so that we don't > > have to setup the code ourselves to see it? > > > > On 5/19/06, Eric Anderson <eric@afaik.us> wrote: > > > I just wrote a stupid little JS object to rotate DOM Elements (mainly > > > images) using Prototype and Script.aculo.us as support. Everything seems > > > to work well on IE and Firefox Linux but on FireFox Windows I am getting > > > a slight flash prior to transition. > > > > > > I was wondering if a effects guru could take a quick look and see if > > > anything jumps out. I can live with the flash for my current project but > > > it would be great if I could get rid of it. > > > > > > The source code is freely available at: > > > http://afaik.us/element_rotate/rotate_test.html > > > > > > and is not licensed (public domain). Anybody can feel free to use it if > > > they want. > > > > > > Eric > > > > > > _______________________________________________ > > > Rails-spinoffs mailing list > > > Rails-spinoffs@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-- Andrew _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Andrew Tetlaw wrote:> OK trying to say this as tactfully as possible, because it''s notI welcome feedback. Javascript can be a difficult language to develop in so I am always looking for ways to improve things. [...snip info about prototype''s use of globals...]> This can only create a huge mess as everyone tries to muck around > treading on each others global namespace claims.Yes namespace really can be a problem in Javascript. I have encountered the problem first-hand.> I propose that all contributors of Prototype based user scripts create > their on namespaced objects and leave the global namespace to > Prototype. I''d go a little further and suggest for sanity''s sake we > also leave any namespace created by Prototype well alone too.The problem seems to me an issue of convenience vs compatibility. Java uses the organization name (us.afaik.blah.blah.blah) to organize the namespace. So if we went that route I could define an object called: us.afaik.effects.Element.Rotate This would ensure separation of namespaces but isn''t very convenience to work with. Also, Javascript is unique in that everything must be downloaded to the client. This means we want to avoid unnecessary code if possible. To me if you look even deeper there is also another harm in creating ridged namespaces as in Java. I find there to be a synergy in being able to share namespaces from separate projects. I see the issue as needing balance. Sharing namespace across projects encourages good OO code in some cases. Othertimes it just causes problems. Instead of doing: (new us.afaik.util.String(''<img src="foo.gif" />'')).preloadImgs() or handing it in a procedural manor: us.afaik.util.String.preloadImgs(''<img src="foo.gif" />''); I can just write clean OO code that does: ''<img src="foo.gif" />''.preloadImgs(); I see this as a good use of adding to the built-in objects. It allows any code that is working with my library to easily preload any images defined in a string. They don''t have to interact with a special string object (the Java way) and they don''t have to use procedural code. They just call an method on an object. But like everything it must be done in moderation. To me the test is are you doing something that another developer would expect? Take for example: String.prototype.replace = function() { return ''''; } This is bad! Although for some odd reason it may be what you need it will not be what other applications expect. On the other hand: String.prototype.trim = function() { return this.replace(/^\s+/, '''').replace(/\s+$/, '''') } This is good! Because it allows a programmer to call a trim() method on any string object (no matter how that object was created) which does what a programmer expects. Even if another library defines a trim method it may be different in implementation but the basic concept will be the same. In both cases we defined a method on a built-in object. The differences is in how we used that power. The first case we did something that a developer would not expect, while the second did something a developer would expect. The same thing applies to building on existing objects in Prototype (or any other library). Assume that we build our extensions in a way that is obvious we will avoid problems while still getting great synergy. The other consideration to make is the scope of the project. A project like Prototype or Script.aculo.us has to be more careful because it is complex and used in a wide variety of environments. On the other hand my stupid object is a simple 123 lines of code. If you do encounter a conflict it is small enough to maintain a simple patch that avoids the conflict. I also welcome any changes that might need to be made to avoid conflicts with an existing library.> This image rotation script, while useful, I would not be confident in > using because it, adds to the Prototype Element object, it adds to the > Prototype object, it adds an image cache to the String object (???).I said previously that adding to core objects and objects in other libraries is a balance. Did I make the right choices? Probably not completely but I can fix anything that pops up. In general I feel that the code I added to existing objects is in the spirit of those objects (Prototype.ImageTag matches Prototype.ScriptTag, String.extractImgs matches String.extractScripts, etc.). Even the "Rotate" property added to the Element object to store my object is reasonable (what else would rotate mean?). But I don''t begrudge anybody for thinking it is too liberal. Just a design choice. Just my two cents. I welcome comments from others. Eric
Gregory Hill wrote:> So, basically it does a subset of what I put on the list a few months > back, which I made for my wife''s photography site.Yes this is much more comprehensive than Element.Rotate. I had searched around the web before creating Element.Rotate. Didn''t find anything and knew it would be a quick script with Prototype and Script.aculo.us. Too bad I missed your post. Thanks for the pointer though. Eric