You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/05/02 20:02:06 UTC
[3/4] git commit: Use the new AppBundle uri without redirect or
direct specified.
Use the new AppBundle uri without redirect or direct specified.
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/835dbff1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/835dbff1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/835dbff1
Branch: refs/heads/master
Commit: 835dbff122a97ece28a03d80804416375f9da00f
Parents: 2fc6545
Author: Shravan Narayan <sh...@google.com>
Authored: Tue Apr 30 22:06:30 2013 -0400
Committer: Shravan Narayan <sh...@google.com>
Committed: Tue Apr 30 22:06:30 2013 -0400
----------------------------------------------------------------------
hooks/after_prepare/cordovajsmenu.js | 8 ++++----
www/contextMenu.html | 6 +++---
www/js/AppsService.js | 4 ++++
www/js/CdvhPackageHandler.js | 4 ++--
www/js/ContextMenu.js | 2 +-
5 files changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/835dbff1/hooks/after_prepare/cordovajsmenu.js
----------------------------------------------------------------------
diff --git a/hooks/after_prepare/cordovajsmenu.js b/hooks/after_prepare/cordovajsmenu.js
index f344389..bbc976d 100755
--- a/hooks/after_prepare/cordovajsmenu.js
+++ b/hooks/after_prepare/cordovajsmenu.js
@@ -5,13 +5,13 @@ var path = require('path');
var androidAppend = function() {
var location = document.location.toString();
- if(location.indexOf("file:///android_asset") === 0) {
+ if(location.indexOf("file:///android_asset") === 0 || location.search("app-bundle:///") === 0) {
console.log("Not injecting");
} else {
console.log("Injecting menu script");
var contextScript = document.createElement('script');
contextScript.setAttribute("type","text/javascript");
- contextScript.setAttribute("src", "app-bundle:///direct/js/ContextMenu.js");
+ contextScript.setAttribute("src", "app-bundle:///js/ContextMenu.js");
document.getElementsByTagName("head")[0].appendChild(contextScript);
}
};
@@ -20,13 +20,13 @@ var iosAppend = function() {
var location = document.location.toString();
//Match file:///SOME_PATH/Applications/SOME_GUID/SOME_NAME.app/SOME_PATH
var regex = /^file:\/\/\/.*?\/Applications\/(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})\/.*?\.app/g;
- if(location.search(regex) === 0) {
+ if(location.search(regex) === 0 || location.search("app-bundle:///") === 0) {
console.log("Not injecting");
} else {
console.log("Injecting menu script");
var contextScript = document.createElement('script');
contextScript.setAttribute("type","text/javascript");
- contextScript.setAttribute("src", "app-bundle:///direct/js/ContextMenu.js");
+ contextScript.setAttribute("src", "app-bundle:///js/ContextMenu.js");
document.getElementsByTagName("head")[0].appendChild(contextScript);
}
};
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/835dbff1/www/contextMenu.html
----------------------------------------------------------------------
diff --git a/www/contextMenu.html b/www/contextMenu.html
index fd514e9..3f30fd3 100644
--- a/www/contextMenu.html
+++ b/www/contextMenu.html
@@ -38,13 +38,13 @@
<p>Tap Anywhere to Close</p>
<ul>
<li>
- <a href="app-bundle:///redirect/index.html#/?updateLastLaunched=true"><button>Update</button></a>
+ <a href="app-bundle:///index.html#/?updateLastLaunched=true"><button>Update</button></a>
</li>
<li>
- <a href="app-bundle:///redirect/index.html#/?lastLaunched=true"><button>Restart</button></a>
+ <a href="app-bundle:///index.html#/?lastLaunched=true"><button>Restart</button></a>
</li>
<li>
- <a href="app-bundle:///redirect/index.html"><button>Back to Main Menu</button></a>
+ <a href="app-bundle:///index.html"><button>Back to Main Menu</button></a>
</li>
</ul>
</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/835dbff1/www/js/AppsService.js
----------------------------------------------------------------------
diff --git a/www/js/AppsService.js b/www/js/AppsService.js
index 2da485f..def3d40 100644
--- a/www/js/AppsService.js
+++ b/www/js/AppsService.js
@@ -148,6 +148,10 @@
return getAppStartPageFromAppLocation(appLocation);
})
.then(function(startLocation) {
+ //ensure we use a file uri
+ if(startLocation.search("file://") !== 0){
+ startLocation = "file://" + startLocation;
+ }
window.location = startLocation;
});
},
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/835dbff1/www/js/CdvhPackageHandler.js
----------------------------------------------------------------------
diff --git a/www/js/CdvhPackageHandler.js b/www/js/CdvhPackageHandler.js
index c5205e6..7d4a41e 100644
--- a/www/js/CdvhPackageHandler.js
+++ b/www/js/CdvhPackageHandler.js
@@ -23,8 +23,8 @@
return ResourcesLoader.extractZipFile(fileName, outputDirectory)
.then(function(){
return Q.all([
- copyFile("cdv-app-harness:///direct/cordova.js", outputDirectory + "/www/cordova.js"),
- copyFile("cdv-app-harness:///direct/cdvh_files/www/cordova_plugins.json", outputDirectory + "/www/cordova_plugins.json")
+ copyFile("app-bundle:///cordova.js", outputDirectory + "/www/cordova.js"),
+ copyFile("app-bundle:///cdvh_files/www/cordova_plugins.json", outputDirectory + "/www/cordova_plugins.json")
]);
});
}
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/835dbff1/www/js/ContextMenu.js
----------------------------------------------------------------------
diff --git a/www/js/ContextMenu.js b/www/js/ContextMenu.js
index 5571de8..3e64487 100644
--- a/www/js/ContextMenu.js
+++ b/www/js/ContextMenu.js
@@ -1,7 +1,7 @@
(function () {
function initialise() {
- var contextHTMLUrl = "app-bundle:///direct/contextMenu.html";
+ var contextHTMLUrl = "app-bundle:///contextMenu.html";
var xhr = new window.XMLHttpRequest();
xhr.onreadystatechange=function()
{