Posted by joshk on February 16, 2007 at 11:51pm
UPDATE: There is a jQuery 1.0 compatibility plugin.
Has anyone else felt the need to update the jquery.js file? In seeking to implement some functions from the Interface Elements for jQuery I found that jQuery 1.0 wasn't up to the task. There are a couple functions which were added in jQuery 1.1 that it uses.
I've updated a testbed site to use the latest jquery.js file and so far so good. Their docs don't suggest any deal-breaking changes, and in general I trust John Resig not to break stuff, but I'm wondering if anyone else has tried this?

Comments
Some jQuery 1.1.1 upgrade conflicts
I mentioned this point in the previous thread, and I did come across one patch to textarea.js in order to make it compatible with jQuery 1.0.x and 1.1.x.
I'm sure that Googling for jquery 1.1.1 site:drupal.org will turn up other conflicts and discussions about since there does seem to be some demand for this. Also Googling for jquery 1.1.x site:drupal.org will likely turn up more info.
Apparently there is strong concensus to not include any patches for jQuery 1.1.x compatibility into any official Drupal 5.x releases -- Steven saying, "[This patch is] Unnecessary for 5.0. It will never be bundled with 1.1.x and we should not be encouraging this sort of mismatching of jQuery and Drupal versions. It will only lead to random/incorrect bug reports in the future." And Drumm saying, "Developments like this happen on 6.x-dev."
So it looks like if we do want jQuery 1.1.1 with Drupal 5.x, then it is going to have be through rouge patches outside of any official 5.x releases -- unless Dries decides differently. He did commit the patch to HEAD and say, "Committed to CVS HEAD. Needs to go in Drupal 5." -- which did create some pushback and resistance from the community.
I'd personally be curious to hear about other conflicts and workarounds that come up for 1.1.x compatibility in Drupal 5.
Hmm
That's disappointing. I'd hoped that drupal's core .js files would be compatible.
http://www.chapterthreellc.com | http://www.outlandishjosh.com
https://pantheon.io | http://www.chapterthree.com | https://www.outlandishjosh.com
Staying with jQuery 1.0.4?
So, should we stay with jQuery 1.0.4 to avoid breaking Drupal 5.x?
I recently had an issue with jQuery, I fixed it with a few lines of code; however, it seems that I just needed two lines if using jQuery 1.1.1.
Alexis Bellido
reviews of music, movies and books
Alexis Bellido
Ventanazul: web development and Internet business consulting shouldn't be boring
Indeed
It seems like the drupal core for 5.x is going to be jquery 1.0.4. I can see their point.
However, there's nothing to stop this group from maintaining a list of tweaks needed to get Drupal's built-in js working on jquery 1.1.x, especially if the tweaks are not too hard! ;)
http://www.chapterthreellc.com | http://www.outlandishjosh.com
https://pantheon.io | http://www.chapterthree.com | https://www.outlandishjosh.com
Thickbox doesn't work with jQuery 1.0.4
I'm working in a Drupal 5.1 site and need Thickbox for adding some features, however Thickbox requires jQuery 1.1.1 at least. Anybody using it?
Alexis Bellido
Ventanazul: web development and Internet business consulting shouldn't be boring
Alexis Bellido
Ventanazul: web development and Internet business consulting shouldn't be boring
Thickbox module
I think there is a thickbox module that is 5.x compatible over at drupal.org.
Easier that you might imagine
There is a thickbox module at
http://drupal.org/project/thickbox
It has a version of Thickbox included that works Fine with Drupal 5's version of jquery
Alan
thickbox works for me
I am just getting into jquery in general. I got thickbox to work by adding the init script to a "Full HTML" header on the view where I wanted it:
<h1 class="title">Great Events at the Brazos Center</h1><script>
$(document).ready(function() {
$(".calendar-calendar .title a").addClass("thickbox");
$(".calendar-calendar .title a").each(function() {
$(this).attr("href", $(this).attr("href") + "?height=300&width=400");
});
TB_init('a.thickbox, area.thickbox, input.thickbox');
});
</script>
Still working out the kinks (how to strip a node to only $content when it is called as a thickbox (TB) overlay), but I wanted to add to this discussion here by pointing out that to get thickbox to work dynamically without custom node/calendar themes, I had to reinit TB after jquery had a chance to populate my selected calendar node links with class="thickbox".
This is cool stuff.. Not sure where to go to get help on stripping my node "only when called from thickbox".
theme template.php? hook_nodeapi ?
If you want to change the way any node appears given some condition ( in this case I think a thickbox get variable? ) you might be able to do something in the template.php of your theme by overriding theme_page() with a conditional statement that tests if the request is form thickbox or not,eg
<?phpif($_GET['TB_iframe'] == 'true') {
// return trimmed version
}
else {
// return full version
}
?>
You just need some way of identifying when the page you are generating is for thickbox, and then doing the right thing.
textarea collapsability
http://drupal.org/node/120291
This has a patch that works to bring collapse.js up to speed for jQuery 1.1. It is backwards compatible to 1.0 as well.
http://www.chapterthreellc.com | http://www.outlandishjosh.com
https://pantheon.io | http://www.chapterthree.com | https://www.outlandishjosh.com
We have interface library running like this...
For a really dumb example, we first put the library into:
http://example.com/sites/all/plugins
Then we made a module with code like this:
<?phpfunction dragdrop_nodeapi(&$node, $op, $a3=NULL, $a4 = NULL){
switch($op){
case 'view':
$path = drupal_get_path('module', 'dragdrop');
drupal_add_js('sites/all/plugins/src/iutil.js');
drupal_add_js('sites/all/plugins/src/idrag.js');
drupal_add_js($path . '/drag.js');
}
}
?>
Code for drag.js:
<?php$(document).ready(function(){
$('h2').Draggable({snapDistance: 20, revert: true, opacity: 0.3});
alert('Any h2 Title is draggable... enjoy ! ');
});
?>
Victor Kane
http://awebfactory.com.ar
Victor Kane
http://awebfactory.com
Question on this jQuery compatibility plugin
Does this jQuery 1.0 Compatibility plugin add the necessary functions that allow the Interface library v1.2 to work properly?
Do you just add this file into a folder and include it via drupal_add_js()?
As I understand it, its the
As I understand it, its the other way around.
Its a plugin for Jquery 1.1
Its lets you run code originally written for 1.0.
In the Drupal context, it should mean [I haven't tested this...]
You can replace the jquery.js in /misc with the latest jquery.js from jquery.com
Then add in the jQuery 1.0 Compatibility plugin, just as you've outlined, and old code, such as textarea.js, should continue to function.
This means you can start using the jquery plugins, which rely on the newer jquery 1.1.
So does thats sound right to the experts out there?
Regards
Alan
Has anyone really gotten jquery 1.1.1 to work?
I've tried installing jquery 1.1.1 along with its compatibility library and still have problems with drupal's collapsible fieldsets. I've tried applying the patches others have submitted for collapse.js and still can't collapse a fieldset after it has been expanded.
Is there some other magic mojo to get Drupal 5.1 to "work" with jquery 1.1.1? I've seen several posts between drupal.org forms and groups.drupal.org that claim to have made this work, but I'm still struggling along.
JQuery Update Module
Please see this thread for my new (not-yet-released) JQuery Update module.
-jeff
-= Jeff Robbins | Lullabot | Drupalize.me =-
JQuery Update Module 1.0 Released
For those of you who missed it, the JQuery Update module has been released. It guides you through the process of replacing the core jquery.js file and then includes two scripts - one to ensure that "properly written" scripts for JQ 1.0.x will work with JQ 1.1.x - and one to fix the broken expandable fieldsets in D5 (it's not "properly written").
-= Jeff Robbins | Lullabot | Drupalize.me =-
fixed in Drupal 6?
Jeff, this fieldset issue is already fixed in Drupal 6 or can you point me to an issue in the queue? This might be related: http://drupal.org/node/120291 but the jQuery 1.1 update issue (http://drupal.org/node/146462) includes the latest patch there too. Would be nice to have testers on the 1.1 update issue for Drupal 6, so we can get that committed soon.