From 9111bae4168491897a60a0f956206d6adc1756d8 Mon Sep 17 00:00:00 2001 From: parisholley Date: Fri, 18 Jan 2013 17:28:52 +0000 Subject: [PATCH 1/2] updating to wordpress url git-svn-id: http://plugins.svn.wordpress.org/asynchronous-javascript/trunk@654972 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- asynchronous-javascript.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asynchronous-javascript.php b/asynchronous-javascript.php index bb036c1..83e3d67 100644 --- a/asynchronous-javascript.php +++ b/asynchronous-javascript.php @@ -1,7 +1,7 @@ Date: Fri, 18 Jan 2013 19:51:28 +0000 Subject: [PATCH 2/2] Wordpress already orders dependencies, updated as head.js doesn't support multiple dependency resolution git-svn-id: http://plugins.svn.wordpress.org/asynchronous-javascript/trunk@655004 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- README.txt | 3 +++ asynchronous-javascript.php | 14 ++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.txt b/README.txt index 05cd58d..2070e80 100755 --- a/README.txt +++ b/README.txt @@ -43,6 +43,9 @@ This plugin will not work out the box with the following plugins (unless they ar == Changelog == += 1.2.0 = +* Wordpress already orders dependencies, updated as head.js doesn't support multiple dependency resolution + = 1.1.2 = * Starting incompatibility list diff --git a/asynchronous-javascript.php b/asynchronous-javascript.php index 83e3d67..5f588c7 100644 --- a/asynchronous-javascript.php +++ b/asynchronous-javascript.php @@ -3,7 +3,7 @@ Plugin Name: Asynchronous Javascript Plugin URI: http://wordpress.org/extend/plugins/asynchronous-javascript/ Description: Improve page load performance by asynchronously loading javascript using head.js -Version: 1.1.2 +Version: 1.2.0 Author: Paris Holley Author URI: http://www.linkedin.com/in/parisholley Author Email: mail@parisholley.com @@ -73,16 +73,14 @@ function filter_headjs(){ self::$head_loaded = true; } + $handles = array(); + foreach(self::$depends as $handle => $depend){ - if(is_array($depend['deps']) && count($depend['deps']) > 0){ - echo ''; - }elseif(is_string($depend['deps'])){ - echo ''; - }else{ - echo ''; - } + $handles[] = '{"' . $handle . '": "' . $depend['src'] . '"}'; } + echo ''; + self::$depends = array(); }