Updated Branches:
  refs/heads/master decc32d89 -> 715ffaed7

Bringing AppHarness up to Cordova 3.x


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/715ffaed
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/715ffaed
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/715ffaed

Branch: refs/heads/master
Commit: 715ffaed7a6f2fac3b65ade811782ee2ae0273c4
Parents: decc32d
Author: Braden Shepherdson <[email protected]>
Authored: Wed Aug 14 16:56:33 2013 -0400
Committer: Braden Shepherdson <[email protected]>
Committed: Wed Aug 14 16:56:33 2013 -0400

----------------------------------------------------------------------
 www/cdvah_js/CdvhPackageHandler.js      |  6 +++---
 www/cdvah_js/ContextMenuInjectScript.js |  2 +-
 www/cdvah_js/CrxPackageHandler.js       | 13 ++++---------
 3 files changed, 8 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/715ffaed/www/cdvah_js/CdvhPackageHandler.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/CdvhPackageHandler.js 
b/www/cdvah_js/CdvhPackageHandler.js
index bea8280..a5dc56a 100644
--- a/www/cdvah_js/CdvhPackageHandler.js
+++ b/www/cdvah_js/CdvhPackageHandler.js
@@ -25,7 +25,7 @@
                 var dataToAppend = 
ContextMenuInjectScript.getInjectString(appName);
                 var platformDirectory = outputDirectory + "/" + platformId + 
"/www/";
                 var cordovaFile = platformDirectory + "cordova.js";
-                var pluginsFile = platformDirectory + "cordova_plugins.json";
+                var pluginsFile = platformDirectory + "cordova_plugins.js";
 
                 // We need to
                 // 1) Modify the cordova.js file
@@ -39,7 +39,7 @@
                     if(fileExists){
                         return Q.all([
                             ResourcesLoader.appendFileContents(cordovaFile, 
dataToAppend),
-                            
copyFile("app-bundle:///cdvh_files/www/cordova_plugins.json", pluginsFile)
+                            
copyFile("app-bundle:///cdvh_files/www/cordova_plugins.js", pluginsFile)
                         ]);
                     } else {
                         throw new Error("The package does not seem to have the 
files required for the platform: " + platformId);
@@ -49,4 +49,4 @@
         });
 
     }]);
-})();
\ No newline at end of file
+})();

http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/715ffaed/www/cdvah_js/ContextMenuInjectScript.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ContextMenuInjectScript.js 
b/www/cdvah_js/ContextMenuInjectScript.js
index 5a703cc..6084036 100644
--- a/www/cdvah_js/ContextMenuInjectScript.js
+++ b/www/cdvah_js/ContextMenuInjectScript.js
@@ -7,7 +7,7 @@
                 console.log("Injecting menu script");
                 var contextScript = document.createElement("script");
                 contextScript.setAttribute("type","text/javascript");
-                contextScript.setAttribute("src", 
"app-bundle:///cdvah_js/ContextMenu.js");
+                contextScript.setAttribute("src", 
"app-bundle:///ContextMenu.js");
                 window.__cordovaAppHarnessAppName = "appPlaceHolder";
                 
document.getElementsByTagName("head")[0].appendChild(contextScript);
             });

http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/715ffaed/www/cdvah_js/CrxPackageHandler.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/CrxPackageHandler.js 
b/www/cdvah_js/CrxPackageHandler.js
index 8019d5d..9c4500c 100644
--- a/www/cdvah_js/CrxPackageHandler.js
+++ b/www/cdvah_js/CrxPackageHandler.js
@@ -33,13 +33,7 @@
                 // 2) Modify the cordova.js file
                 return ResourcesLoader.extractZipFile(fileName, 
platformWWWDirectory)
                 .then(function(){
-                    // Read cordova_plugins.json and use it to copy the plugin 
Javascript files.
-                    return 
ResourcesLoader.xhrGet("app-bundle:///cordova_plugins.json");
-                })
-                .then(function(xhr) {
-                    return JSON.parse(xhr.responseText.trim());
-                })
-                .then(function(plugins){
+                    var plugins = cordova.require('cordova/plugin_list');
                     if (!plugins) {
                         throw new Error('Error loading cordova_plugins.json');
                     }
@@ -47,10 +41,11 @@
                     var copies = [
                         copyFile("app-bundle:///cordova.js", cordovaFile),
                         copyFile("app-bundle:///crx_files/config." + 
platformId + ".xml", platformDirectory + "config.xml"),
-                        copyFile("app-bundle:///cordova_plugins.json", 
platformWWWDirectory + "cordova_plugins.json"),
+                        copyFile("app-bundle:///cordova_plugins.js", 
platformWWWDirectory + "cordova_plugins.js"),
                         copyFile("app-bundle:///chromeapp.html", 
platformWWWDirectory + "chromeapp.html"),
                         copyFile("app-bundle:///chromeappstyles.css", 
platformWWWDirectory + "chromeappstyles.css"),
-                        copyFile("app-bundle:///chromebgpage.html", 
platformWWWDirectory + "chromebgpage.html")
+                        copyFile("app-bundle:///chromebgpage.html", 
platformWWWDirectory + "chromebgpage.html"),
+                        copyFile("app-bundle:///cdvah_js/ContextMenu.js", 
platformWWWDirectory + "ContextMenu.js")
                     ];
 
                     for(var i = 0; i < plugins.length; i++) {

Reply via email to