Scriptaculous loader changes from mdawaffe. fixes #3519

git-svn-id: http://svn.automattic.com/wordpress/trunk@4701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-01-08 03:03:36 +00:00
parent d8d4ca14d0
commit 9ed4ad213b
1 changed files with 15 additions and 9 deletions

View File

@ -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 "<script type='text/javascript' src='$src?ver=$ver'></script>\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 .= '&amp;' . $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 "<script type='text/javascript' src='$src'></script>\n";
}
$this->printed[] = $handle;
}
}