Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Bobuido’s picture

The DL URL in the README.TXT

http://code.google.com/p/jquery-ui/downloads/list?can=3&q=1.6

Appears to be broken. Search result returned nothing. I had a copy of 1.6 as I'd recently downloaded it but wondered if 1.8 could be used with the current stable Drupal module

Guess it's coming :)

Bobuido’s picture

Just spotted the bit in the README.TXT after the URL

Seems you can upgrade to 1.7 but you need jquery_update

See README.TXT for details

RobLoach’s picture

Status: Active » Postponed
joelstein’s picture

jQuery UI 1.6 can be found here:
http://code.google.com/p/jquery-ui/downloads/list

FiNeX’s picture

Does exist any plan about the upgrade to the new 1.8 version? Thanks!

BoogieBug’s picture

jQuery UI 1.8 package put a prefix 'jquery.ui' in front of all files. Right now, the new names are in the format of "jquery.ui..js" rather than the existing "ui..js". If version 1.8 is critical for you, patching the jquery_ui module by put 'jquery.' prefix to the file name in lines: 63, 70 and 75 would be a work-around for this issue.

bmcmurray’s picture

Status: Postponed » Active

jQuery UI 1.8.4 only requires jQuery 1.3.2+.

bmcmurray’s picture

FileSize
960 bytes

Attached is a patch for jquery_ui.module that adds in a version check. If you are using jQuery UI 1.8.x, the naming convention of the files changed from ui.component to jquery.ui.component. This patch will let the module work with older versions of jQuery UI but also supports the 1.8.x release.

imclean’s picture

#8 works for me, thanks bmcmurray.

broucaries’s picture

I use patch 8 but it will be nice if we could use another means to detect version than parsing a txt file (taht is absent on debian).

jquery.ui.version variable has the correct version.

Bastien

domineaux’s picture

Here is a link when using Drupal 6 and using later version of jquery ui

http://acquia.com/node/1183045

imclean’s picture

Bastien, the jQuery UI package includes the file version.txt. Download it from http://jqueryui.com/

In this case, querying jquery.ui.version won't work because the version of jQuery UI needs to be known before it can be loaded.

dreadlocks1221’s picture

Edit: Solved my issue

neochief’s picture

Status: Active » Needs review
FileSize
2.04 KB

Here's the complete patch, which supports all versions with maximum compatibility. I guess this should be commuted very soon, as there are ton of complaining issues regarding this problem. Patch forks for both 6.x and 7.x

recrit’s picture

Status: Needs review » Needs work

Naming convention is not the only change from 1.7 to 1.8.
There are new dependencies in 1.8 for some widgets, for example slider.

jquery.ui.slider.js
http://jqueryui.com/demos/slider/
- jquery.ui.mouse.js
- jquery.ui.widget.js

bmcmurray’s picture

Status: Needs work » Needs review

I don't believe that jquery_ui_add() ever did anything to account for the specific requirements of widgets like the slider, that has always been the responsibility of the implementor to make sure that all widget requirements are provided. If there are other contrib modules that require the jQuery UI module, patches should be submitted to their modules that also implement a similar check of the jQuery UI version and provide the different widget requirements. (For instance, see: http://drupal.org/node/881472 and http://drupal.org/node/893526)

recrit’s picture

If the path is to push onto the developers to detect the version of the jquery ui that has been installed on the site, then at least a comment in the README should be added.

"if using 1.8.x, it is not a drop in replacement for 1.7.x since new dependencies have been created for certain widgets. The developer should ensure that they add all necessary files per http://jqueryui.com/docs/Developer_Guide."

For example:
1.7.x:
jquery_ui_add(array('ui.slider'));

1.8.x
jquery_ui_add(array('ui.widget, 'ui.mouse', 'ui.slider'));

neochief’s picture

Well, id does nothing with checking versions for other plugins. You have everything to do it manually, and in my opinion specific plugins should do it.

mattiasj’s picture

subscribe

neochief’s picture

Can somebody just test the patch?

broucaries’s picture

I have tested the patch and it work

neochief’s picture

Status: Needs review » Reviewed & tested by the community

Awesome, thank you!

AdrianB’s picture

Subscribing.

gausarts’s picture

Subscribing. Thanks

UPDATE: So far so good. Patch #14, jquery 1.4, jquery 1.8.5, core patch http://drupal.org/node/479368#comment-3198886, and somewhere for tabledrag.js patch. No panel tested. Views fine, imagecrop still testing. Thanks

UPDATE2: Imagecrop was dropped. Just found random warnings due to wrong files names (note: .js.min.js, etc):

# warning: file_get_contents(sites/all/modules/jquery_ui/jquery.ui/ui/minified/jquery.ui.button.js.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in D:\xampp\htdocs\...\includes\locale.inc on line 1714.
# warning: file_get_contents(sites/all/modules/jquery_ui/jquery.ui/ui/minified/jquery.ui.draggable.js.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in D:\xampp\htdocs\...\includes\locale.inc on line 1714.
# warning: file_get_contents(sites/all/modules/jquery_ui/jquery.ui/ui/minified/jquery.ui.position.js.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in D:\xampp\htdocs\...\includes\locale.inc on line 1714.
warning: file_get_contents(sites/all/modules/jquery_ui/jquery.ui/ui/minified/jquery.ui.resizable.js.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in D:\xampp\htdocs\...\includes\locale.inc on line 1714.
drewish’s picture

Perhaps it should be outside the scope of this issue but the current patch doesn't handle adding CSS files.

drewish’s picture

I feel like trying to move all these individual patches in the issue queue isn't very productive so I've applied this and several others to a github repo:
http://github.com/drewish/jquery_ui

I'd love feedback if anyone has time to test it.

YK85’s picture

Hi,

I am very new at this so I apologize if this is an obvious question.
Currently, am I not suppose to use jQuery UI 1.8.1 (http://blog.jqueryui.com/2010/05/jquery-ui-181/) folder?

Thanks!

boabjohn’s picture

Hey there drewish, thanks for the github fork. Looks like it could be very useful.

Would love to test, but the readme is for last version, and there's no install txt so it's hard to get oriented.

My situation: (D6.19 unpatched)

1. Latest jquery_update is installed

2. Delete the existing version of jquery_ui

3. Unpacked your fork into sites/all/modules and renamed it to jquery_update

4. Uploaded jquery library (1.84) and renamed directory to jquery.ui

5. Shifted the contents of /development_bundle/ to jquery.ui, so I have this path:
#drupal/sites/all/modules/jquery_ui/jquery.ui/jquery-1.4.2.js

So far so good. I don't know how to test for functionality. The one obvious thing that happens is Date Popup claims there is no jquery.ui available:

The Date Popup module now requires the jQuery UI module as a source for the datepicker. Please install it immediately.

What other feedback would be useful to you?

gausarts’s picture

Testing pressflow with jquery 1.4 + jquery_ui 1.8.5. Pressflow doesn't seem to complain so far.

Cyberflyer’s picture

@boabjohn:

You have created one directory too many.

Instead of :

#drupal/sites/all/modules/jquery_ui/jquery.ui/jquery-1.4.2.js

You should have:

#drupal/sites/all/modules/jquery_ui/jquery.ui/ <= with the contents of jquery UI that you downloaded.

For instance:

#drupal/sites/all/modules/jquery_ui/jquery.ui/ui/jquery.ui.all.js

The secret is to get all the javascript in the directory:

#drupal/sites/all/modules/jquery_ui/jquery.ui/ui/

Then clear all your caches and run cron.

Make sense?

corey.aufang’s picture

The copy on github looks good except for jQuery UI dependencies.

If you call jquery_ui_add('ui.button'); you're going to get a JS error because button needs ui.widget to also get loaded.

Similar to how ui.core gets automatically loaded, we need to do that for ui.widget as well.

HongPong’s picture

Issue tags: +jQuery

subscribe

dway’s picture

subscribing

VM’s picture

Drewish

Per #26
I just tried testing what is in github and was returned this error:

Fatal error: Function name must be a string in /home/****/public_html/sites/all/modules/jquery_ui/jquery_ui.module on line 94
Tommy Kaneko’s picture

I just wanted to save time for others like myself who didn't realise that the order in which you call the plugins in jquery_ui_add() is critical if you are using jquery ui 1.8, because of the dependencies.

The following order worked for me, but you will have to look at the dependencies of each plugin to figure out the order in which they need to be called.

<?php
jquery_ui_add(array('ui.widget', 'ui.mouse', '...'));
?>	

If you don't call them in the right order, then you get silly '$.widget is not a function' errors.

Can't believe I wasted 2 hours on it!

corey.aufang’s picture

For jQueryUI, I noticed that the dependencies are listed at the top of the actual .js files.

We could add functionality that would look at the top of the file for the listed dependencies, and automatically include them.

Now we wouldn't want to scan the files every time, so we would want to cache this data to a variable or something.

Is there any gaping hole in my idea?

*The dependencies also appear to be in the correct order.

orangeudav’s picture

Subscribing

thijsvdanker’s picture

subscribing

corey.aufang’s picture

Base on my comment at #749126-36: JQuery Plugin 1.8 is out here is a patch that detects the dependencies of a file and automatically loads them in the correct order.

This also removes explicit inclusion of ui.core and effects.core as they are now automatically included if required.

This is run against latest dev.

corey.aufang’s picture

Status: Reviewed & tested by the community » Needs review

Oops, forgot to change status.

BoogieBug’s picture

the regular expression used in patch #39 to extract the dependencies those are listed on the top file each jQuery UI file is in greedy mode, therefore, generate error on the JS files those contains the multi-line comments (/* .. */) in other part of file rather than just the header. (jquery.ui.draggable.js - for example)

To fix this, I changed the 1st regexp in the patch from:

'/^\/\*.*Depends:(.*)\*\//ismu'

to

'/^\/\*.*Depends:(.*?)\*\//ismu'
BoogieBug’s picture

Since I applied the patch in #39 to the version 6.x-1.4 (not the dev version), I also need to changed the 2nd regexp from:

'/\s*\*\s*(.+)\n/miu'

to

'/\s*\*\s*jquery\.(.+)\n/miu'

And everything seem working very well, though testing is still needed.

that0n3guy’s picture

Doing 41 and 42 give me errors like:

    * warning: file_get_contents(sites/all/modules/jquery_ui/jquery.ui/ui/minified/ui.widget.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in /var/aegir/platforms/devdc1.1/sites/all/modules/jquery_ui/jquery_ui.module on line 68.
    * warning: file_get_contents(sites/all/modules/jquery_ui/jquery.ui/ui/minified/ui.core.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in /var/aegir/platforms/devdc1.1/sites/all/modules/jquery_ui/jquery_ui.module on line 68.
    * warning: file_get_contents(sites/all/modules/jquery_ui/jquery.ui/ui/minified/ui.mouse.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in /var/aegir/platforms/devdc1.1/sites/all/modules/jquery_ui/jquery_ui.module on line 68.

I don't get errors just using patch 39 with 1.4.

southweb’s picture

Well, I've been holding for a while to see where this goes, but dived in and wasted a few hours hacking today.

My experience with the above is that jqueryui-1.8 patch (#14) is not compatible with the dependencies patch (#39)

I can't successfully patch the dev module with both, regardless of the order.

Would love to see a dev version of this module that supports both 1.8 and dependencies ...?

thanks.

southweb’s picture

Ok, so here's my attempt to update the dependency patch to support v1.8.

corey.aufang’s picture

I'm going to be throwing together a patch that will incorporate the 1.8 compatibility and the dependencies patch, along with storing the dependencies in cache, since it seems a waste of cycles to parse every file each time.

I can't work on this right now but hopefully later today.

NancyDru’s picture

AFAIC, if the module expects a specific plug in, then it should be included with the module download. IF this is a stupid licensing problem, then the Drupal Association should be working on how to get the licenses for "free, publicly available software" to cooperate.

corey.aufang’s picture

Here is my patch. It includes checking for the version of jQuery UI, dependencies and dependencies caching using the Drupal caching mechanism to reduce the number of file parses per page load.

DONT USE, I screwed up on the patch.

corey.aufang’s picture

Fixed patch.

Run against dev.

HongPong’s picture

Hey question on this, is this the tweak needed for Selenium testing to work with jquery (more ARIA compatibility)? They said at the drupalcon session on automated testing (with merrill) just now that there's a patch up to 1.8 which makes selenium better, is this the thread covering that issue?

corey.aufang’s picture

This issue was originally about how to make the jQuery UI module work with ver 1.8 of the jQuery UI library.

In the change from 1.7.x -> 1.8.x of the jQuery UI library, they changed the name format of their files from
ui.<plugin>.js
to
jquery.ui.<plugin>.js

Now if the issue that you mentioned is for the D6 version of the Selenium module, and it requires jQuery UI 1.8+, then it might make sense to use this patch.

If your using D7, jQuery UI 1.8.7 is bundled already with Drupal.

southweb’s picture

nice. I never knew about version_compare().

thanks for this.

corey.aufang’s picture

Does the patch in #49 work for anyone else?

I could see this patch removing some frustration that users experience while working with jQuery UI.

enboig’s picture

I had to apply it "manually" (don't know why netbeans don't apply it correctly).
It appear to work, despite datepicker using module date popup has lost its format.

enboig’s picture

After more checking I found now datepicker isn't using my locale (non English user) when using date. I am trying to make jquery_ui.module to check if a "js" translated file exists and then load it. The file is loaded, but datepicker is still in english. any hint? I add my code just after drupal_add_js($js_path); (when the js file is loaded)

      global $language;
      $js_translation = $jquery_ui_path.'/i18n/'.$file.'-'.$language->language.'.js';
      if (file_exists($js_translation)) {
        drupal_add_js($js_translation);
        $js='$.datepicker.setDefaults( $.datepicker.regional[\''.$language->language.'\'] );';
        drupal_add_js( $js, 'inline');
      }
ericbroder’s picture

The patch at #749126-49: JQuery Plugin 1.8 is out worked for me, although I'm using 6.x-1.4 (not the dev version) so the first hunk failed and I had to apply that manually.

I'm using jQuery UI module because it's a requirement for the Inline Context Editor feature in Context module 6.x-3.0. I was interested in upgrading the jQuery UI plugin to 1.8.11 because that's the version used in CiviCRM 3.4, and I was having a javascript conflict error, "uncaught exception: Syntax error, unrecognized expression: . ", with the CiviCRM drag and drop dashboard: http://forum.civicrm.org/index.php?topic=18365.0

Here's what worked for me:
- Install and enable jQuery Update 6.x-2.0-alpha1.
- Patch jQuery UI module 6.x-1.4 with #749126-49: JQuery Plugin 1.8 is out.
- Install jQuery UI plugin 1.8.11 inside of jQuery UI module, replacing previous version.

This appears to have resolved the jQuery UI plugin conflict between Drupal and CiviCRM. After doing the steps above, Inline Context Editor works and so does CiviCRM drag and drop dashboard.

sonicthoughts’s picture

Is there a plan to apply this patch to a future release?

raystin’s picture

mark

btully’s picture

subscribe

ohnobinki’s picture

+

southweb’s picture

The only issues I'm having now are the fact the Views UI isn't working properly and the drag and drop on the menu manager interface is broken. They work with the 3.x versions of jQuery but not 4.x Really not sure what can be done about this though.

ohnobinki’s picture

@bluffit, you could probably use the jquery_update module and fix it to support jQuery-4.x and also fix the menu manager/View UI javascript files in jquery_update perhaps?

caktux’s picture

The patch at #749126-49: JQuery Plugin 1.8 is out also worked for me (thanks!) but haven't tested it extensively.

upupax’s picture

JQuery Update, JQuery UI 1.8, patch #749126-49: JQuery Plugin 1.8 is out works fine.
Tested creating an accordion.

paulmckibben’s picture

JQuery Update, JQuery UI 1.8, patch at #49 works fine for me as well.

gaele’s picture

Status: Needs review » Reviewed & tested by the community
ionmedia’s picture

can you attach patch to dev or put here patched module?

hanoii’s picture

I have been using #49 and I found one small issue. On a general note I think the way of looking for dependencies is not the best and not sure if this will ever be consider for inclusion as it is very subject to stop working as soon as jquery ui decide to write or note dependencies in some other way.

Said this, the patch is indeed useful if you need 1.8 as I did. I did find that if either minimized or packed version if used, those files doesn't have any dependency information. Attached is a patch that always look for the dependencies in the uncompressed file regardless of what is being used.

It's a modification to #49 taken from current dev.

NOTE: I've tried this properly with 1.8.18 and 1.8.19 has just been released and the zip in google doesn't have the version.txt file used by jquery_ui to look for a supported version. You can create it and add the version but I think that won't be included any more, so eventually that has to be supported on this patch as well I'd think.

hanoii’s picture

Status: Reviewed & tested by the community » Needs review
hanoii’s picture

Removed some unneeded spaces

ice5nake’s picture

Status: Needs review » Reviewed & tested by the community

Patch worked for me.

Created the version.txt file as mentioned. Should this patch be included the README.txt should be updated with instruction for the version.txt file as well as wording for 1.8

Side note: In the zip file I got I only wanted the contents of the "development-bundle" directory. Thought it worth noting cause it proved to be a minor delay for me.

Yay, now I have the position utility function!

j0rd’s picture

Patch #70 has a bug in it, with relation to i18n.

What you'll need to do to duplicate, is have Drupal installed with a language other than "en".

Then install date module's date_popup module and jquery_ui with patch #70.

This patch adds the prefix to jquery.ui prefix if we're above version 1.8, but it's completely valid to run a command like this with jquery_ui, like date_pop module does.

    if ($language->language != 'en') {
      jquery_ui_add("i18n/ui.datepicker-{$language->language}");
    }

Which will then attempt to add jquery.i18n/ui.datepicker-fr , which is in-correct.

An exception needs to be made for i18n folder, or a better solution needs to be made.

j0rd’s picture

Unfortunately I can not provide a patch easily, as my jquery.ui version for the site I'm working on has been hacked to bits....but here's my fix for this particular problem.

@@ -45,7 +45,9 @@ function jquery_ui_add($files = array()) {

   // Loop through list of files to include and add them to the page. 
   foreach ($files as $file) {
-    $file = $jquery_ui_version . $file;
+    // don't add "jquery." prefix to the i18n folder, for any version of jquery.ui
+    if(!(strpos($file, 'i18n/') === 0)) {
+      $file = $jquery_ui_version . $file;
+    }     
     // Load other files.
hanoii’s picture

I'd go with some kind of regex replacement taht should probably work better for any subdirectory, might send a patch if I have some time, let me know if you would be able to try it out.

mikelutz’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (outdated)

I think it's save to close this as outdated at this point. :-)