[Catalyst] html::prototype syntax in new Cat version

John Napiorkowski jjn1056 at yahoo.com
Tue Jul 10 17:42:35 GMT 2007


--- John Wang <johncwang at gmail.com> wrote:

> On 7/10/07, J. Shirley <jshirley at gmail.com> wrote:
> >
> >
> > prototype.js and friends (scriptaculous, openrico,
> etc) are rated the
> > lowest in those categories.  It fails the robust
> check by having
> > several things that don't play nice together, and
> also I've seen some
> > serious cross-browser compatibility issues. 
> Standardization is
> > probably the biggest gripe people have with
> prototype.js.  It doesn't
> > encapsulate and clobbers existing objects or adds
> on to them in weird
> > ways (like arrays).  As an example, if you use
> some effects in
> > scriptaculous, Google Maps fails to work because
> of their mouse
> > capturing code.
> 
> 
> Good to know. Do you know which Scriptaculous
> effects break Google Maps? It
> will be useful for planning for the future.
> 
> It's safe to say that inside of the Catalyst
> community, you will get
> > absolutely zero support if you chose to use
> Prototype.  You are free
> > to ask, but you will get flamed for your choice. 
> That's just the way
> > it goes.
> 
> 
> Some of the larger Catalyst-based sites use
> prototype (or parts of
> prototype) but the ones I've seen don't use Google
> Maps. Those projects also
> don't ask for prototype help from the Catalyst
> community. I think some of
> the flames given for prototype usage also prevent
> others from providing
> assistance. As you say, that's just the way it goes.
> 
> If you want alternatives, here are the more favored
> solutions that
> > have proven themselves to be of a quality
> Catalysters will bother
> > assisting with:
> > * Dojo - http://www.dojotoolkit.org/
> > * YUI - http://developer.yahoo.com/yui/
> > * jQuery - http://www.jquery.com/
> > * Mootools - http://mootools.net
> > * MochiKit - http://www.mochikit.com
> >
> > And, of course, there is Ext
> (http://www.extjs.com) which sits on top
> > of YUI and jQuery (and hopefully Dojo soon... and
> unfortunately
> > prototype.js, but it's a good way of getting your
> code away from
> > prototype and onto something higher quality.) and
> is more of a
> > "widget".
> >
> > Picking a quality JS lib is just as important as
> picking a quality
> > framework.
> 
> 
> I think one reason prototype keeps coming up is
> because HTML::Prototype
> exists and is the only wrapper providing Perl access
> to JS effects.
> HTML::Prototype doesn't seem to have a lot of
> functionality in it but it can
> get some small things going fast. If a
> HTML::$other_js_lib was created,
> especially with the same API, Prototype usage would
> probably stop. A
> HTML::JQuery might be useful. Just a thought.
> 

There is "http://search.cpan.org/~peterg/JQuery-1.06/"

which could meet those kinds of needs.

It's been said by others but I really prefer to do all
this in my templates.  It would be easy to have this
in a Template Toolkit plugin if you wanted, but I
can't see the value of basically using perl as a code
generator for Javascript.  I prefer to be closer to
the original API.  But that's my choice :)

--john


> -- 
> John Wang
> http://www.dev411.com/blog/
> > _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo:
> http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
>
http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
> 



 
____________________________________________________________________________________
We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 



More information about the Catalyst mailing list