From 1e39ff756963b8c717e04701081e01f98d235106 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 18 Dec 2014 05:01:51 -0800 Subject: [PATCH] GUAC-809: Show OSK if selected within menu. --- .../src/main/webapp/app/client/clientModule.js | 2 +- .../app/client/controllers/clientController.js | 13 ++++++++++++- .../src/main/webapp/app/client/styles/keyboard.css | 5 +++++ .../main/webapp/app/client/templates/client.html | 11 ++++++++--- guacamole/src/main/webapp/translations/en_US.json | 1 + 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/guacamole/src/main/webapp/app/client/clientModule.js b/guacamole/src/main/webapp/app/client/clientModule.js index c27957115..944189dd4 100644 --- a/guacamole/src/main/webapp/app/client/clientModule.js +++ b/guacamole/src/main/webapp/app/client/clientModule.js @@ -23,4 +23,4 @@ /** * The module for code used to connect to a connection or balancing group. */ -angular.module('client', ['auth', 'history', 'rest']); +angular.module('client', ['auth', 'history', 'osk', 'rest']); diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js index 5e134f64d..ec2690ee6 100644 --- a/guacamole/src/main/webapp/app/client/controllers/clientController.js +++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js @@ -145,7 +145,10 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams', // Hide menu by default $scope.menuShown = false; - + + // Use physical keyboard by default + $scope.inputMethod = 'none'; + // Convenience method for closing the menu $scope.closeMenu = function closeMenu() { $scope.menuShown = false; @@ -198,6 +201,14 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams', return true; } + // Show/hide UI elements depending on input method + $scope.$watch('inputMethod', function setInputMethod(inputMethod) { + + // Show on-screen keyboard only if selected + $scope.showOSK = (inputMethod === 'osk'); + + }); + $scope.$watch('menuShown', function setKeyboardEnabled(menuShown, menuShownPreviousState) { // Send clipboard data if menu is hidden diff --git a/guacamole/src/main/webapp/app/client/styles/keyboard.css b/guacamole/src/main/webapp/app/client/styles/keyboard.css index 49508d3c9..270153a4d 100644 --- a/guacamole/src/main/webapp/app/client/styles/keyboard.css +++ b/guacamole/src/main/webapp/app/client/styles/keyboard.css @@ -34,5 +34,10 @@ background: #222; opacity: 0.85; + visibility: hidden; z-index: 1; } + +.keyboard-container.shown { + visibility: visible; +} diff --git a/guacamole/src/main/webapp/app/client/templates/client.html b/guacamole/src/main/webapp/app/client/templates/client.html index 4402a0bbc..460e71641 100644 --- a/guacamole/src/main/webapp/app/client/templates/client.html +++ b/guacamole/src/main/webapp/app/client/templates/client.html @@ -48,20 +48,20 @@
- +

- +

- +

@@ -103,6 +103,11 @@ + +
+ +
+
diff --git a/guacamole/src/main/webapp/translations/en_US.json b/guacamole/src/main/webapp/translations/en_US.json index fd7f20e06..16d282093 100644 --- a/guacamole/src/main/webapp/translations/en_US.json +++ b/guacamole/src/main/webapp/translations/en_US.json @@ -206,6 +206,7 @@ } }, "client": { + "oskLayout" : "layouts/en-us-qwerty.xml", "ctrl" : "Ctrl", "alt" : "Alt", "esc" : "Esc",