You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2014/05/27 22:08:35 UTC

git commit: Added unzip percentages.

Repository: cordova-app-harness
Updated Branches:
  refs/heads/master 4baa54905 -> 0ae1895a3


Added unzip percentages.

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/0ae1895a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/0ae1895a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/0ae1895a

Branch: refs/heads/master
Commit: 0ae1895a38d9efdad2cf0bf27b57c1324e47ede1
Parents: 4baa549
Author: Max Woghiren <ma...@gmail.com>
Authored: Tue May 27 16:07:46 2014 -0400
Committer: Max Woghiren <ma...@gmail.com>
Committed: Tue May 27 16:07:46 2014 -0400

----------------------------------------------------------------------
 www/cdvah/js/HarnessServer.js   | 2 ++
 www/cdvah/js/ResourcesLoader.js | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/0ae1895a/www/cdvah/js/HarnessServer.js
----------------------------------------------------------------------
diff --git a/www/cdvah/js/HarnessServer.js b/www/cdvah/js/HarnessServer.js
index 78ffc7c..2bc1942 100644
--- a/www/cdvah/js/HarnessServer.js
+++ b/www/cdvah/js/HarnessServer.js
@@ -264,6 +264,8 @@
                 })
                 .then(function() {
                     return ResourcesLoader.readJSONFileContents(tmpDirUrl + 'zipassetmanifest.json');
+                }, null, function(unzipPercentage) {
+                    app.updatingStatus = unzipPercentage;
                 })
                 .then(function(zipAssetManifest) {
                     var keys = Object.keys(zipAssetManifest);

http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/0ae1895a/www/cdvah/js/ResourcesLoader.js
----------------------------------------------------------------------
diff --git a/www/cdvah/js/ResourcesLoader.js b/www/cdvah/js/ResourcesLoader.js
index 557275d..a0751df 100644
--- a/www/cdvah/js/ResourcesLoader.js
+++ b/www/cdvah/js/ResourcesLoader.js
@@ -211,8 +211,13 @@
                         }
                     };
 
+                    var onZipProgress = function(progressEvent) {
+                        var unzipPercentage = Math.round((progressEvent.loaded / progressEvent.total) * 100);
+                        deferred.notify(unzipPercentage);
+                    };
+
                     /* global zip */
-                    zip.unzip(zipUrl, outputDirectory, onZipDone);
+                    zip.unzip(zipUrl, outputDirectory, onZipDone, onZipProgress);
                     return deferred.promise;
                 });
             }