mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUAC-807 Clipboard is working.
This commit is contained in:
@@ -46,6 +46,11 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams',
|
|||||||
|
|
||||||
// Hide menu by default
|
// Hide menu by default
|
||||||
$scope.menuShown = false;
|
$scope.menuShown = false;
|
||||||
|
|
||||||
|
// Update the model when clipboard data received from client
|
||||||
|
$scope.$on('guacClientClipboard', function clipboardDataReceived(clipboardData) {
|
||||||
|
$scope.guacClipboard = clipboardData;
|
||||||
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse the type, name, and id out of the url paramteres,
|
* Parse the type, name, and id out of the url paramteres,
|
||||||
@@ -94,6 +99,17 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams',
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.$watch('menuShown', function setKeyboardEnabled(menuShown, menuShownPreviousState) {
|
||||||
|
|
||||||
|
// Send clipboard data if menu is hidden
|
||||||
|
if (!menuShown && menuShownPreviousState) {
|
||||||
|
$scope.$broadcast('guacClipboard', $scope.clipboardData);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable client keyboard if the menu is shown
|
||||||
|
$scope.clientProperties.keyboardEnabled = !menuShown;
|
||||||
|
});
|
||||||
|
|
||||||
$scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) {
|
$scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) {
|
||||||
keysCurrentlyPressed[keysym] = true;
|
keysCurrentlyPressed[keysym] = true;
|
||||||
|
|
||||||
|
@@ -114,12 +114,7 @@ angular.module('client').directive('guacClient', [function guacClient() {
|
|||||||
"emulate_absolute" : true,
|
"emulate_absolute" : true,
|
||||||
"touch" : null,
|
"touch" : null,
|
||||||
"touch_screen" : null,
|
"touch_screen" : null,
|
||||||
"touch_pad" : null,
|
"touch_pad" : null
|
||||||
|
|
||||||
/* Clipboard */
|
|
||||||
|
|
||||||
"remote_clipboard" : "",
|
|
||||||
"clipboard_integration_enabled" : undefined
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var CLIENT_PROPERTY_DEFAULTS = {
|
var CLIENT_PROPERTY_DEFAULTS = {
|
||||||
@@ -680,17 +675,21 @@ angular.module('client').directive('guacClient', [function guacClient() {
|
|||||||
|
|
||||||
// Listen for broadcasted keydown events and fire the appropriate listeners
|
// Listen for broadcasted keydown events and fire the appropriate listeners
|
||||||
$scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) {
|
$scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) {
|
||||||
var preventDefault = $scope.keydown(keysym, keyboard);
|
if ($scope.clientProperties.keyboardEnabled) {
|
||||||
if(preventDefault) {
|
var preventDefault = $scope.keydown(keysym, keyboard);
|
||||||
event.preventDefault();
|
if (preventDefault) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Listen for broadcasted keyup events and fire the appropriate listeners
|
// Listen for broadcasted keyup events and fire the appropriate listeners
|
||||||
$scope.$on('guacKeyup', function keyupListener(event, keysym, keyboard) {
|
$scope.$on('guacKeyup', function keyupListener(event, keysym, keyboard) {
|
||||||
var preventDefault = $scope.keyup(keysym, keyboard);
|
if ($scope.clientProperties.keyboardEnabled) {
|
||||||
if(preventDefault) {
|
var preventDefault = $scope.keyup(keysym, keyboard);
|
||||||
event.preventDefault();
|
if(preventDefault) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -61,6 +61,13 @@ angular.module('client').factory('clientProperties', [function clientProperties(
|
|||||||
* @type Number
|
* @type Number
|
||||||
*/
|
*/
|
||||||
this.maxScale = 3;
|
this.maxScale = 3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether or not the client should listen to keyboard events.
|
||||||
|
*
|
||||||
|
* @type Boolean
|
||||||
|
*/
|
||||||
|
this.keyboardEnabled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
}]);
|
}]);
|
@@ -46,8 +46,8 @@
|
|||||||
|
|
||||||
<h3>{{'client.clipboard' | translate}}</h3>
|
<h3>{{'client.clipboard' | translate}}</h3>
|
||||||
<div class="content" id="clipboard-settings">
|
<div class="content" id="clipboard-settings">
|
||||||
<p class="description"></p>
|
<p class="description">{{'client.copiedText' | translate}}</p>
|
||||||
<textarea rows="10" cols="40" id="clipboard">{{'client.copiedText' | translate}}</textarea>
|
<textarea ng-model="clipboardData" rows="10" cols="40" id="clipboard"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3></h3>
|
<h3></h3>
|
||||||
|
Reference in New Issue
Block a user