GUAC-605: Fix clipboard handling.

This commit is contained in:
Michael Jumper
2014-11-16 16:43:39 -08:00
parent 4e67487077
commit 452ec41fbd
3 changed files with 7 additions and 14 deletions

View File

@@ -86,8 +86,8 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams',
}; };
// Update the model when clipboard data received from client // Update the model when clipboard data received from client
$scope.$on('guacClientClipboard', function clipboardDataReceived(clipboardData) { $scope.$on('guacClientClipboard', function clientClipboardListener(event, client, mimetype, clipboardData) {
$scope.guacClipboard = clipboardData; $scope.clipboardData = clipboardData;
}); });
/* /*
@@ -135,12 +135,12 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams',
$scope.$watch('menuShown', function setKeyboardEnabled(menuShown, menuShownPreviousState) { $scope.$watch('menuShown', function setKeyboardEnabled(menuShown, menuShownPreviousState) {
// Send clipboard data if menu is hidden // Send clipboard data if menu is hidden
if (!menuShown && menuShownPreviousState) { if (!menuShown && menuShownPreviousState)
$scope.$broadcast('guacClipboard', $scope.clipboardData); $scope.$broadcast('guacClipboard', 'text/plain', $scope.clipboardData);
}
// Disable client keyboard if the menu is shown // Disable client keyboard if the menu is shown
$scope.clientProperties.keyboardEnabled = !menuShown; $scope.clientProperties.keyboardEnabled = !menuShown;
}); });
$scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) { $scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) {

View File

@@ -55,8 +55,6 @@ angular.module('client').directive('guacClient', [function guacClient() {
} }
}; };
$scope.clipboard = "";
/** /**
* Whether the local, hardware mouse cursor is in use. * Whether the local, hardware mouse cursor is in use.
* *
@@ -290,7 +288,7 @@ angular.module('client').directive('guacClient', [function guacClient() {
*/ */
// Update active client if clipboard changes // Update active client if clipboard changes
$scope.$watch('clipboard', function clipboardChange(data) { $scope.$on('guacClipboard', function onClipboard(event, mimetype, data) {
if (client) if (client)
client.setClipboard(data); client.setClipboard(data);
}); });

View File

@@ -67,11 +67,6 @@ angular.module('client').factory('guacClientFactory', ['$rootScope',
// Connected // Connected
case 3: case 3:
$scope.$emit('guacClientStateChange', guacClient, "connected"); $scope.$emit('guacClientStateChange', guacClient, "connected");
// Update server clipboard with current data
if ($scope.clipboard)
guacClient.setClipboard($scope.clipboard);
break; break;
// Disconnecting / disconnected are handled by tunnel instead // Disconnecting / disconnected are handled by tunnel instead
@@ -131,7 +126,7 @@ angular.module('client').factory('guacClientFactory', ['$rootScope',
// Emit event when done // Emit event when done
reader.onend = function clipboard_text_end() { reader.onend = function clipboard_text_end() {
$scope.$emit('guacClientClipboard', guacClient, data); $scope.$emit('guacClientClipboard', guacClient, mimetype, data);
}; };
}); });