From 6b81dbd564d00cc521ab10fa5512ad9715138dfa Mon Sep 17 00:00:00 2001 From: Jon Lambson Date: Tue, 3 Oct 2017 14:49:45 -0600 Subject: [PATCH] asdf --- css/styles.css | 5 +- js/controllers/website-controller.js | 46 ++++++++++++++- templates/widgets/filetree.html | 85 ++++++++++++++++++---------- 3 files changed, 104 insertions(+), 32 deletions(-) diff --git a/css/styles.css b/css/styles.css index a457058..52cb1f5 100644 --- a/css/styles.css +++ b/css/styles.css @@ -313,7 +313,7 @@ /* ————————————————————– Tree core styles */ -.tree { margin: 0px 1em; } +.tree { margin: 1em; } .tree input { position: absolute; @@ -619,3 +619,6 @@ h2.ssb-title { padding:0; text-transform: uppercase; } +.root { + display: none; +} diff --git a/js/controllers/website-controller.js b/js/controllers/website-controller.js index 7b70031..3da0cb0 100644 --- a/js/controllers/website-controller.js +++ b/js/controllers/website-controller.js @@ -321,10 +321,15 @@ app.controller('websiteCtrl', [ vm.Sites.setUpload = function (r) { console.log("Hey! At least it can tell if there's a change!"); analyzeFile(r.newFile, r); + vm.showCompleteFileUploadBtn = true; console.log(r); + }; vm.Sites.upload = function (r) { - r.uploadPath = vm.autoPopulateWebPath; + debugger; + if (r.uploadPath === undefined) { + r.uploadPath = vm.autoPopulateWebPath; + }; var pkg = Auth.oauth3.pkg('www@daplie.com'); //analyzeFile(r.newFile, r); vm._uploadFile(pkg, r); @@ -367,6 +372,7 @@ app.controller('websiteCtrl', [ var confirmMessage; vm.autoPopulateWebPath; opts = {}; + if (path === undefined) { confirmMessage = "Delete all files for this site?"; opts.path = '/'; @@ -382,6 +388,8 @@ app.controller('websiteCtrl', [ confirmMessage = "Delete all items in this folder?"; if (vm.autoPopulateWebPath === undefined) { opts.path = path; + } else if (vm.autoPopulateWebPath.includes(path)) { + opts.path = vm.autoPopulateWebPath; } else { opts.path = vm.autoPopulateWebPath + path; } @@ -407,12 +415,15 @@ app.controller('websiteCtrl', [ newPath = site; site = vm.siteResults; function updatePath (path) { + vm.currentFolder = path; if (typeof path !== 'object') { vm.breadcrumbs.push(path); vm.breadcrumbsPath.push(path); vm.autoPopulateWebPath = vm.breadcrumbsPath; vm.autoPopulateWebPath.push('/'); vm.autoPopulateWebPath = vm.autoPopulateWebPath.join(''); + } else { + vm.currentFolder = "hidden" } if (vm.breadcrumbPathClicked) { if (path === 'root') { @@ -456,6 +467,28 @@ app.controller('websiteCtrl', [ vm.getSiteContents(r); }; + vm.cleanPath = function () { + vm.savedPath = vm.autoPopulateWebPath; + vm.autoPopulateWebPath = ''; + } + + vm.createNewFolder = function (r) { + if (vm.savedPath === undefined) { + vm.savedPath = '/'; + } + vm.savedPath; + vm.hideFolderInput = 'hidden'; + vm.showFileUploadBtn = true; + r.uploadPath = vm.savedPath + vm.autoPopulateWebPath; + }; + + vm.autoPopulateFolderName = function () { + console.log('blah', vm.currentFolder); + if (vm.currentFolder === 'hidden') { + vm.autoPopulateWebPath = '/' + } + } + vm.getDirectories = function (path) { vm.siteDirectories = []; vm.siteFiles = []; @@ -471,6 +504,11 @@ app.controller('websiteCtrl', [ vm.getSiteContents(dir); }; + vm.triggerDeleteFolder = function (folder, r) { + console.log('DELETE FOLDER ->', folder); + vm.deleteFilesFrom(r, folder) + } + vm.Shares = {}; vm.Shares.invite = function (r) { var pkg = Auth.oauth3.pkg('www@daplie.com'); @@ -685,3 +723,9 @@ app.filter('stringify', function() { return stringify(ob, undefined, 2); }; }); + +app.filter('capitalize', function() { + return function(input) { + return (!!input) ? input.charAt(0).toUpperCase() + input.substr(1).toLowerCase() : ''; + } +}); diff --git a/templates/widgets/filetree.html b/templates/widgets/filetree.html index f3a8d0d..feb8aa3 100644 --- a/templates/widgets/filetree.html +++ b/templates/widgets/filetree.html @@ -2,7 +2,7 @@
@@ -11,45 +11,70 @@

-

alskdfjla

-
-
-
-

Upload Files:

-
- - -
- -
- - - -
99% | 1 MiB / 100 MiB
- -
- - - -
- - +
+ + +
+
+
+
+ + +
+ +
+ +
+ +
99% | 1 MiB / 100 MiB
+ + + + +
+
+
+
+
    +
  • + + + + + +
  • +
  • + +
    + +
    + + + +
    99% | 1 MiB / 100 MiB
    +
  • +
  • + +
  • +
+
+
{{ vm.folderStructure | stringify }}