I've been maintaining the jQuery tools plugins over at http://drupal.org/project/jquery_plugin for a while. Actually since before they were bundled as "jQuery Tools"

Comments

lennyaspen’s picture

no mfb
it`s not a duplicate but you can read this article on the matter

  • http://marcgrabanski.com/article/jquery-tools-vs-jquery-ui
  • i think there is a lot of serious discussion there
    since then i`ve been waiting its integration in drupal
    cause i think is a great user friendly not lot of configuration necessary module
    as i am not a developer it helps me a lot

    robloach’s picture

    Hi mfb. I was considering submitting a patch to add these to the jQuery Plugin module, but then I considered that the jQuery Tools is its own jQuery family all from the same package. Its its own set of tools from the same library.

    I also wanted to make it so that you could send the context of what you were doing to the plugin itself. If you were adding a scrollable element, I wanted to be able to send the settings in from PHP, and use the Drupal JavaScript behaviors process them. Seeing how all of the jQuery Tools use a very similar API for each one, this made it very easy.

    If you have a look at jquerytools.js, you'll see that we apply the effects of any of the tools through Drupal.settings. This means that from PHP you can call:

      jquerytools_add('scrollable', '#scrollable', array('vertical' => TRUE));
    

    ...And a vertical scrollable tool will be added to $("#scrollable") through the JavaScript Drupal behaviour without needing to add any custom theming or inline JavaScript.

    Some of the ones provided by jQuery Plugin are weird ones though, since some of them have moved to jQuery Tools projects. Thoughts?

    mfb’s picture

    OK. well if you want to submit a patch for the PHP part of it to jquery_plugin that would be ok with me, as I do see how that is useful.

    If you do continue maintaining the plugins in this project then I can remove them after some time (although I've already been using the plugins on various custom modules and themes and others have too, so I don't think I should do that on the same branch).

    robloach’s picture

    I just gave you CVS access on the jQuery Tools project as well, just in case. The jQuery Tools projects can't move from the 6.x-1.x-dev branch of jQuery Plugins because if the API changes, the custom modules and themes you mentioned would brake. You'd have to open up a 6.x-2.x-dev ;-) .

    jQuery Tools modules also doesn't deprecate jQuery Plugins either, since the jQuery Plugins module provides some additional plugins (MetaData, Image Zoom, etc). They can live side-by-side. Where we can have a API bridge between the two though, is jQ.

    Thanks a lot, mfb!

    mfb’s picture

    Actually it seems ok to add the $selector = NULL, $options = NULL arguments to jquery_plugin_add() since they would be optional arguments. At least, it theoretically shouldn't break any pre-existing modules and themes...

    Most of the plugins in jquery_plugin module use the same syntax, e.g. $("#selector").validate(options) and $("#selector").cycle(options) so it's a good fit.