From 132c4e9f358a2c4f608715d50876616ff8909f57 Mon Sep 17 00:00:00 2001 From: Jon Lambson Date: Thu, 2 Nov 2017 17:00:39 -0600 Subject: [PATCH] added a download btn which doesnt work --- js/controllers/website-controller.js | 17 +++++++++++++---- templates/website.html | 2 +- templates/widgets/filetree.html | 3 ++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/js/controllers/website-controller.js b/js/controllers/website-controller.js index df7d1fd..5b207b6 100644 --- a/js/controllers/website-controller.js +++ b/js/controllers/website-controller.js @@ -249,8 +249,6 @@ app.controller('websiteCtrl', [ var path = vm.breadcrumbsPath.join('/'); cleanPathQuery(path); vm.Sites.contents(vm.copyR, vm.cleanedPath); - }, function (err) { - console.log(err); }); }; @@ -363,6 +361,7 @@ app.controller('websiteCtrl', [ r.newFile = vm.newFile; } analyzeFile(r.newFile, r); + debugger; console.log(r); }; @@ -528,6 +527,7 @@ app.controller('websiteCtrl', [ return; } var pkg = Auth.oauth3.pkg('www@daplie.com'); + var removedPath = opts.path; return pkg.remove({ hostname: r.domain , domain: r.domain @@ -545,18 +545,27 @@ app.controller('websiteCtrl', [ cleanPathQuery(vm.breadcrumbsPath.join('/')); vm.Sites.contents(vm.copyR, vm.cleanedPath); } + var msg = 'Successfully deleted ' + "'" + removedPath + "'."; + vm.buildNotification(result, msg); }); }; vm.Sites.archive = function (r) { var pkg = Auth.oauth3.pkg('www@daplie.com'); + var path; + if (vm.breadcrumbsPath === undefined && vm.breadcrumbs === undefined) { + path = r.shareAccess.path; + } else { + cleanPathQuery(vm.breadcrumbsPath.join('/')); + path = vm.cleanedPath; + } return pkg.archive({ hostname: r.domain , domain: r.domain , tld: r.tld , sld: r.sld - //, sub: vm.record.sub - //, path: vm.uploadPath + // , sub: vm.record.sub + , path: r.domain + path }).then(function (result) { window.alert(JSON.stringify(result)); // TODO use iframe to initiate download? diff --git a/templates/website.html b/templates/website.html index 74c3644..18447f9 100644 --- a/templates/website.html +++ b/templates/website.html @@ -240,7 +240,7 @@

Invite: pending Accepted

- +
diff --git a/templates/widgets/filetree.html b/templates/widgets/filetree.html index 9cbebf3..c7c47f6 100644 --- a/templates/widgets/filetree.html +++ b/templates/widgets/filetree.html @@ -26,10 +26,11 @@
+