Add ability to download the build pack

This commit is contained in:
Joseph Schorr 2014-02-17 17:36:58 -05:00
parent bc0d51656a
commit 509ba2f4f7
2 changed files with 11 additions and 0 deletions

View file

@ -793,6 +793,11 @@ function BuildPackageCtrl($scope, Restangular, ApiService, $routeParams, $rootSc
}, 10);
};
$scope.downloadForUser = function() {
var blob = $scope.zip.generate({type:"blob"});
saveAs(blob, $scope.repobuild['display_name'] + '.zip');
};
var processBuildPack = function(response) {
// Try to load as a zip file.
var zipFiles = null;
@ -813,6 +818,7 @@ function BuildPackageCtrl($scope, Restangular, ApiService, $routeParams, $rootSc
}
// Build the zip file tree.
$scope.zip = zip;
$scope.tree = new FileTree(Object.keys(zipFiles));
$($scope.tree).bind('fileClicked', function(e) {
var file = zip.file(e.path);