WIP: Allow the extension to do its own rendering of fields outside the menu if needed.

This commit is contained in:
James Muehlner
2024-01-15 23:44:00 +00:00
parent 2a18c330fc
commit 99e02b4166
4 changed files with 34 additions and 12 deletions

View File

@@ -498,17 +498,34 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
$scope.menu.connectionParameters = newFocusedClient ?
ManagedClient.getArgumentModel(newFocusedClient) : {};
// Re-broadcast the updated client
$scope.$broadcast('guacClientChanged', newFocusedClient);
});
// Track when the protocol changes for the current client - generally
// this will be when the protocol is first set for the client
$scope.$on('guacClientProtocolUpdated', function protocolChanged(event, focusedClient) {
// Ignore any updated protocol not for the current focused client
if ($scope.focusedClient && $scope.focusedClient === focusedClient)
// Re-broadcast the updated protocol
$scope.$broadcast('guacClientProtocolChanged', focusedClient);
});
// Automatically update connection parameters that have been modified
// for the current focused client
$scope.$on('guacClientArgumentsUpdated', function focusedClientChanged(event, focusedClient) {
$scope.$on('guacClientArgumentsUpdated', function argumentsChanged(event, focusedClient) {
// Update available connection parameters, if the updated arguments are
// for the current focused client - otherwise ignore them
if ($scope.focusedClient && $scope.focusedClient === focusedClient)
// Ignore any updated arguments not for the current focused client
if ($scope.focusedClient && $scope.focusedClient === focusedClient) {
$scope.menu.connectionParameters = ManagedClient.getArgumentModel(focusedClient);
// Re-broadcast the updated arguments
$scope.$broadcast('guacClientArgumentsChanged', focusedClient);
}
});
// Update page icon when thumbnail changes

View File

@@ -97,6 +97,11 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient
$scope.$emit('guacClientArgumentsUpdated', $scope.getFocusedClient());
}, true);
// Notify whenever protocol of currently-focused client changes
$scope.$watch('getFocusedClient().protocol', function focusedClientParametersChanged() {
$scope.$emit('guacClientProtocolUpdated', $scope.getFocusedClient());
}, true);
/**
* Returns a callback for guacClick that assigns or updates keyboard
* focus to the given client, allowing that client to receive and

View File

@@ -27,11 +27,11 @@
background: #EEE;
box-shadow: inset -1px 0 2px white, 1px 0 2px black;
z-index: 100;
-webkit-transition: left 0.125s;
-moz-transition: left 0.125s;
-ms-transition: left 0.125s;
-o-transition: left 0.125s;
transition: left 0.125s;
-webkit-transition: left 0.125s, opacity 0.125s;
-moz-transition: left 0.125s, opacity 0.125s;
-ms-transition: left 0.125s, opacity 0.125s;
-o-transition: left 0.125s, opacity 0.125s;
transition: left 0.125s, opacity 0.125s;
}
.menu-content {
@@ -137,10 +137,10 @@
.menu,
.menu.closed {
left: -480px;
visibility: hidden;
opacity: 0;
}
.menu.open {
left: 0px;
visibility: visible;
opacity: 1;
}

View File

@@ -47,7 +47,7 @@
<!-- Menu -->
<div class="menu" ng-class="{open: menu.shown}" id="guac-menu">
<div class="menu-content" guac-touch-drag="menuDrag">
<div class="menu-content" ng-if="menu.shown" guac-touch-drag="menuDrag">
<!-- Stationary header -->
<div class="header">