This commit is contained in:
Jon Lambson 2017-09-26 17:25:59 -06:00
parent 9b53de6cd6
commit 2acc8cb2b4
3 changed files with 41 additions and 4 deletions

View File

@ -344,9 +344,23 @@ app.controller('websiteCtrl', [
window.alert(JSON.stringify(result)); window.alert(JSON.stringify(result));
}); });
}; };
Array.prototype.remByVal = function(val) {
for (var i = 0; i < this.length; i++) {
if (this[i] === val) {
this.splice(i, 1);
i--;
}
}
return this;
};
// TODO: finish thissssssss // TODO: finish thissssssss
vm.breadcrumbs = ['Root']; vm.breadcrumbs = ['Root'];
vm.breadcrumbsPath = ['/']; vm.breadcrumbsPath = ['/'];
vm.blah = false;
vm.Sites.contents = function (r) { vm.Sites.contents = function (r) {
vm.siteResults = r; vm.siteResults = r;
vm.directoryPath = r.newPath; vm.directoryPath = r.newPath;
@ -362,6 +376,21 @@ app.controller('websiteCtrl', [
vm.breadcrumbs.push(path); vm.breadcrumbs.push(path);
vm.breadcrumbsPath.push(path); vm.breadcrumbsPath.push(path);
} }
if (vm.blah) {
if (path === 'Root') {
vm.breadcrumbs = ['Root'];
vm.breadcrumbsPath = ['/'];
vm.activePath = 'active'
vm.blah = false;
} else {
var breadcrumbsPath = vm.breadcrumbsPath;
var breadcrumbs = vm.breadcrumbs;
var removeFromBreadcrumbsPath = breadcrumbsPath.indexOf(path) + 1;
var removeFromBreadcrumbs = breadcrumbs.indexOf(path) + 1;
vm.breadcrumbsPath = breadcrumbsPath.splice(0,removeFromBreadcrumbsPath);
vm.breadcrumbs = breadcrumbs.splice(0,removeFromBreadcrumbs);
}
}
} }
updatePath(newPath); updatePath(newPath);
return pkg.contents({ return pkg.contents({
@ -394,8 +423,10 @@ app.controller('websiteCtrl', [
}; };
vm.doSomething = function (x) { vm.doSomething = function (x) {
console.log('path requested', x); vm.blah = true;
console.log('current path', vm.breadcrumbsPath); vm.siteDirectories = [];
vm.siteFiles = [];
vm.getSiteContents(x);
}; };
vm.Shares = {}; vm.Shares = {};

View File

@ -178,7 +178,6 @@
</div> --> </div> -->
<button class="btn btn-info trigger-search" ng-click="vm.Sites.contents(r)">List Files</button> <button class="btn btn-info trigger-search" ng-click="vm.Sites.contents(r)">List Files</button>
<div class="white-well" ng-show="vm.showListFiles"> <div class="white-well" ng-show="vm.showListFiles">
<button type="button" class="close" ng-click="vm.showListFiles = false" ng-show="vm.showListFiles"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<file-tree r="r"></file-tree> <file-tree r="r"></file-tree>
</div> </div>
</form> </form>

View File

@ -1,7 +1,8 @@
<div class="text-left"> <div class="text-left">
<div class="row"> <div class="row">
<ul class="breadcrumb"> <ul class="breadcrumb">
<li ng-repeat="breadcrumb in vm.breadcrumbs track by $index"> <button type="button" class="close" ng-click="vm.showListFiles = false" ng-show="vm.showListFiles"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<li ng-repeat="breadcrumb in vm.breadcrumbs track by $index" class="{{ vm.activePath }}">
<a ng-click="vm.doSomething(breadcrumb)" data="{{ breadcrumb }}">{{ breadcrumb }}</a> <a ng-click="vm.doSomething(breadcrumb)" data="{{ breadcrumb }}">{{ breadcrumb }}</a>
<!-- <li class="active">Data</li> --> <!-- <li class="active">Data</li> -->
</li> </li>
@ -26,4 +27,10 @@
<pre style="font-size: 10px;">{{ vm.folderStructure | stringify }}</pre> <pre style="font-size: 10px;">{{ vm.folderStructure | stringify }}</pre>
</div> </div>
</div> </div>
<div class="row">
<div class="text-center">
<h3 style="color: red;">TODO:// Add functionality</h3>
<button type="button" class="btn btn-danger"><i class="fa fa-trash"></i> Remove all Files</button>
</div>
</div>
</div> </div>