Hi, Drupal 5.5 comes with jQuery version 1.2.1 I've already saw several threads on drupal.org about upgrading jQuery to a most recent version for D5. I would like to know what is the best method to acomplish this update, and why D5 can't have an updated jQuery version in the core. Thanks.
This is more of a support question than a dev question, IMO. With that said: http://drupal.org/project/jquery_update Cheers, Bill Luis Santos wrote:
Hi,
Drupal 5.5 comes with jQuery version 1.2.1 I've already saw several threads on drupal.org about upgrading jQuery to a most recent version for D5.
I would like to know what is the best method to acomplish this update, and why D5 can't have an updated jQuery version in the core.
Thanks.
-- Bill Fitzgerald http://www.funnymonkey.com Tools for Teachers 503.897.7160
jQuery 1.2.1 is the most recent version of jQuery and it comes with Drupal 6 (b4). I am pretty sure Drupal 5.5 still ships with jQuery 1.0.4. Luis Santos wrote:
Hi,
Drupal 5.5 comes with jQuery version 1.2.1 I've already saw several threads on drupal.org about upgrading jQuery to a most recent version for D5.
I would like to know what is the best method to acomplish this update, and why D5 can't have an updated jQuery version in the core.
Thanks.
It does, although upgrading it to jQuery 1.1.4 is rather simple. You just need to replace the jquery.js file that ships with Drupal with a new download of jQuery 1.1, and then also have a simple dummy module that adds the jQuery 1.1 backward compatibility plugin (available from jquery.com). I haven't tried upgrading to 1.2 yet, although in theory it should be the same procedure but include adding the 1.2 backward compatibility plugin as well. (jQuery, the only project that moves faster than Drupal. <g>) --Larry Garfield On Thu, 20 Dec 2007 09:06:34 -0800, Tao Starbow <starbow@citris-uc.org> wrote:
jQuery 1.2.1 is the most recent version of jQuery and it comes with Drupal 6 (b4). I am pretty sure Drupal 5.5 still ships with jQuery 1.0.4.
Luis Santos wrote:
Hi,
Drupal 5.5 comes with jQuery version 1.2.1 I've already saw several threads on drupal.org about upgrading jQuery to a most recent version for D5.
I would like to know what is the best method to acomplish this update, and why D5 can't have an updated jQuery version in the core.
Thanks.
I've done this (upgrading to 1.2), yes you just need to add the to compatibility plugins, and make sure they are added in the correct order. Though then you have three files to load instead of one, but you can always roll them up into one, and run packer on that, then use that as your base jQuery file. On 20/12/2007, Larry Garfield <larry@garfieldtech.com> wrote:
It does, although upgrading it to jQuery 1.1.4 is rather simple. You just need to replace the jquery.js file that ships with Drupal with a new download of jQuery 1.1, and then also have a simple dummy module that adds the jQuery 1.1 backward compatibility plugin (available from jquery.com). I haven't tried upgrading to 1.2 yet, although in theory it should be the same procedure but include adding the 1.2 backward compatibility plugin as well.
(jQuery, the only project that moves faster than Drupal. <g>)
--Larry Garfield
On Thu, 20 Dec 2007 09:06:34 -0800, Tao Starbow <starbow@citris-uc.org> wrote:
jQuery 1.2.1 is the most recent version of jQuery and it comes with Drupal 6 (b4). I am pretty sure Drupal 5.5 still ships with jQuery 1.0.4.
Luis Santos wrote:
Hi,
Drupal 5.5 comes with jQuery version 1.2.1 I've already saw several threads on drupal.org about upgrading jQuery to a most recent version for D5.
I would like to know what is the best method to acomplish this update, and why D5 can't have an updated jQuery version in the core.
Thanks.
-- Regards Steven Jones
That's the little trick I'm using (this way I can override misc/jquery.js with whatever version of jquery I want): RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.611.2.12 diff -u -r1.611.2.12 common.inc --- includes/common.inc 17 Oct 2007 21:28:59 -0000 1.611.2.12 +++ includes/common.inc 21 Dec 2007 09:26:00 -0000 @@ -1608,7 +1608,9 @@ */ function drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer = FALSE, $cache = TRUE) { if (!is_null($data)) { - _drupal_add_js('misc/jquery.js', 'core', 'header', FALSE, $cache); + foreach (variable_get('core_jquery_scripts', array('misc/jquery.js')) as $path) { + _drupal_add_js($path, 'core', 'header', FALSE, $cache); + } _drupal_add_js('misc/drupal.js', 'core', 'header', FALSE, $cache); } return _drupal_add_js($data, $type, $scope, $defer, $cache); RCS file: /cvs/drupal/drupal/sites/default/Attic/settings.php,v retrieving revision 1.39.2.3 diff -u -r1.39.2.3 settings.php --- sites/default/settings.php 9 Jul 2007 04:28:12 -0000 1.39.2.3 +++ sites/default/settings.php 21 Dec 2007 09:27:36 -0000 @@ -163,3 +163,9 @@ # 'anonymous' => 'Visitor', # ); +$conf = array( + 'core_jquery_scripts' => array( + 'sites/all/custom/jquery-core/jquery-1.2.1.pack.js', + 'sites/all/custom/jquery-core/jquery.compat-1.0.js', + ), +); Cheers, Alex Steven Jones wrote:
I've done this (upgrading to 1.2), yes you just need to add the to compatibility plugins, and make sure they are added in the correct order. Though then you have three files to load instead of one, but you can always roll them up into one, and run packer on that, then use that as your base jQuery file.
On 20/12/2007, Larry Garfield <larry@garfieldtech.com> wrote:
It does, although upgrading it to jQuery 1.1.4 is rather simple. You just need to replace the jquery.js file that ships with Drupal with a new download of jQuery 1.1, and then also have a simple dummy module that adds the jQuery 1.1 backward compatibility plugin (available from jquery.com). I haven't tried upgrading to 1.2 yet, although in theory it should be the same procedure but include adding the 1.2 backward compatibility plugin as well.
(jQuery, the only project that moves faster than Drupal. <g>)
--Larry Garfield
On Thu, 20 Dec 2007 09:06:34 -0800, Tao Starbow <starbow@citris-uc.org> wrote:
jQuery 1.2.1 is the most recent version of jQuery and it comes with Drupal 6 (b4). I am pretty sure Drupal 5.5 still ships with jQuery 1.0.4.
Luis Santos wrote:
Hi,
Drupal 5.5 comes with jQuery version 1.2.1 I've already saw several threads on drupal.org about upgrading jQuery to a most recent version for D5.
I would like to know what is the best method to acomplish this update, and why D5 can't have an updated jQuery version in the core.
Thanks.
a swappable jquery just like our swappable cache library and gd library sounds like a good idea. On 12/21/07, "Alex J. G. Burzyński" <ajgb@ajgb.net> wrote:
That's the little trick I'm using (this way I can override misc/jquery.js with whatever version of jquery I want):
RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.611.2.12 diff -u -r1.611.2.12 common.inc --- includes/common.inc 17 Oct 2007 21:28:59 -0000 1.611.2.12 +++ includes/common.inc 21 Dec 2007 09:26:00 -0000 @@ -1608,7 +1608,9 @@ */ function drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer = FALSE, $cache = TRUE) { if (!is_null($data)) { - _drupal_add_js('misc/jquery.js', 'core', 'header', FALSE, $cache); + foreach (variable_get('core_jquery_scripts', array('misc/jquery.js')) as $path) { + _drupal_add_js($path, 'core', 'header', FALSE, $cache); + } _drupal_add_js('misc/drupal.js', 'core', 'header', FALSE, $cache); } return _drupal_add_js($data, $type, $scope, $defer, $cache);
RCS file: /cvs/drupal/drupal/sites/default/Attic/settings.php,v retrieving revision 1.39.2.3 diff -u -r1.39.2.3 settings.php --- sites/default/settings.php 9 Jul 2007 04:28:12 -0000 1.39.2.3 +++ sites/default/settings.php 21 Dec 2007 09:27:36 -0000 @@ -163,3 +163,9 @@ # 'anonymous' => 'Visitor', # );
+$conf = array( + 'core_jquery_scripts' => array( + 'sites/all/custom/jquery-core/jquery-1.2.1.pack.js', + 'sites/all/custom/jquery-core/jquery.compat-1.0.js', + ), +);
Cheers, Alex
As well as a swappable file upload management (file.inc) On Dec 21, 2007 2:00 PM, Moshe Weitzman <weitzman@tejasa.com> wrote:
a swappable jquery just like our swappable cache library and gd library sounds like a good idea.
On 12/21/07, "Alex J. G. Burzyński" <ajgb@ajgb.net> wrote:
That's the little trick I'm using (this way I can override misc/jquery.js with whatever version of jquery I want):
RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.611.2.12 diff -u -r1.611.2.12 common.inc --- includes/common.inc 17 Oct 2007 21:28:59 -0000 1.611.2.12 +++ includes/common.inc 21 Dec 2007 09:26:00 -0000 @@ -1608,7 +1608,9 @@ */ function drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer = FALSE, $cache = TRUE) { if (!is_null($data)) { - _drupal_add_js('misc/jquery.js', 'core', 'header', FALSE, $cache); + foreach (variable_get('core_jquery_scripts', array('misc/jquery.js')) as $path) { + _drupal_add_js($path, 'core', 'header', FALSE, $cache); + } _drupal_add_js('misc/drupal.js', 'core', 'header', FALSE, $cache); } return _drupal_add_js($data, $type, $scope, $defer, $cache);
RCS file: /cvs/drupal/drupal/sites/default/Attic/settings.php,v retrieving revision 1.39.2.3 diff -u -r1.39.2.3 settings.php --- sites/default/settings.php 9 Jul 2007 04:28:12 -0000 1.39.2.3 +++ sites/default/settings.php 21 Dec 2007 09:27:36 -0000 @@ -163,3 +163,9 @@ # 'anonymous' => 'Visitor', # );
+$conf = array( + 'core_jquery_scripts' => array( + 'sites/all/custom/jquery-core/jquery-1.2.1.pack.js', + 'sites/all/custom/jquery-core/jquery.compat-1.0.js', + ), +);
Cheers, Alex
-- Damien Cirotteau www.rue89.com 01 55 25 75 00
file.inc in D6 is better, and if we all try a bit we can get a fine hook system integrated there. see http://drupal.org/node/142995. that should eliminate the need to swap all of file.inc. On 12/21/07, Damien Cirotteau <dcirotteau@rue89.com> wrote:
As well as a swappable file upload management (file.inc)
On Dec 21, 2007 2:00 PM, Moshe Weitzman <weitzman@tejasa.com> wrote:
a swappable jquery just like our swappable cache library and gd library sounds like a good idea.
On 12/21/07, "Alex J. G. Burzyński" <ajgb@ajgb.net> wrote:
That's the little trick I'm using (this way I can override misc/jquery.js with whatever version of jquery I want):
RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.611.2.12 diff -u -r1.611.2.12 common.inc --- includes/common.inc 17 Oct 2007 21:28:59 -0000 1.611.2.12 +++ includes/common.inc 21 Dec 2007 09:26:00 -0000 @@ -1608,7 +1608,9 @@ */ function drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer = FALSE, $cache = TRUE) { if (!is_null($data)) { - _drupal_add_js('misc/jquery.js', 'core', 'header', FALSE, $cache); + foreach (variable_get('core_jquery_scripts', array('misc/jquery.js')) as $path) { + _drupal_add_js($path, 'core', 'header', FALSE, $cache); + } _drupal_add_js('misc/drupal.js', 'core', 'header', FALSE, $cache); } return _drupal_add_js($data, $type, $scope, $defer, $cache);
RCS file: /cvs/drupal/drupal/sites/default/Attic/settings.php,v retrieving revision 1.39.2.3 diff -u -r1.39.2.3 settings.php --- sites/default/settings.php 9 Jul 2007 04:28:12 -0000 1.39.2.3 +++ sites/default/settings.php 21 Dec 2007 09:27:36 -0000 @@ -163,3 +163,9 @@ # 'anonymous' => 'Visitor', # );
+$conf = array( + 'core_jquery_scripts' => array( + 'sites/all/custom/jquery-core/jquery-1.2.1.pack.js', + 'sites/all/custom/jquery-core/jquery.compat-1.0.js', + ), +);
Cheers, Alex
-- Damien Cirotteau www.rue89.com 01 55 25 75 00
http://drupal.org/node/156221 On Dec 21, 2007 9:20 AM, Steven Jones <darthsteven@gmail.com> wrote:
I've done this (upgrading to 1.2), yes you just need to add the to compatibility plugins, and make sure they are added in the correct order. Though then you have three files to load instead of one, but you can always roll them up into one, and run packer on that, then use that as your base jQuery file.
jQuery 1.2.1 is the most recent version of jQuery and it comes with Drupal 6 (b4). I am pretty sure Drupal 5.5 still ships with jQuery 1.0.4.
out of curiosity, is there a plan out there so that drupal 6.x revisions get updated with new jquery releases ? or maybe jquery will try to avoid api breaks in the future ? g.
On Dec 20, 2007 6:42 PM, Gregory 'guardian' Pakosz <guardian@pempek.net> wrote:
jQuery 1.2.1 is the most recent version of jQuery and it comes with Drupal 6 (b4). I am pretty sure Drupal 5.5 still ships with jQuery 1.0.4.
out of curiosity, is there a plan out there so that drupal 6.x revisions get updated with new jquery releases ?
or maybe jquery will try to avoid api breaks in the future ?
Drupal major versions like 5.x or 6.x will try hard not to break any APIs be it JavaScript or PHP APIs, just as it has been in all the years. Otherwise contributed modules would break. This is especially important now that we have more JavaScript and more modules relying on a certain API in jQuery. Gabor
On Dec 20, 2007 3:49 AM, Luis Santos <luis.santos@openquest.pt> wrote:
Drupal 5.5 comes with jQuery version 1.2.1 I've already saw several threads on drupal.org about upgrading jQuery to a most recent version for D5.
I would like to know what is the best method to acomplish this update, and why D5 can't have an updated jQuery version in the core.
Drupal 5.x will stick with jQuery 1.0.4. Updating jQuery would break contributed modules and custom code since jQuery's API does change. -- Neil Drumm http://delocalizedham.com
participants (12)
-
"Alex J. G. Burzyński" -
Bill Fitzgerald -
Damien Cirotteau -
Fernando Silva -
Gregory 'guardian' Pakosz -
Gábor Hojtsy -
Larry Garfield -
Luis Santos -
Moshe Weitzman -
Neil Drumm -
Steven Jones -
Tao Starbow