From 509ba2f4f79b0d3e93bbe3161559fbae1ca4b305 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 17 Feb 2014 17:36:58 -0500 Subject: [PATCH] Add ability to download the build pack --- static/js/controllers.js | 6 ++++++ static/partials/build-package.html | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/static/js/controllers.js b/static/js/controllers.js index 13a9a672d..0935611e7 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -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); diff --git a/static/partials/build-package.html b/static/partials/build-package.html index 69091167d..6222ee2ef 100644 --- a/static/partials/build-package.html +++ b/static/partials/build-package.html @@ -9,6 +9,11 @@ +
+ + + +