mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-09 06:31:22 +00:00
GUAC-1480: Use AllowClipboard and execCommand for local/remote clipboard integration.
This commit is contained in:
@@ -35,6 +35,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
// Required services
|
||||
var $location = $injector.get('$location');
|
||||
var authenticationService = $injector.get('authenticationService');
|
||||
var clipboardService = $injector.get('clipboardService');
|
||||
var guacClientManager = $injector.get('guacClientManager');
|
||||
var guacNotification = $injector.get('guacNotification');
|
||||
var preferenceService = $injector.get('preferenceService');
|
||||
@@ -230,11 +231,6 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
$scope.menu.shown = false;
|
||||
};
|
||||
|
||||
// Update the model when clipboard data received from client
|
||||
$scope.$on('guacClientClipboard', function clientClipboardListener(event, client, mimetype, clipboardData) {
|
||||
$scope.clipboardData = clipboardData;
|
||||
});
|
||||
|
||||
/**
|
||||
* The client which should be attached to the client UI.
|
||||
*
|
||||
@@ -526,6 +522,19 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
|
||||
});
|
||||
}
|
||||
|
||||
// Hide status and sync local clipboard once connected
|
||||
else if (connectionState === ManagedClientState.ConnectionState.CONNECTED) {
|
||||
|
||||
// Sync with local clipboard
|
||||
clipboardService.getLocalClipboard().then(function clipboardRead(data) {
|
||||
$scope.$broadcast('guacClipboard', 'text/plain', data);
|
||||
});
|
||||
|
||||
// Hide status notification
|
||||
guacNotification.showStatus(false);
|
||||
|
||||
}
|
||||
|
||||
// Hide status for all other states
|
||||
else
|
||||
guacNotification.showStatus(false);
|
||||
|
Reference in New Issue
Block a user