Hi I wrote a small module that depends on the jQuery UI module. The module provides a simple administrative UI for specifying jQuery UI widgets and effects to load during page requests. I tried applying for a CVS account so I could create and maintain a Drupal project for this module but I was asked why I did not submit a feature request for the jQuery UI module instead. So I am doing that now. I've uploaded a ZIP file containing the module folder. Please take a look at the module and let me know if you would be interested in integrating this module's functionality into an updated release of the jQuery UI module or if I should continue to seek to maintain this module as a separate drupal project.

Comments

very good job! thank u.

Your welcome kervi, I hope you find the module useful, but... I would like for the jQuery UI module developer(s)/maintainer(s) to actually respond and advise whether they see my jQuery UI module as a viable feature addition to the jQuery UI project, either as a sub-module or by simply adding similar functionality to the jQuery UI module itself. I'm kind of in limbo here, Drupal CVS admins asked why I did not submit a feature request instead of writing this module so I have done what they suggested. I think this module's functionality would be very useful for some in the community. If jQuery UI's contributors don't see this as a viable feature request then I will let the CVS admins know and let them advise how I should proceed.

Hope I don't come across as pushy I just would like the feature provided by my module to actually be part of Drupal's vast array of contributed functionality.

Thanks all.

Version:6.x-1.3» 6.x-1.x-dev
Component:Miscellaneous» Code
Status:Active» Needs review

Hey ispheretechnologies I changed the status to see and properties to get the maintainers attention. I am sure they will review it when they get a chance, in the meantime I will take a look at it this week and post any issues if I find any.

Status:Needs review» Needs work

Needs an actual patch

Hey,

Thanks for this, this looks awesome!

@isphere, the .js is being called in my page and that's great...but I can't seem to be able to call js widgets. I've included the right behavior (in this case, ui.datepicker), with the default css file and a custom one from jquery ui's website.

What do you I do to call the elements?

Using the jquery demo this code works with standard html pages outside of drupal:

<script type="text/javascript">
$(function() {
$('#date').datepicker();
});
</script>
<input type="text" name="date" id="date" />

But that doesen't seem to be working within my pages, even though the right .js files are being called. Is there a special method I need to use with this module?

Thanks!

Subscribe

I ended up including these elements with a copy of jquery manually installed on my directory and that worked.

I also used instead of

@corona,

Thanks for the response on the module. The purpose of this module is just to allow you to administratively specify any number of jQuery UI widgets, effects and theme files to load during page requests. This was intentionally done to keep the module simple, small and lightweight, especially since it is meant to depend on jQuery UI module which is also simple and lightweight. To actually use the widgets/effects you will have to write your custom javascript code in your theme's source files to actually call the widgets/effects.

So for example, say you want to use some effects, you would specify them using the module's settings form, then say your theme has a javascript file that is loaded globally and defines javascript to be executed when the DOM loads you could put your code in there to call the effects.

Hope that's a clear explanation. Also remember that this module is not yet an official Drupal.org project or part thereof. I consider the module to be stable and I am using it in live sites I have developed. However I'm still waiting to see what will be it's fate in the Drupal world. So keep that in mind if you intend to use the module in a live site.

Oh, and all the best for 2010! :)

Works well with UI 1.7, very happy i found this module! Thank you @ispheretechnologies

"then say your theme has a javascript file that is loaded globally and defines javascript to be executed when the DOM loads you could put your code in there to call the effects."

Can you offer up some more details about how this is done? I cant seem to find a place to put the javascript code so that it makes it into the HEAD tags on the page.

Any ideas?

Thank for this great module! Made it easy to theme using UI!
If this is not included in jQuery UI, it is would make an excellent addon module!!!

Thanks again @ispheretechnologies!

One suggestion. You might want to add instances to the admin settings. That way, if you are using different widgets and effects on different pages, you can specify the js files and which pages to load it on. As it stands, you have to load all the js files on every page you are adding a widget to.

This is an excellent module. While I was able to use the JQuery UI module for my specific module, I was having trouble including jquery ui in all of my pages. This module saved the day!

:) David

StatusFileSize
new644 bytes

wow happy i found this little add on module. Saved a lot of time. I changed 2 things,
changed default/ui.all.css to base/ui.all.css since jquery ui 1.7 uses that for the folder name.
Also I needed to be able to load JUST a css file without loading a "Files to Load". So I changed the if statement that checks to make sure a "Files to Load" was entered as well as a css.
Attached is a patch. First time making a patch so i'm not sure if i did it correctly.

+1 for integrating this with the jquery_ui module - I needed a little tweak, and it was great to just put it in my theme's js rather than having to create a module to do it

thanks to OP for doing the work!

Hi everyone,

Thanks for all the positive feedback about this module. I was feeling a bit disheartened when my CVS application to maintain this as a separate project was declined and also due to the fact that I have not yet had any reponse from the jQuery UI module maintainers on if they wish to incorporate this as a (possible) sub-module of that project.

I have decided to write an update to this module to incorporate everyone's feedback and suggestions, especially the feedback from @ndwilliams3 and @gooddesignusa.

@j0k3z - The update I will be making to this module will actually help solve your problem. With this update you will be able to put all your js to create/manipulate the widgets in the administrative UI that will be provided as well. That way you'll just be able to use the admin UI to load the widgets and effects and to create and use them; there will be no need to write the custom JS that creates/uses the widgets/effects in any of your theme files. You will still be able to go that way if you wish but the facility will be in place to add that custom JS in the module's admin UI.

@ndwilliams3 - The ability to add instances to the admin settings is an excellent idea, this is why I love open source, it really shows much much better our software can get by putting our minds together. I will be providing this ability in the update as well.

@gooddesignusa - I'll have a look at the patch. Thanks!

Again, thanks everyone for the support and feedback, and let's hope that with the update to this module maybe it will find it's way into the jQuery UI project as a sub-module or into the Drupal repository as a separate Drupal project.

StatusFileSize
new158.7 KB

This might be a pain to change how it works but i think this would be a wonderful feature. I will try to explain this clearly but if i fail please let me know haha.

What if the admin /admin/settings/jquery_ui_loader was set up in a way that you could Add another Item. So imagine all those settings were in a fieldset and you could add another item. This would allow you to have different things load on different pages. Instead of it being global.

I tried to make a real simple photoshop example. Obviously would set up the fieldsets a little different but you get the idea.

@gooddesignusa - You hit the nail right on the head, that's exactly what @ndwilliams3 was suggesting as well, so it seems we all have the same idea on how this module can be improved upon. The PNG illustrates the right idea too, although I would probably rename the 'Add Another Item' button to 'Add Another Instance' so as to clearly inform the administrator that they are adding a new jQuery UI Loader instance. Aside from that, right on the ball.

I'm going to spend some time working on the update to the module over the weekend, I've pretty busy finishing up some tasks this week so it'll have to wait till the weekend.

Thanks again everyone!

+1, great idea!
Subscribing

Great add on! +1 for including it

This is what I needed, thank-you!

Great work, thanks!

StatusFileSize
new14.37 KB

Created a patch file based on ispheretechnologies zip file.

Status:Needs work» Needs review

if whoever if using this loader, can test the patch file, make sure it applies, and that the module works, then change the issue status to reviewed and tested by the community. This will help the issue get reviewed faster by the module maintainers.

Also ispheretechnologies if you want to be a co-maintainer, maybe fill out a separate issue in this module queue, specifically asking to be a co-maintainer.

Then when you get approval, go back to the cvs maintainer issue, and link the issue to it.

The jQuery UI library may not be under the module's directory. For example, it may be under a libraries directory. There is a pending patch that adds this ability to the module: #489140: Libraries API

That patch adds a function called jquery_ui_get_path() to handle the different possible locations of the library files. This loader module should make use of that function instead of drupal_get_path().

So in jquery_ui_loader.module on line 94:
drupal_add_css(drupal_get_path('module', 'jquery_ui') . "/jquery.ui/themes/$a_file");
can be changed to
drupal_add_css(jquery_ui_get_path() . "/themes/$a_file");

@ispheretechnologies thanks for the awesome module! :)
@aufumy thanks for the patch

Here is aufumy's patch from #23 with the changes I mentioned in #26.
WARNING: This version of the patch will only work if you have first applied the patch from #489140: Libraries API. If you haven't applied the Libraries API patch, just use the patch from #23.

Does it matter what version of jQuery I use with this?

@ aufumy Is this patch the same as the module?

great stuff, it made my life so easy, this is what a cms is all about. many thanks

subscribe

What happened to this module?
It's great.

I was having trouble getting jquery ui to work from my theme and the jquery UI documentation really is not veyr helpful.

Then I add this module and everything works.
What happened to it>
Either it should have become its own module or the peeps at Jquery UI integrate it.

Love this module

This patch doesn't patch the JQuery UI module; it just creates the separate JQuery UI Loader module. I agree that this should be committed to JQuery UI rather than added as a separate module. You're better off just downloading and installing the original .zip. This is great functionality, though, and shouldn't be hard to integrate with JQuery UI.

Subscribe

Thanks so much for this. It's been a big time-saver for me.

Any thoughts on adding Context support?