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.

AttachmentSize
jquery_drupal_add_js_4_7.patch55.98 KB

#1

Steve McKenzie - September 22, 2006 - 15:50

here is the jquery.js file since I couldn't attach it with the patch. (same jquery.js i grabbed from HEAD)

AttachmentSize
jquery.js_1.txt 16.98 KB

#2

Steve McKenzie - September 23, 2006 - 08:25

new one that should actually work :P

AttachmentSize
jquery_drupal_add_js_4_7-2.patch 56.15 KB

#3

dkruglyak - September 23, 2006 - 08:39

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

Steve McKenzie - September 23, 2006 - 08:44

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().

AttachmentSize
jquery_drupal_add_js_4_7-3.patch 54.19 KB

#5

Steve McKenzie - September 23, 2006 - 08:46

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

dkruglyak - September 23, 2006 - 08:53

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

edmund.kwok - September 23, 2006 - 08:59

Patch did not apply cleanly to latest 4.7 checkout for theme.inc and drupal.js. Will test it when this is rectified :-)

#8

Steve McKenzie - September 23, 2006 - 09:06

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

edmund.kwok - September 23, 2006 - 09:16

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

Steve McKenzie - September 23, 2006 - 12:42

sorry for my cvs noobness

try this one.

AttachmentSize
jquery_drupal_add_js_4_7-4.patch 53.67 KB

#11

Steve McKenzie - September 23, 2006 - 13:01

arg.. i missed one thing..

AttachmentSize
jquery_drupal_add_js_4_7-5.patch 54.04 KB

#12

m3avrck - September 23, 2006 - 13:58

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//

AttachmentSize
jquery_10.patch 71.26 KB

#13

Steve McKenzie - September 23, 2006 - 14:02

yay ted!

#14

mikey_p - September 24, 2006 - 17:09
Category:feature request» bug report

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

mikey_p - September 24, 2006 - 20:18

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

chx - October 2, 2006 - 19:43
Category:bug report» task
Status:active» needs review

#17

Steven - October 14, 2006 - 07:58

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...

AttachmentSize
jquery_11.patch 75.12 KB

#18

RobRoy - October 16, 2006 - 18:01
Status:needs review» postponed

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

dvessel - October 16, 2006 - 18:28

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

RobRoy - October 16, 2006 - 20:15
Status:postponed» needs work

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

Steven - October 17, 2006 - 22:46
Status:needs work» postponed

Yeah this was not backported properly. Better patch for 4.7-HEAD.

AttachmentSize
jquery_12.patch 76.05 KB

#22

RobRoy - October 18, 2006 - 07:01

Sweet. That one is working great so far. Thanks Steven.

#23

dkruglyak - October 19, 2006 - 00:54
Status:postponed» needs review

Looks like we might need a 4.7.4 upgrade ?

#24

m3avrck - October 19, 2006 - 02:11
Status:needs review» postponed

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

RobRoy - October 19, 2006 - 04:32

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

Steven - October 24, 2006 - 19:32

Keeping in sync with head (to fix the radiobutton-inside-collapsed-fieldset issue).

AttachmentSize
jquery_13.patch 76.27 KB

#27

dkruglyak - November 7, 2006 - 00:36

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

Steven - November 7, 2006 - 00:57

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.

AttachmentSize
jquery_14.patch 76.36 KB

#29

bdragon - September 22, 2007 - 16:39
Status:postponed» won't fix

Well, the jquery47 module handles this, so really no reason to continue to keep this issue open still...

#30

dkruglyak - September 25, 2007 - 15:11
Status:won't fix» closed

I think 4.7 and jQuery 1.0.x are time to retire...

 
 

Drupal is a registered trademark of Dries Buytaert.