jQuery + new drupal_add_js for 4.7
Steve McKenzie - September 22, 2006 - 15:49
| Project: | Drupal |
| Version: | 4.7.3 |
| Component: | other |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
I know this is really in demand so here is version 1 of this patch.
please review.
this wont be commited to 4.7 but we know people want this.
| Attachment | Size |
|---|---|
| jquery_drupal_add_js_4_7.patch | 55.98 KB |

#1
here is the jquery.js file since I couldn't attach it with the patch. (same jquery.js i grabbed from HEAD)
#2
new one that should actually work :P
#3
What about patching against 4.7.3? Could this make it into 4.7.4?
Also these look like pretty extensive changes... Is there an easy way to backup / restore affected files if the patch goes wrong?
Thanks for putting this together!
#4
k this one is even better. .
after discovering the order process of the files being included, i discoverd and issue where the tinymce toggle function which gets added by drupal_set_html_head() goes before the include of tinymce.js so that was an issue.
to resolve this, i removed the drupal_get_js() from theme_page and phptemplate.engine and just stuck it in drupal_get_html_head().
#5
im still testing this patch and i want others to as well.. once a final solid patch is ready.. I'm not sure what we can do to make things easier from there.. need to think about that a little more..
regarding commiting to a 4.7.4 copy... it wont happen. It'd be great but it just wont happen :(
#6
I will check it out. The idea of having to update / re-patch so many changes with every 4.7.x release (in production) sounds a little scary. Hope it might be possible to consolidate changes to be more compact...
#7
Patch did not apply cleanly to latest 4.7 checkout for theme.inc and drupal.js. Will test it when this is rectified :-)
#8
to be more compact is not going to happen. this is changing every .js file to be the new jquery way.
regarding it not applying properly.. those were the same 2 that i got errors on for the first one.. then i rerolled another one and it was ok.. did you try the latest? can you see anything in the patch file that can be causing this?
#9
With the latest cvs 4.7 checkout, theme.inc and drupal.js are as follows:
// $Id: theme.inc,v 1.292.2.7 2006/09/05 10:22:24 killes Exp $// $Id: drupal.js,v 1.22.2.2 2006/08/19 19:55:20 killes Exp $
While in the patch:
--- includes/theme.inc 2 Jul 2006 10:08:23 -0000 1.292.2.5--- misc/drupal.js 29 May 2006 14:23:32 -0000 1.22.2.1
Slightly older versions ;-)
#10
sorry for my cvs noobness
try this one.
#11
arg.. i missed one thing..
#12
Here's an updated patch that *includes* Jquery in it.
To do this, just hack your CVS/Entries in misc an add:
/jquery.js/0/Initial jquery.js//
#13
yay ted!
#14
Applied this and the autocomplete.js is still broken with 4.7.3 with or without jquery.js after applying the patch. Otherwise works fine, I am using the jquery from head, with 4.7.3.
#15
correction...not autocomplete.js it break the collapse.js boxes on edit and node/add pages...I had the same problem before applying this patch.
#16
#17
Keeping jQuery patch up to date with 1.0.2. I also included some drupal.css changes which were not backported before.
Not sure what the status of this should be. This patch is not going to be committed...
#18
Applied Steven's last patch, works great. Thanks.
Maybe we should mark this postponed? So it stays in the forefront a bit, but no one will try and review it at least. Change it back if I'm wrong.
#19
Sweet! I'll give this is a whirl. Was gonna hold off but if it works out without much problems, I'll stick with this till 5.0. Thanks!
Each revision of the patch only works with a fresh install, right? Well, I'll find out.
#20
Actually, there is an error on node/add/page if you have File attachments enabled for pages. Putting back to code needs work. Did some part of the upload backport not get polished. Any thoughts on this Steven?
button has no properties drupal.js (line 31)#21
Yeah this was not backported properly. Better patch for 4.7-HEAD.
#22
Sweet. That one is working great so far. Thanks Steven.
#23
Looks like we might need a 4.7.4 upgrade ?
#24
This will never make it into 4.7.
Not sure what the best status .. should we keep it active? Postponed?
If it's postponed it shouldn't automatically be closed, right?
#25
I think postponed is fine so it stays visible. We can close it when 4.7 is old news or when most peeps are on 5.0+.
#26
Keeping in sync with head (to fix the radiobutton-inside-collapsed-fieldset issue).
#27
This constant need for updating and patching core files seems a tad unnerving. What do you think about instead merging this effort into here: http://drupal.org/project/jquery47
What are the pros and cons? Ability to maintain and use with non-HEAD versions of the tree (I am still on 4.7.3)? Support for 3rd party jQuery plugins?
Thoughts?
#28
Updating with jQuery 1.0.3 as per HEAD.
dkruglyak: I've only ever used this patch for projects where we don't rely on 4.7 drupal.js at all. Such modules are rare, and easy to port anyway. Both projects have their uses I guess, but IMO the rest of the JS improvements, including on the PHP side, make it much easier to do heavy jQuery lifting in custom modules and themes.
#29
Well, the jquery47 module handles this, so really no reason to continue to keep this issue open still...
#30
I think 4.7 and jQuery 1.0.x are time to retire...