I know that the base Rails installation uses the great prototype library for it''s AJAX support as well as the script.aculo.us scripts for the effects code. I was looking at the prototype website and noticed that there is another framework based off of it called "Rico." Has any one integrated this with their application? Have you had any trouble with conflicts with the other scripts? The reason I want to try this other framework is it''s support of "Nifty Corners"-like rounded corners. It''s nice to not have to spend the time putting together tables and work in photoshop to have nice rounded corners automatically, not to mention the bandwidth saved by not using images to round corners. Thanks, Josh
Ooh! how does that work? Julian. On 30/08/2005, at 12:04 AM, Josh Charles wrote:> I know that the base Rails installation uses the great prototype > library for it''s AJAX support as well as the script.aculo.us scripts > for the effects code. I was looking at the prototype website and > noticed that there is another framework based off of it called "Rico." > Has any one integrated this with their application? Have you had any > trouble with conflicts with the other scripts? > > The reason I want to try this other framework is it''s support of > "Nifty Corners"-like rounded corners. It''s nice to not have to spend > the time putting together tables and work in photoshop to have nice > rounded corners automatically, not to mention the bandwidth saved by > not using images to round corners. > > Thanks, > Josh > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
I used both without any problems. On 8/29/05, Josh Charles <josh.charles-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I know that the base Rails installation uses the great prototype > library for it''s AJAX support as well as the script.aculo.us scripts > for the effects code. I was looking at the prototype website and > noticed that there is another framework based off of it called "Rico." > Has any one integrated this with their application? Have you had any > trouble with conflicts with the other scripts? > > The reason I want to try this other framework is it''s support of > "Nifty Corners"-like rounded corners. It''s nice to not have to spend > the time putting together tables and work in photoshop to have nice > rounded corners automatically, not to mention the bandwidth saved by > not using images to round corners. > > Thanks, > Josh > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Since it was the first time I heard of Rico, I went to the site, downloaded the scripts and played a little (that was like 2 hours ago) While the Mozilla/Firefox support is very nice, there are some problems in IE. I had to debug the script to find out that Rico.Color.createColorFromBackground assumes that the color is something like #aabbcc. var bluePart = parseInt(actualColor.substring(5), 16); Well, I had <div style="background-color:#ddd"> That, combined with the fact that it has no validation on the result, the resulting color (once Rico parsed it) was "dd0dNan". So assuming that whoever is working on Rico, reads this, go ahead and fix RicoUtil.getElementsComputedStyle ;) Bogdan On 8/30/05, Cuong Tran <cuong.tran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I used both without any problems. > > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi there, I''ve had issues with the Prototype library in PHP. The library is built using javascript Object.prototype. This something in case you are not familiar with JS object model that will propagate to *absolutely all* JS objects being created. I noticed this conflict with PEAR::Quickform, which has an automated hierachical select box, using JavaScript to create a set of Option drop-downs, where the second optionbox contents depends upon the option from the first box that is selected. Because Prototype has been written in this fashion, it is over-riding the options and adding it''s own gumf to the PEAR javascript, causing the first line of the Drop-down box looking something like this: "function(object) {..." This problem would also purtain to Ruby on Rails (which has prototype built in, apparently). I have e-mailed the creator of Prototype (Sam Conio), but have had no response from him. I would appreciate comments on this. Thanks, Noel da Costa Lead Developer Magnet Harlequin -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Josh Charles Sent: Monday, August 29, 2005 3:05 PM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: [Rails] Javascript Libraries I know that the base Rails installation uses the great prototype library for it''s AJAX support as well as the script.aculo.us scripts for the effects code. I was looking at the prototype website and noticed that there is another framework based off of it called "Rico." Has any one integrated this with their application? Have you had any trouble with conflicts with the other scripts? The reason I want to try this other framework is it''s support of "Nifty Corners"-like rounded corners. It''s nice to not have to spend the time putting together tables and work in photoshop to have nice rounded corners automatically, not to mention the bandwidth saved by not using images to round corners. Thanks, Josh _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails ___________________________________________________________________ This message has been scanned by the Datanet MessageScreen Service. For more information please visit http://www.MessageScreen.co.uk
On 9/19/05, Noel <noel.dacosta-6XoTs0aBwg0qdlJmJB21zg@public.gmane.org> wrote:> Hi there, > > I''ve had issues with the Prototype library in PHP. > > The library is built using javascript Object.prototype. This something in > case you are not familiar with JS object model that will propagate to > *absolutely all* JS objects being created. > > I noticed this conflict with PEAR::Quickform, which has an automated > hierachical select box, using JavaScript to create a set of Option > drop-downs, where the second optionbox contents depends upon the option from > the first box that is selected. > > Because Prototype has been written in this fashion, it is over-riding the > options and adding it''s own gumf to the PEAR javascript, causing the first > line of the Drop-down box looking something like this: > > "function(object) {..." > > This problem would also purtain to Ruby on Rails (which has prototype built > in, apparently). > > I have e-mailed the creator of Prototype (Sam Conio), but have had no > response from him. > > > I would appreciate comments on this. > > > > Thanks, > Noel da Costa > Lead Developer > Magnet Harlequin > >Javascript has a way to iterate through all properties of an object(the keys) like this: for (x in obj) {...} Since, as you noticed, all js objects inherit from Object, if you change it''s prototype, all the code that uses for x in obj will get the new unwanted methods or properties. You can use obj.hasOwnProperty(x) to check if the property is inherited or not, but that doesn''t quite work across all browsers. you can... - don''t use for x in obj :). usually you can use normal array traversing instead (this usually works, since for x in obj tends to be used for normal arrays too, and prototype.js adds a lot to Array.prototype) - find out what methods are added to Object, keep them somewhere and always check them when using for x in obj - if you know what is added to Object and skip those elements (usually, there are only functions) Regards -- Cristi BALAN
Noel wrote:> I noticed this conflict with PEAR::Quickform, which has an automated > hierachical select box, using JavaScript to create a set of Option > drop-downs, where the second optionbox contents depends upon the option from > the first box that is selected. > > Because Prototype has been written in this fashion, it is over-riding the > options and adding it''s own gumf to the PEAR javascript, causing the first > line of the Drop-down box looking something like this: > > "function(object) {..." > > This problem would also purtain to Ruby on Rails (which has prototype built > in, apparently).As far as I''m aware this wouldn''t affect your average Rails form, because it''s easier to do an AJAX update of the second select than to do a multilevel Javascript subselector, so people probably aren''t building their forms the same way that PEAR::Quickform does. At least, I''ve never run into a conflict, for what that''s worth... -- Alex
Prototype 1.4.0 fixes this. Get the beta here: http://dev.conio.net/repos/prototype/pkg/ Thomas Am 19.09.2005 um 19:33 schrieb Cristi BALAN:> Javascript has a way to iterate through all properties of an > object(the keys) like this: > for (x in obj) {...} > > Since, as you noticed, all js objects inherit from Object, if you > change it''s prototype, all the code that uses for x in obj will get > the new unwanted methods or properties. You can use > obj.hasOwnProperty(x) to check if the property is inherited or not, > but that doesn''t quite work across all browsers. > you can...