Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Best Javascript framework to use with Textpattern?
More and more plugins now use Javascripts built above frameworks allowing to code more efficiently while solving cross-browser compatibility issues. However it would be nice if the plugins developers agree on a main framework that will be used whenever possible when writing plugins for Textpattern.
I’ve seen that JQuery has been added to Textpattern recently. Is this an official and definitive decision?
In the jungle of JS frameworks, here are the main choices:
- Prototype is one of the first and most used frameworks. It allows you to write your scripts as classes in an OO style. It’s a big download, about 50Kb uncompressed. It lacks effects, drag&drop and other fancy stuff so it is often used with Scriptaculous (a heavy all-purpose library) or Moo.fx (a tiny effects library, the new version does not use Prototype anymore, see below).
- JQuery is a lightweight all-purpose library which is really powerful. Its main features are selectors, chained methods. It can be extended by many plugins. However, it is not designed to write classes like Prototype.
- Mootools is brand new and looks amazing. It is a mix between Prototype and JQuery that claims to use best of both worlds. It is entirely modulable and really compact (the total size when using all modules is equal to JQuery). It also allows you to create or extend classes in a really elegant way. Mootools includes the new version of Moo.Fx .
Being an OO programmer, I prefeir the approach of Prototype and Mootools over JQuery, despite its features. I like the idea of all code being wrapped in a single (or multiple) classes instead of global public methods for which you need to ensure that the name is unique to prevent possible conflicts between scripts. Of course I don’t like the large download size, that’s why I have Scriptaculous in horror and why I’m amazed at Moo.fx and now Mootools. Mootools is my current choice. Of course it is less “mature” than the other frameworks, but it uses many approved pieces of code and is currently actively developped by Valerio Proietti.
But the purpose of a forum is to discuss so I’m here to ask you two questions:
- What’s your favorite JS framework and why?
- What are the current Textpattern plugins using a JS framework and which one do they use?
Last edited by cbeyls (2006-09-21 00:21:39)
My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)
Offline
#2 2006-09-21 00:45:17
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Best Javascript framework to use with Textpattern?
Is this an official and definitive decision?
It’s tentative, like everything else in the crockery branch.
We settled on jQuery because it’s lightweight, doesn’t contain a bunch of stuff we don’t need, and seems the closest to Textpattern’s design philosophy (simple, small, reliable). It’s not perfect but sucks less than the others we considered. Mootools wasn’t one of those, this is the first I’ve heard of it.
Alex
Offline
#3 2006-09-21 01:59:08
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Best Javascript framework to use with Textpattern?
The library included is for core admin-side stuff. If you want to use it otherwise, go ahead. If not, then don’t.
Offline
#4 2006-09-22 02:04:01
- NyteOwl
- Member
- From: Nova Scotia, Canada
- Registered: 2005-09-24
- Posts: 539
Re: Best Javascript framework to use with Textpattern?
Personally I am coming to hate JS libraries. They are being overused and slowing down site load times often for little return in functionality. Just a mini-rant ;)
Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;
Offline
Re: Best Javascript framework to use with Textpattern?
For a JS library, jQuery is great, especially since it is 16kb vs 80+kb like other libraries (compressed, it’s ~9kb). I haven’t tried out Mootools yet, but from the few examples I’ve seen, don’t work in Opera.
Offline
Re: Best Javascript framework to use with Textpattern?
Actually I’m using Mootools right now to write a better version of Lightbox, and I have no issues with any browser. Can you show me the example that’s not working?
I agree that the file size is a good argument. That’s why I like Mootools too ;)
My plugins : cbs_live_search (improved) – cbs_category_list – cbs_navigation_menu – cbs_gravatar (updated) – cbs_article_index – cbs_maintenance_mode (new) – cbs_section_language (new)
Offline
Re: Best Javascript framework to use with Textpattern?
OK, I feel like an idiot. I came across an example earlier (J Snook’s), and swore it didn’t work, but it does now. Probably due to my high caching or something I changed in Opera.
Now that I know it works in all browsers, I think I’m switching :D. I just configured a full, high-compressed download: 8.8kb!
Offline
Re: Best Javascript framework to use with Textpattern?
jQuery, hands down. Chainability, extremely terse core code, tons of plugins available… a dream to work with.
Offline
Re: Best Javascript framework to use with Textpattern?
jamiew wrote:
jQuery, hands down. Chainability, extremely terse core code, tons of plugins available… a dream to work with.
ditto
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#10 2006-12-06 13:07:07
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: Best Javascript framework to use with Textpattern?
Mootools.. definitely. Though I haven’t tried jQuery. But writing scripts with mootools is amazingly simple.
Offline
Re: Best Javascript framework to use with Textpattern?
I will throw a vote for Mootools as well. Being a complete beginner in the world of .js libraries, Mootools is pretty simple to learn, use, and work with for me. I do not use the version that relies on Prototype so not sure there but all in all, I say Mootools.
Offline