From f1dfa6dec08d22e05685df5911e384bbc3d2e2d1 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 9 Jul 2007 21:22:38 +0000 Subject: [PATCH] Don't load all includes by default. We have our own script loader. fixes #4512 git-svn-id: https://develop.svn.wordpress.org/trunk@5794 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/scriptaculous/scriptaculous.js | 5 +++-- wp-includes/js/scriptaculous/wp-scriptaculous.js | 5 +++-- wp-includes/script-loader.php | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/wp-includes/js/scriptaculous/scriptaculous.js b/wp-includes/js/scriptaculous/scriptaculous.js index 7c472a600e..e39c40ec51 100644 --- a/wp-includes/js/scriptaculous/scriptaculous.js +++ b/wp-includes/js/scriptaculous/scriptaculous.js @@ -49,10 +49,11 @@ var Scriptaculous = { }).each( function(s) { var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,''); var includes = s.src.match(/\?.*load=([a-z,]*)/); - (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider,sound').split(',').each( + if ( includes ) + includes[1].split(',').each( function(include) { Scriptaculous.require(path+include+'.js') }); }); } } -Scriptaculous.load(); \ No newline at end of file +Scriptaculous.load(); diff --git a/wp-includes/js/scriptaculous/wp-scriptaculous.js b/wp-includes/js/scriptaculous/wp-scriptaculous.js index 7c472a600e..e39c40ec51 100644 --- a/wp-includes/js/scriptaculous/wp-scriptaculous.js +++ b/wp-includes/js/scriptaculous/wp-scriptaculous.js @@ -49,10 +49,11 @@ var Scriptaculous = { }).each( function(s) { var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,''); var includes = s.src.match(/\?.*load=([a-z,]*)/); - (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider,sound').split(',').each( + if ( includes ) + includes[1].split(',').each( function(include) { Scriptaculous.require(path+include+'.js') }); }); } } -Scriptaculous.load(); \ No newline at end of file +Scriptaculous.load(); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 651640823d..d059c53300 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -60,7 +60,7 @@ class WP_Scripts { 'delText' => __('Are you sure you want to delete this %thing%?') ) ); - $this->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.7.1-b3'); + $this->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/scriptaculous.js', array('prototype'), '1.7.1-b3'); $this->add( 'scriptaculous-builder', '/wp-includes/js/scriptaculous/builder.js', array('scriptaculous-root'), '1.7.1-b3'); $this->add( 'scriptaculous-dragdrop', '/wp-includes/js/scriptaculous/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.7.1-b3'); $this->add( 'scriptaculous-effects', '/wp-includes/js/scriptaculous/effects.js', array('scriptaculous-root'), '1.7.1-b3');