You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2014/01/27 17:04:19 UTC
[4/6] git commit: Update file handling code to modern File plugin
(post Ian's refactoring)
Update file handling code to modern File plugin (post Ian's refactoring)
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/7d624328
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/7d624328
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/7d624328
Branch: refs/heads/master
Commit: 7d6243284e9db5f449596fa4efada22bebf3611e
Parents: 6f99f08
Author: Braden Shepherdson <br...@gmail.com>
Authored: Thu Jan 23 15:11:38 2014 -0500
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Thu Jan 23 15:11:38 2014 -0500
----------------------------------------------------------------------
www/cdvah/js/ResourcesLoader.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/7d624328/www/cdvah/js/ResourcesLoader.js
----------------------------------------------------------------------
diff --git a/www/cdvah/js/ResourcesLoader.js b/www/cdvah/js/ResourcesLoader.js
index e6faecf..8d634f3 100644
--- a/www/cdvah/js/ResourcesLoader.js
+++ b/www/cdvah/js/ResourcesLoader.js
@@ -6,8 +6,12 @@
var rootDir;
function initialiseFileSystem() {
- // HACK: Need to discuss better way to get the root entry.
- return $q.when(rootDir = new $window.DirectoryEntry('/', '/'));
+ var d = $q.defer();
+ $window.resolveLocalFileSystemURL('file:///', function(entry) {
+ rootDir = entry;
+ d.resolve(entry);
+ }, d.reject);
+ return d.promise;
}
//promise returns full path to downloaded file