Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-09-21 00:14:45

cbeyls
Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

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:

  1. What’s your favorite JS framework and why?
  2. 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
Website

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
tstate

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

#5 2006-09-22 02:18:55

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

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

#6 2006-09-23 01:47:03

cbeyls
Plugin Author
From: Brussels, Belgium
Registered: 2005-09-12
Posts: 136
Website

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

#7 2006-09-23 04:48:18

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

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

#8 2006-12-05 22:40:08

jamiew
Plugin Author
From: NYC
Registered: 2005-01-08
Posts: 74
Website

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

#9 2006-12-06 12:30:02

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,103
Website

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.org | hblack.net | LABS | State Machines | NeMe @ github

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

Board footer

Powered by FluxBB