GUACAMOLE-113: Fix style issues in code.

This commit is contained in:
Nick Couchman
2018-01-04 22:52:57 -05:00
parent 733a4d42fa
commit 5376794e05

View File

@@ -278,6 +278,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
* Map of all substituted key presses. If one key is pressed in place of another * Map of all substituted key presses. If one key is pressed in place of another
* the value of the substituted key is stored in an object with the keysym of * the value of the substituted key is stored in an object with the keysym of
* the original key. * the original key.
*
* @type Object.<Number, Number> * @type Object.<Number, Number>
*/ */
var substituteKeysPressed = {}; var substituteKeysPressed = {};
@@ -505,20 +506,17 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
}; };
/** // Track pressed keys, opening the Guacamole menu after Ctrl+Alt+Shift, or
* Track pressed keys, opening the Guacamole menu after Ctrl+Alt+Shift, or // send Ctrl-Alt-Delete when Ctrl-Alt-End is pressed.
* send Ctrl-Alt-Delete when Ctrl-Alt-End is pressed.
*/
$scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) { $scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) {
// Record key as pressed // Record key as pressed
keysCurrentlyPressed[keysym] = true; keysCurrentlyPressed[keysym] = true;
var currentKeysPressedKeys = Object.keys(keysCurrentlyPressed); var currentKeysPressedKeys = Object.keys(keysCurrentlyPressed);
/**
* If only menu keys are pressed, and we have one keysym from each group, // If only menu keys are pressed, and we have one keysym from each group,
* and one of the keys is being released, show the menu. // and one of the keys is being released, show the menu.
*/
if (checkMenuModeActive()) { if (checkMenuModeActive()) {
// Check that there is a key pressed for each of the required key classes // Check that there is a key pressed for each of the required key classes
@@ -541,10 +539,8 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
} }
} }
/** // If only Ctrl-Alt-End is pressed, and we have a one keysym from each
* If only Ctrl-Alt-End is pressed, and we have a one keysym from each // group, and one key is being released, send Ctrl-Alt-Delete.
* group, and one key is being released, send Ctrl-Alt-Delete.
*/
if (END_KEYS[keysym] && if (END_KEYS[keysym] &&
!_.isEmpty(_.pick(ALT_KEYS, currentKeysPressedKeys)) && !_.isEmpty(_.pick(ALT_KEYS, currentKeysPressedKeys)) &&
!_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys)) !_.isEmpty(_.pick(CTRL_KEYS, currentKeysPressedKeys))