diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js index ad55691c8..fbce5cc37 100644 --- a/guacamole/src/main/webapp/app/client/controllers/clientController.js +++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js @@ -28,6 +28,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams // Required types var ManagedClientState = $injector.get('ManagedClientState'); + var ManagedFilesystem = $injector.get('ManagedFilesystem'); var ScrollState = $injector.get('ScrollState'); // Required services @@ -595,6 +596,45 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams return !!$scope.filesystemMenuContents && $scope.menu.shown; }; + /** + * Returns the full path to the given file as an ordered array of parent + * directories. + * + * @param {ManagedFilesystem.File} file + * The file whose full path should be retrieved. + * + * @returns {ManagedFilesystem.File[]} + * An array of directories which make up the hierarchy containing the + * given file, in order of increasing depth. + */ + $scope.getPath = function getPath(file) { + + var path = []; + + // Add all files to path in ascending order of depth + while (file && file.parent) { + path.unshift(file); + file = file.parent; + } + + return path; + + }; + + /** + * Changes the current directory of the given filesystem to the given + * directory. + * + * @param {ManagedFilesystem} filesystem + * The filesystem whose current directory should be changed. + * + * @param {ManagedFilesystem.File} file + * The directory to change to. + */ + $scope.changeDirectory = function changeDirectory(filesystem, file) { + ManagedFilesystem.changeDirectory(filesystem, file); + }; + // Clean up when view destroyed $scope.$on('$destroy', function clientViewDestroyed() { diff --git a/guacamole/src/main/webapp/app/client/directives/guacFileBrowser.js b/guacamole/src/main/webapp/app/client/directives/guacFileBrowser.js index 9e5e047cc..ba03a9e98 100644 --- a/guacamole/src/main/webapp/app/client/directives/guacFileBrowser.js +++ b/guacamole/src/main/webapp/app/client/directives/guacFileBrowser.js @@ -79,22 +79,14 @@ angular.module('client').directive('guacFileBrowser', [function guacFileBrowser( }; /** - * Toggles the expanded state of the given file between expanded - * and collapsed, showing or hiding the file's children. This is - * only applicable to directories. + * Changes the currently-displayed directory to the given + * directory. * * @param {ManagedFilesystem.File} file - * The file to expand or collapse. + * The directory to change to. */ - $scope.toggleExpanded = function toggleExpanded(file) { - - // Toggle expanded state - file.expanded = !file.expanded; - - // If now expanded, refresh contents - if (file.expanded) - ManagedFilesystem.refresh($scope.filesystem, file); - + $scope.changeDirectory = function changeDirectory(file) { + ManagedFilesystem.changeDirectory($scope.filesystem, file); }; /** diff --git a/guacamole/src/main/webapp/app/client/styles/file-browser.css b/guacamole/src/main/webapp/app/client/styles/file-browser.css index 2c6c923fb..73fce34ad 100644 --- a/guacamole/src/main/webapp/app/client/styles/file-browser.css +++ b/guacamole/src/main/webapp/app/client/styles/file-browser.css @@ -27,10 +27,8 @@ display: none; } -/* Show directory contents if expanded */ - -.file-browser .directory.expanded > .children { - display: block; +.file-browser .list-item .caption { + white-space: nowrap; } /* Directory / file icons */ @@ -43,6 +41,6 @@ background-image: url('images/folder-closed.png'); } -.file-browser .directory.expanded > .caption .icon { - background-image: url('images/folder-open.png'); +.file-browser .directory.previous > .caption .icon { + background-image: url('images/folder-up.png'); } diff --git a/guacamole/src/main/webapp/app/client/styles/filesystem-menu.css b/guacamole/src/main/webapp/app/client/styles/filesystem-menu.css index ce417e042..76ee72ff7 100644 --- a/guacamole/src/main/webapp/app/client/styles/filesystem-menu.css +++ b/guacamole/src/main/webapp/app/client/styles/filesystem-menu.css @@ -46,3 +46,26 @@ -webkit-align-items: center; align-items: center; } + +#filesystem-menu .menu-body { + padding: 0.25em; +} + +#filesystem-menu .header.breadcrumbs { + background: rgba(0,0,0,0.0125); + border-bottom: 1px solid rgba(0,0,0,0.05); + box-shadow: none; + margin-top: 0; + border-top: none; +} + +#filesystem-menu .header.breadcrumbs .breadcrumb { + padding: 0.5em; + font-size: 0.8em; + font-weight: bold; +} + +#filesystem-menu .header.breadcrumbs .breadcrumb:hover { + background-color: #CDA; + cursor: pointer; +} diff --git a/guacamole/src/main/webapp/app/client/templates/client.html b/guacamole/src/main/webapp/app/client/templates/client.html index 27ee14937..6493ffef2 100644 --- a/guacamole/src/main/webapp/app/client/templates/client.html +++ b/guacamole/src/main/webapp/app/client/templates/client.html @@ -174,6 +174,12 @@ + +
+ -