From 9ed4ad213b43401815e3aa21991765c12e5558e4 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 8 Jan 2007 03:03:36 +0000 Subject: [PATCH] Scriptaculous loader changes from mdawaffe. fixes #3519 git-svn-id: http://svn.automattic.com/wordpress/trunk@4701 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/script-loader.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 989b76a614..62521e0b3e 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -22,10 +22,13 @@ class WP_Scripts { $this->add( 'autosave', '/wp-includes/js/autosave-js.php', array('prototype', 'sack'), '4508'); $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax-js.php', array('prototype'), '4459'); $this->add( 'listman', '/wp-includes/js/list-manipulation-js.php', array('wp-ajax', 'fat'), '4583'); - $this->add( 'scriptaculous', '/wp-includes/js/scriptaculous/scriptaculous.js', array('prototype'), '1.6.1'); - $this->add( 'scriptaculous-dragdrop', '/wp-includes/js/scriptaculous/scriptaculous.js?load=builder,dragdrop', array('prototype'), '1.6.1'); - $this->add( 'scriptaculous-slider', '/wp-includes/js/scriptaculous/scriptaculous.js?load=slider,effects', array('prototype'), '1.6.1'); - $this->add( 'scriptaculous-controls', '/wp-includes/js/scriptaculous/scriptaculous.js?load=controls', array('prototype'), '1.6.1'); + $this->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.6.1'); + $this->add( 'scriptaculous-builder', '/wp-includes/js/scriptaculous/builder.js', array('scriptaculous-root'), '1.6.1'); + $this->add( 'scriptaculous-dragdrop', '/wp-includes/js/scriptaculous/dragdrop.js', array('scriptaculous-builder'), '1.6.1'); + $this->add( 'scriptaculous-effects', '/wp-includes/js/scriptaculous/effects.js', array('scriptaculous-root'), '1.6.1'); + $this->add( 'scriptaculous-slider', '/wp-includes/js/scriptaculous/slider.js', array('scriptaculous-effects'), '1.6.1'); + $this->add( 'scriptaculous-controls', '/wp-includes/js/scriptaculous/controls.js', array('scriptaculous-root'), '1.6.1'); + $this->add( 'scriptaculous', '', array('scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls'), '1.6.1'); $this->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '1'); if ( is_admin() ) { $this->add( 'dbx-admin-key', '/wp-admin/dbx-admin-key-js.php', array('dbx'), '3651' ); @@ -70,11 +73,14 @@ class WP_Scripts { elseif ( is_array($handles[$handle]) ) $this->_print_scripts( $handles[$handle] ); if ( !in_array($handle, $this->printed) && isset($this->scripts[$handle]) ) { - $ver = $this->scripts[$handle]->ver ? $this->scripts[$handle]->ver : $wp_db_version; - if ( isset($this->args[$handle]) ) - $ver .= '&' . $this->args[$handle]; - $src = 0 === strpos($this->scripts[$handle]->src, 'http://') ? $this->scripts[$handle]->src : get_option( 'siteurl' ) . $this->scripts[$handle]->src; - echo "\n"; + if ( $this->scripts[$handle]->src ) { // Else it defines a group. + $ver = $this->scripts[$handle]->ver ? $this->scripts[$handle]->ver : $wp_db_version; + if ( isset($this->args[$handle]) ) + $ver .= '&' . $this->args[$handle]; + $src = 0 === strpos($this->scripts[$handle]->src, 'http://') ? $this->scripts[$handle]->src : get_option( 'siteurl' ) . $this->scripts[$handle]->src; + $src = add_query_arg('ver', $ver, $src); + echo "\n"; + } $this->printed[] = $handle; } }