You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by vn...@apache.org on 2018/01/16 18:41:47 UTC

[01/23] guacamole-client git commit: GUACAMOLE-352: Refocus InputSink through key events rather than clicks.

Repository: guacamole-client
Updated Branches:
  refs/heads/master bd73f9ca7 -> 073dbe724


GUACAMOLE-352: Refocus InputSink through key events rather than clicks.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/05822907
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/05822907
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/05822907

Branch: refs/heads/master
Commit: 05822907b46528ac91c8405c1da2f38602309572
Parents: f696860
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Dec 18 10:40:59 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 09:50:54 2018 -0800

----------------------------------------------------------------------
 guacamole-common-js/src/main/webapp/modules/Keyboard.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/05822907/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index ea7128b..3cc28f8 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1398,7 +1398,7 @@ Guacamole.Keyboard.InputSink = function InputSink() {
     };
 
     // Automatically refocus input sink if part of DOM
-    document.addEventListener("click", function refocusSink(e) {
+    document.addEventListener("keydown", function refocusSink(e) {
 
         // Do not refocus if focus is on an input field
         var focused = document.activeElement;
@@ -1407,7 +1407,6 @@ Guacamole.Keyboard.InputSink = function InputSink() {
 
         // Refocus input sink instead of handling click
         sink.focus();
-        e.preventDefault();
 
     }, true);
 


[17/23] guacamole-client git commit: GUACAMOLE-352: Remove margin and padding from input sink.

Posted by vn...@apache.org.
GUACAMOLE-352: Remove margin and padding from input sink.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/b61f12d6
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/b61f12d6
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/b61f12d6

Branch: refs/heads/master
Commit: b61f12d69d03f57dcdc6195f62b097c6a30dad3e
Parents: 4b93347
Author: Michael Jumper <mj...@apache.org>
Authored: Tue Dec 19 09:42:33 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 10:20:43 2018 -0800

----------------------------------------------------------------------
 guacamole-common-js/src/main/webapp/modules/Keyboard.js | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/b61f12d6/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index 5495867..6902610 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1443,6 +1443,8 @@ Guacamole.Keyboard.InputSink = function InputSink() {
     field.style.position   = 'fixed';
     field.style.outline    = 'none';
     field.style.border     = 'none';
+    field.style.margin     = '0';
+    field.style.padding    = '0';
     field.style.height     = '0';
     field.style.width      = '0';
     field.style.left       = '0';


[16/23] guacamole-client git commit: GUACAMOLE-352: Handle input/composition events while bubbling.

Posted by vn...@apache.org.
GUACAMOLE-352: Handle input/composition events while bubbling.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/802fec9b
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/802fec9b
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/802fec9b

Branch: refs/heads/master
Commit: 802fec9bfd12afc3a3ef2ecad2120303e858eed6
Parents: 9065b49
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Dec 18 16:02:19 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 10:20:43 2018 -0800

----------------------------------------------------------------------
 guacamole-common-js/src/main/webapp/modules/Keyboard.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/802fec9b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index b0930c2..61889c1 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1293,7 +1293,7 @@ Guacamole.Keyboard = function Keyboard(element) {
 
             // Type all content written
             if (e.data && !e.isComposing) {
-                element.removeEventListener("compositionend", handleComposition, true);
+                element.removeEventListener("compositionend", handleComposition, false);
                 guac_keyboard.type(e.data);
             }
 
@@ -1319,15 +1319,15 @@ Guacamole.Keyboard = function Keyboard(element) {
 
             // Type all content written
             if (e.data) {
-                element.removeEventListener("input", handleInput, true);
+                element.removeEventListener("input", handleInput, false);
                 guac_keyboard.type(e.data);
             }
 
         };
 
         // Automatically type text entered into the wrapped field
-        element.addEventListener("input", handleInput, true);
-        element.addEventListener("compositionend", handleComposition, true);
+        element.addEventListener("input", handleInput, false);
+        element.addEventListener("compositionend", handleComposition, false);
 
     };
 


[18/23] guacamole-client git commit: GUACAMOLE-352: Prevent "input" event from clipboard integration from triggering keystrokes.

Posted by vn...@apache.org.
GUACAMOLE-352: Prevent "input" event from clipboard integration from triggering keystrokes.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/d8de3a77
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/d8de3a77
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/d8de3a77

Branch: refs/heads/master
Commit: d8de3a77f250bdd94a5944c7b977aa2da0916233
Parents: 802fec9
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Dec 18 16:02:45 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 10:20:43 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/app/clipboard/services/clipboardService.js      | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/d8de3a77/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js b/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
index 06abb04..920006e 100644
--- a/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
+++ b/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
@@ -89,6 +89,7 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
     clipboardContent.addEventListener('cut',   stopEventPropagation);
     clipboardContent.addEventListener('copy',  stopEventPropagation);
     clipboardContent.addEventListener('paste', stopEventPropagation);
+    clipboardContent.addEventListener('input', stopEventPropagation);
 
     /**
      * A stack of past node selection ranges. A range convering the nodes


[06/23] guacamole-client git commit: GUACAMOLE-352: Handle "input" / "compositionend" events in a mutually-exclusive manner, as they may conflict.

Posted by vn...@apache.org.
GUACAMOLE-352: Handle "input" / "compositionend" events in a mutually-exclusive manner, as they may conflict.


Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/cdacd570
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/cdacd570
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/cdacd570

Branch: refs/heads/master
Commit: cdacd570992ed57bd8b01eea3438473e3ddf0e6a
Parents: 3ee73d8
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Dec 17 21:17:46 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 09:50:54 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/modules/Keyboard.js         | 41 ++++++++++++++++----
 1 file changed, 33 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/cdacd570/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index 42020c7..e16d48e 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1207,29 +1207,54 @@ Guacamole.Keyboard = function(element) {
 
     }, true);
 
-    // Automatically type text entered into the wrapped element
-    element.addEventListener("input", function(e) {
+    /**
+     * Handles the given "input" event, typing the data within the input text.
+     * If the event is complete (text is provided), handling of "compositionend"
+     * events is suspended, as such events may conflict with input events.
+     *
+     * @private
+     * @param {InputEvent} e
+     *     The "input" event to handle.
+     */
+    var handleInput = function handleInput(e) {
 
         // Only intercept if handler set
         if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
 
         // Type all content written
-        if (e.data)
+        if (e.data) {
+            element.removeEventListener("compositionend", handleComposition, false);
             guac_keyboard.type(e.data);
+        }
 
-    }, false);
+    };
 
-    // Automatically type the result of composed characters/text
-    element.addEventListener("compositionend", function(e) {
+    /**
+     * Handles the given "compositionend" event, typing the data within the
+     * composed text. If the event is complete (composed text is provided),
+     * handling of "input" events is suspended, as such events may conflict
+     * with composition events.
+     *
+     * @private
+     * @param {CompositionEvent} e
+     *     The "compositionend" event to handle.
+     */
+    var handleComposition = function handleComposition(e) {
 
         // Only intercept if handler set
         if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
 
         // Type all content written
-        if (e.data)
+        if (e.data) {
+            element.removeEventListener("input", handleInput, false);
             guac_keyboard.type(e.data);
+        }
 
-    }, false);
+    };
+
+    // Automatically type text entered into the wrapped element
+    element.addEventListener("input", handleInput, false);
+    element.addEventListener("compositionend", handleComposition, false);
 
 };
 


[22/23] guacamole-client git commit: GUACAMOLE-352: Monitor input and composition events to keep input sink contents clear.

Posted by vn...@apache.org.
GUACAMOLE-352: Monitor input and composition events to keep input sink contents clear.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/376c4380
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/376c4380
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/376c4380

Branch: refs/heads/master
Commit: 376c4380d5fc7bb61134b0a513d52b101b7bee4c
Parents: d8de3a7
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Dec 18 16:29:54 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 10:20:43 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/modules/Keyboard.js         | 26 +++++++++++---------
 1 file changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/376c4380/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index 61889c1..6874e0a 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1448,20 +1448,22 @@ Guacamole.Keyboard.InputSink = function InputSink() {
     field.style.left     = '-10px';
     field.style.top      = '-10px';
 
-    /**
-     * Clears the contents of the underlying field. The actual clearing of the
-     * field is deferred, occurring asynchronously after the call completes.
-     *
-     * @private
-     */
-    var clear = function clear() {
-        window.setTimeout(function deferClear() {
+    // Keep field clear when modified via normal keypresses
+    field.addEventListener("keypress", function clearKeypress(e) {
+        field.value = '';
+    }, false);
+
+    // Keep field clear when modofied via composition events
+    field.addEventListener("compositionend", function clearCompletedComposition(e) {
+        if (e.data)
             field.value = '';
-        }, 0);
-    };
+    }, false);
 
-    // Keep internal field contents clear
-    field.addEventListener("change", clear, false);
+    // Keep field clear when modofied via input events
+    field.addEventListener("input", function clearCompletedInput(e) {
+        if (e.data && !e.isComposing)
+            field.value = '';
+    }, false);
 
     // Whenever focus is gained, automatically click to ensure cursor is
     // actually placed within the field (the field may simply be highlighted or


[08/23] guacamole-client git commit: GUACAMOLE-352: Rely on isComposing property of InputEvent to determine whether the event should be ignored.

Posted by vn...@apache.org.
GUACAMOLE-352: Rely on isComposing property of InputEvent to determine whether the event should be ignored.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/3d6a3aaa
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/3d6a3aaa
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/3d6a3aaa

Branch: refs/heads/master
Commit: 3d6a3aaa2a8bafa40b545c2dd9a5047f401601e2
Parents: 646f973
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Dec 17 21:56:28 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 09:50:54 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/modules/Keyboard.js         | 50 +-------------------
 1 file changed, 2 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/3d6a3aaa/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index 1df14e2..a11050f 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1208,39 +1208,6 @@ Guacamole.Keyboard = function(element) {
     }, true);
 
     /**
-     * Returns whether the given string is fully composed. A string is fully
-     * composed if it does not end with combining characters.
-     *
-     * @private
-     * @param {String} str
-     *     The string to test.
-     *
-     * @returns {Boolean}
-     *     true of the string is fully composed, false otherwise.
-     */
-    var isComposed = function isComposed(str) {
-
-        // The empty string is fully composed
-        if (!str)
-            return true;
-
-        // Test whether the last character is within the "Combining
-        // Diacritical Marks" Unicode block (U+0300 through U+036F)
-        var lastCodepoint = str.charCodeAt(str.length - 1);
-        return !(lastCodepoint >= 0x0300 && lastCodepoint <= 0x036F);
-
-    };
-
-    /**
-     * The in-progress composition, if any, such as the intermediate result of
-     * pressing a series of dead keys.
-     *
-     * @private
-     * @type {String}
-     */
-    var inProgressComposition = '';
-
-    /**
      * Handles the given "input" event, typing the data within the input text.
      * If the event is complete (text is provided), handling of "compositionend"
      * events is suspended, as such events may conflict with input events.
@@ -1254,13 +1221,8 @@ Guacamole.Keyboard = function(element) {
         // Only intercept if handler set
         if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
 
-        // Ignore input events which represent the in-progress composition,
-        // as reported by composition events
-        if (e.data === inProgressComposition)
-            return;
-
         // Type all content written
-        if (e.data && isComposed(e.data)) {
+        if (e.data && !e.isComposing) {
             element.removeEventListener("compositionend", handleComposition, false);
             guac_keyboard.type(e.data);
         }
@@ -1283,7 +1245,7 @@ Guacamole.Keyboard = function(element) {
         if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
 
         // Type all content written
-        if (e.data && isComposed(e.data)) {
+        if (e.data) {
             element.removeEventListener("input", handleInput, false);
             guac_keyboard.type(e.data);
         }
@@ -1294,14 +1256,6 @@ Guacamole.Keyboard = function(element) {
     element.addEventListener("input", handleInput, false);
     element.addEventListener("compositionend", handleComposition, false);
 
-    element.addEventListener("compositionstart", function resetComposition() {
-        inProgressComposition = '';
-    }, false);
-
-    element.addEventListener("compositionupdate", function updateComposition(e) {
-        inProgressComposition = e.data;
-    }, false);
-
 };
 
 /**


[03/23] guacamole-client git commit: GUACAMOLE-352: Only attempt to type fully-composed strings.

Posted by vn...@apache.org.
GUACAMOLE-352: Only attempt to type fully-composed strings.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/fd47d1d7
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/fd47d1d7
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/fd47d1d7

Branch: refs/heads/master
Commit: fd47d1d7efe966813be75dab4bbb7af0ee912d8f
Parents: cdacd57
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Dec 17 21:28:12 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 09:50:54 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/modules/Keyboard.js         | 28 ++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/fd47d1d7/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index e16d48e..4c4b1ba 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1208,6 +1208,30 @@ Guacamole.Keyboard = function(element) {
     }, true);
 
     /**
+     * Returns whether the given string is fully composed. A string is fully
+     * composed if it does not end with combining characters.
+     *
+     * @private
+     * @param {String} str
+     *     The string to test.
+     *
+     * @returns {Boolean}
+     *     true of the string is fully composed, false otherwise.
+     */
+    var isComposed = function isComposed(str) {
+
+        // The empty string is fully composed
+        if (!str)
+            return true;
+
+        // Test whether the last character is within the "Combining
+        // Diacritical Marks" Unicode block (U+0300 through U+036F)
+        var lastCodepoint = str.charCodeAt(str.length - 1);
+        return !(lastCodepoint >= 0x0300 && lastCodepoint <= 0x036F);
+
+    };
+
+    /**
      * Handles the given "input" event, typing the data within the input text.
      * If the event is complete (text is provided), handling of "compositionend"
      * events is suspended, as such events may conflict with input events.
@@ -1222,7 +1246,7 @@ Guacamole.Keyboard = function(element) {
         if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
 
         // Type all content written
-        if (e.data) {
+        if (e.data && isComposed(e.data)) {
             element.removeEventListener("compositionend", handleComposition, false);
             guac_keyboard.type(e.data);
         }
@@ -1245,7 +1269,7 @@ Guacamole.Keyboard = function(element) {
         if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
 
         // Type all content written
-        if (e.data) {
+        if (e.data && isComposed(e.data)) {
             element.removeEventListener("input", handleInput, false);
             guac_keyboard.type(e.data);
         }


[20/23] guacamole-client git commit: GUACAMOLE-352: Refactor Guacamole.Keyboard.InputSink to Guacamole.InputSink.

Posted by vn...@apache.org.
GUACAMOLE-352: Refactor Guacamole.Keyboard.InputSink to Guacamole.InputSink.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/a49bfade
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/a49bfade
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/a49bfade

Branch: refs/heads/master
Commit: a49bfadebf94a16d772eb4988aa715dc9f438704
Parents: b61f12d
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Jan 14 16:29:06 2018 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 10:20:43 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/modules/InputSink.js        | 128 +++++++++++++++++++
 .../src/main/webapp/modules/Keyboard.js         | 109 ----------------
 .../app/index/controllers/indexController.js    |   2 +-
 3 files changed, 129 insertions(+), 110 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/a49bfade/guacamole-common-js/src/main/webapp/modules/InputSink.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/InputSink.js b/guacamole-common-js/src/main/webapp/modules/InputSink.js
new file mode 100644
index 0000000..5b1bfdf
--- /dev/null
+++ b/guacamole-common-js/src/main/webapp/modules/InputSink.js
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+var Guacamole = Guacamole || {};
+
+/**
+ * A hidden input field which attempts to keep itself focused at all times,
+ * except when another input field has been intentionally focused, whether
+ * programatically or by the user. The actual underlying input field, returned
+ * by getElement(), may be used as a reliable source of keyboard-related events,
+ * particularly composition and input events which may require a focused input
+ * field to be dispatched at all.
+ *
+ * @constructor
+ */
+Guacamole.InputSink = function InputSink() {
+
+    /**
+     * Reference to this instance of Guacamole.InputSink.
+     *
+     * @private
+     * @type {Guacamole.InputSink}
+     */
+    var sink = this;
+
+    /**
+     * The underlying input field, styled to be invisible.
+     *
+     * @private
+     * @type {Element}
+     */
+    var field = document.createElement('textarea');
+    field.style.position   = 'fixed';
+    field.style.outline    = 'none';
+    field.style.border     = 'none';
+    field.style.margin     = '0';
+    field.style.padding    = '0';
+    field.style.height     = '0';
+    field.style.width      = '0';
+    field.style.left       = '0';
+    field.style.bottom     = '0';
+    field.style.resize     = 'none';
+    field.style.background = 'transparent';
+    field.style.color      = 'transparent';
+
+    // Keep field clear when modified via normal keypresses
+    field.addEventListener("keypress", function clearKeypress(e) {
+        field.value = '';
+    }, false);
+
+    // Keep field clear when modofied via composition events
+    field.addEventListener("compositionend", function clearCompletedComposition(e) {
+        if (e.data)
+            field.value = '';
+    }, false);
+
+    // Keep field clear when modofied via input events
+    field.addEventListener("input", function clearCompletedInput(e) {
+        if (e.data && !e.isComposing)
+            field.value = '';
+    }, false);
+
+    // Whenever focus is gained, automatically click to ensure cursor is
+    // actually placed within the field (the field may simply be highlighted or
+    // outlined otherwise)
+    field.addEventListener("focus", function focusReceived() {
+        window.setTimeout(function deferRefocus() {
+            field.click();
+            field.select();
+        }, 0);
+    }, true);
+
+    /**
+     * Attempts to focus the underlying input field. The focus attempt occurs
+     * asynchronously, and may silently fail depending on browser restrictions.
+     */
+    this.focus = function focus() {
+        window.setTimeout(function deferRefocus() {
+            field.focus(); // Focus must be deferred to work reliably across browsers
+        }, 0);
+    };
+
+    /**
+     * Returns the underlying input field. This input field MUST be manually
+     * added to the DOM for the Guacamole.InputSink to have any effect.
+     *
+     * @returns {Element}
+     */
+    this.getElement = function getElement() {
+        return field;
+    };
+
+    // Automatically refocus input sink if part of DOM
+    document.addEventListener("keydown", function refocusSink(e) {
+
+        // Do not refocus if focus is on an input field
+        var focused = document.activeElement;
+        if (focused && focused !== document.body) {
+
+            // Only consider focused input fields which are actually visible
+            var rect = focused.getBoundingClientRect();
+            if (rect.left + rect.width > 0 && rect.top + rect.height > 0)
+                return;
+
+        }
+
+        // Refocus input sink instead of handling click
+        sink.focus();
+
+    }, true);
+
+};

http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/a49bfade/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index 6902610..7902e6a 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1412,112 +1412,3 @@ Guacamole.Keyboard.ModifierState.fromKeyboardEvent = function(e) {
     return state;
     
 };
-
-/**
- * A hidden input field which attempts to keep itself focused at all times,
- * except when another input field has been intentionally focused, whether
- * programatically or by the user. The actual underlying input field, returned
- * by getElement(), may be used as a reliable source of keyboard-related events,
- * particularly composition and input events which may require a focused input
- * field to be dispatched at all.
- *
- * @constructor
- */
-Guacamole.Keyboard.InputSink = function InputSink() {
-
-    /**
-     * Reference to this instance of Guacamole.Keyboard.InputSink.
-     *
-     * @private
-     * @type {Guacamole.Keyboard.InputSink}
-     */
-    var sink = this;
-
-    /**
-     * The underlying input field, styled to be invisible.
-     *
-     * @private
-     * @type {Element}
-     */
-    var field = document.createElement('textarea');
-    field.style.position   = 'fixed';
-    field.style.outline    = 'none';
-    field.style.border     = 'none';
-    field.style.margin     = '0';
-    field.style.padding    = '0';
-    field.style.height     = '0';
-    field.style.width      = '0';
-    field.style.left       = '0';
-    field.style.bottom     = '0';
-    field.style.resize     = 'none';
-    field.style.background = 'transparent';
-    field.style.color      = 'transparent';
-
-    // Keep field clear when modified via normal keypresses
-    field.addEventListener("keypress", function clearKeypress(e) {
-        field.value = '';
-    }, false);
-
-    // Keep field clear when modofied via composition events
-    field.addEventListener("compositionend", function clearCompletedComposition(e) {
-        if (e.data)
-            field.value = '';
-    }, false);
-
-    // Keep field clear when modofied via input events
-    field.addEventListener("input", function clearCompletedInput(e) {
-        if (e.data && !e.isComposing)
-            field.value = '';
-    }, false);
-
-    // Whenever focus is gained, automatically click to ensure cursor is
-    // actually placed within the field (the field may simply be highlighted or
-    // outlined otherwise)
-    field.addEventListener("focus", function focusReceived() {
-        window.setTimeout(function deferRefocus() {
-            field.click();
-            field.select();
-        }, 0);
-    }, true);
-
-    /**
-     * Attempts to focus the underlying input field. The focus attempt occurs
-     * asynchronously, and may silently fail depending on browser restrictions.
-     */
-    this.focus = function focus() {
-        window.setTimeout(function deferRefocus() {
-            field.focus(); // Focus must be deferred to work reliably across browsers
-        }, 0);
-    };
-
-    /**
-     * Returns the underlying input field. This input field MUST be manually
-     * added to the DOM for the Guacamole.Keyboard.InputSink to have any
-     * effect.
-     *
-     * @returns {Element}
-     */
-    this.getElement = function getElement() {
-        return field;
-    };
-
-    // Automatically refocus input sink if part of DOM
-    document.addEventListener("keydown", function refocusSink(e) {
-
-        // Do not refocus if focus is on an input field
-        var focused = document.activeElement;
-        if (focused && focused !== document.body) {
-
-            // Only consider focused input fields which are actually visible
-            var rect = focused.getBoundingClientRect();
-            if (rect.left + rect.width > 0 && rect.top + rect.height > 0)
-                return;
-
-        }
-
-        // Refocus input sink instead of handling click
-        sink.focus();
-
-    }, true);
-
-};

http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/a49bfade/guacamole/src/main/webapp/app/index/controllers/indexController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/index/controllers/indexController.js b/guacamole/src/main/webapp/app/index/controllers/indexController.js
index 5237db6..ed14233 100644
--- a/guacamole/src/main/webapp/app/index/controllers/indexController.js
+++ b/guacamole/src/main/webapp/app/index/controllers/indexController.js
@@ -83,7 +83,7 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
     };
 
     // Add default destination for input events
-    var sink = new Guacamole.Keyboard.InputSink();
+    var sink = new Guacamole.InputSink();
     $document[0].body.appendChild(sink.getElement());
 
     // Create event listeners at the global level


[04/23] guacamole-client git commit: GUACAMOLE-352: Handle both "input" and "compositionend" events as sources of keys.

Posted by vn...@apache.org.
GUACAMOLE-352: Handle both "input" and "compositionend" events as sources of keys.


Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/3ee73d83
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/3ee73d83
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/3ee73d83

Branch: refs/heads/master
Commit: 3ee73d835c3a3ac8b275fea7220aa7ee1fa6ab6a
Parents: 9dc8611
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Dec 17 21:09:15 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 09:50:54 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/modules/Keyboard.js         | 48 ++++++++++++++++++++
 1 file changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/3ee73d83/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index 0480d4d..42020c7 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -827,6 +827,30 @@ Guacamole.Keyboard = function(element) {
     };
 
     /**
+     * Presses and releases the keys necessary to type the given string of
+     * text.
+     *
+     * @param {String} str
+     *     The string to type.
+     */
+    this.type = function type(str) {
+
+        // Press/release the key corresponding to each character in the string
+        for (var i = 0; i < str.length; i++) {
+
+            // Determine keysym of current character
+            var codepoint = str.codePointAt ? str.codePointAt(i) : str.charCodeAt(i);
+            var keysym = keysym_from_charcode(codepoint);
+
+            // Press and release key for current character
+            guac_keyboard.press(keysym);
+            guac_keyboard.release(keysym);
+
+        }
+
+    };
+
+    /**
      * Resets the state of this keyboard, releasing all keys, and firing keyup
      * events for each released key.
      */
@@ -1183,6 +1207,30 @@ Guacamole.Keyboard = function(element) {
 
     }, true);
 
+    // Automatically type text entered into the wrapped element
+    element.addEventListener("input", function(e) {
+
+        // Only intercept if handler set
+        if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
+
+        // Type all content written
+        if (e.data)
+            guac_keyboard.type(e.data);
+
+    }, false);
+
+    // Automatically type the result of composed characters/text
+    element.addEventListener("compositionend", function(e) {
+
+        // Only intercept if handler set
+        if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
+
+        // Type all content written
+        if (e.data)
+            guac_keyboard.type(e.data);
+
+    }, false);
+
 };
 
 /**


[13/23] guacamole-client git commit: GUACAMOLE-352: Explicitly listen to the input sink.

Posted by vn...@apache.org.
GUACAMOLE-352: Explicitly listen to the input sink.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/86d9cc12
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/86d9cc12
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/86d9cc12

Branch: refs/heads/master
Commit: 86d9cc12489af91d4926d57a45e9d6c4480f178a
Parents: 2d26d24
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Dec 18 10:59:15 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 10:20:42 2018 -0800

----------------------------------------------------------------------
 guacamole/src/main/webapp/app/index/controllers/indexController.js | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/86d9cc12/guacamole/src/main/webapp/app/index/controllers/indexController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/index/controllers/indexController.js b/guacamole/src/main/webapp/app/index/controllers/indexController.js
index c4cad66..5237db6 100644
--- a/guacamole/src/main/webapp/app/index/controllers/indexController.js
+++ b/guacamole/src/main/webapp/app/index/controllers/indexController.js
@@ -88,6 +88,7 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
 
     // Create event listeners at the global level
     var keyboard = new Guacamole.Keyboard($document[0]);
+    keyboard.listenTo(sink.getElement());
 
     // Broadcast keydown events
     keyboard.onkeydown = function onkeydown(keysym) {


[02/23] guacamole-client git commit: GUACAMOLE-352: Leverage Guacamole.Keyboard.InputSink within webapp as a default destination for input events.

Posted by vn...@apache.org.
GUACAMOLE-352: Leverage Guacamole.Keyboard.InputSink within webapp as a default destination for input events.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/f6968600
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/f6968600
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/f6968600

Branch: refs/heads/master
Commit: f6968600674f1a2051a97267b826bbe2f6a535f3
Parents: f9a639d
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Dec 17 22:51:34 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 09:50:54 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/app/index/controllers/indexController.js     | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/f6968600/guacamole/src/main/webapp/app/index/controllers/indexController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/index/controllers/indexController.js b/guacamole/src/main/webapp/app/index/controllers/indexController.js
index 3a9230b..c4cad66 100644
--- a/guacamole/src/main/webapp/app/index/controllers/indexController.js
+++ b/guacamole/src/main/webapp/app/index/controllers/indexController.js
@@ -82,6 +82,10 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
 
     };
 
+    // Add default destination for input events
+    var sink = new Guacamole.Keyboard.InputSink();
+    $document[0].body.appendChild(sink.getElement());
+
     // Create event listeners at the global level
     var keyboard = new Guacamole.Keyboard($document[0]);
 


[19/23] guacamole-client git commit: GUACAMOLE-352: Hide input sink field in bottom-left corner for sake of input method dialogs.

Posted by vn...@apache.org.
GUACAMOLE-352: Hide input sink field in bottom-left corner for sake of input method dialogs.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/4b933476
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/4b933476
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/4b933476

Branch: refs/heads/master
Commit: 4b933476178992bd2feba85e8bcea328bb36f5cc
Parents: 376c438
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Dec 18 21:47:11 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 10:20:43 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/modules/Keyboard.js            | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/4b933476/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index 6874e0a..5495867 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1440,13 +1440,16 @@ Guacamole.Keyboard.InputSink = function InputSink() {
      * @type {Element}
      */
     var field = document.createElement('textarea');
-    field.style.position = 'fixed';
-    field.style.outline  = 'none';
-    field.style.border   = 'none';
-    field.style.width    = '10px';
-    field.style.height   = '10px';
-    field.style.left     = '-10px';
-    field.style.top      = '-10px';
+    field.style.position   = 'fixed';
+    field.style.outline    = 'none';
+    field.style.border     = 'none';
+    field.style.height     = '0';
+    field.style.width      = '0';
+    field.style.left       = '0';
+    field.style.bottom     = '0';
+    field.style.resize     = 'none';
+    field.style.background = 'transparent';
+    field.style.color      = 'transparent';
 
     // Keep field clear when modified via normal keypresses
     field.addEventListener("keypress", function clearKeypress(e) {


[10/23] guacamole-client git commit: GUACAMOLE-352: Allow additional elements to be added to a single Guacamole.Keyboard.

Posted by vn...@apache.org.
GUACAMOLE-352: Allow additional elements to be added to a single Guacamole.Keyboard.


Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/2d26d24d
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/2d26d24d
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/2d26d24d

Branch: refs/heads/master
Commit: 2d26d24dda30ba3679c3259e920487fdf28865bf
Parents: 0582290
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Dec 18 10:58:50 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 10:20:41 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/modules/Keyboard.js         | 272 ++++++++++++-------
 1 file changed, 180 insertions(+), 92 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/2d26d24d/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index 3cc28f8..c25a1fd 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -25,9 +25,12 @@ var Guacamole = Guacamole || {};
  * which represent keys as their corresponding X11 keysym.
  * 
  * @constructor
- * @param {Element} element The Element to use to provide keyboard events.
+ * @param {Element} [element]
+ *    The Element to use to provide keyboard events. If omitted, at least one
+ *    Element must be manually provided through the listenTo() function for
+ *    the Guacamole.Keyboard instance to have any effect.
  */
-Guacamole.Keyboard = function(element) {
+Guacamole.Keyboard = function Keyboard(element) {
 
     /**
      * Reference to this Guacamole.Keyboard.
@@ -36,6 +39,25 @@ Guacamole.Keyboard = function(element) {
     var guac_keyboard = this;
 
     /**
+     * An integer value which uniquely identifies this Guacamole.Keyboard
+     * instance with respect to other Guacamole.Keyboard instances.
+     *
+     * @private
+     * @type {Number}
+     */
+    var guacKeyboardID = Guacamole.Keyboard._nextID++;
+
+    /**
+     * The name of the property which is added to event objects via markEvent()
+     * to note that they have already been handled by this Guacamole.Keyboard.
+     *
+     * @private
+     * @constant
+     * @type {String}
+     */
+    var EVENT_MARKER = '_GUAC_KEYBOARD_HANDLED_BY_' + guacKeyboardID;
+
+    /**
      * Fired whenever the user presses a key with the element associated
      * with this Guacamole.Keyboard in focus.
      * 
@@ -1134,131 +1156,197 @@ Guacamole.Keyboard = function(element) {
 
     };
 
-    // When key pressed
-    element.addEventListener("keydown", function(e) {
+    /**
+     * Attempts to mark the given Event as having been handled by this
+     * Guacamole.Keyboard. If the Event has already been marked as handled,
+     * false is returned.
+     *
+     * @param {Event} e
+     *     The Event to mark.
+     *
+     * @returns {Boolean}
+     *     true if the given Event was successfully marked, false if the given
+     *     Event was already marked.
+     */
+    var markEvent = function markEvent(e) {
+
+        // Fail if event is already marked
+        if (e[EVENT_MARKER])
+            return false;
+
+        // Mark event otherwise
+        e[EVENT_MARKER] = true;
+        return true;
+
+    };
+
+    /**
+     * Attaches event listeners to the given Element, automatically translating
+     * received key, input, and composition events into simple keydown/keyup
+     * events signalled through this Guacamole.Keyboard's onkeydown and
+     * onkeyup handlers.
+     *
+     * @param {Element} element
+     *     The Element to attach event listeners to for the sake of handling
+     *     key or input events.
+     */
+    this.listenTo = function listenTo(element) {
+
+        // When key pressed
+        element.addEventListener("keydown", function(e) {
 
-        // Only intercept if handler set
-        if (!guac_keyboard.onkeydown) return;
+            // Only intercept if handler set
+            if (!guac_keyboard.onkeydown) return;
 
-        var keyCode;
-        if (window.event) keyCode = window.event.keyCode;
-        else if (e.which) keyCode = e.which;
+            // Ignore events which have already been handled
+            if (!markEvent(e)) return;
 
-        // Fix modifier states
-        syncModifierStates(e);
+            var keyCode;
+            if (window.event) keyCode = window.event.keyCode;
+            else if (e.which) keyCode = e.which;
 
-        // Ignore (but do not prevent) the "composition" keycode sent by some
-        // browsers when an IME is in use (see: http://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html)
-        if (keyCode === 229)
-            return;
+            // Fix modifier states
+            syncModifierStates(e);
 
-        // Log event
-        var keydownEvent = new KeydownEvent(keyCode, e.keyIdentifier, e.key, getEventLocation(e));
-        eventLog.push(keydownEvent);
+            // Ignore (but do not prevent) the "composition" keycode sent by some
+            // browsers when an IME is in use (see: http://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html)
+            if (keyCode === 229)
+                return;
 
-        // Interpret as many events as possible, prevent default if indicated
-        if (interpret_events())
-            e.preventDefault();
+            // Log event
+            var keydownEvent = new KeydownEvent(keyCode, e.keyIdentifier, e.key, getEventLocation(e));
+            eventLog.push(keydownEvent);
 
-    }, true);
+            // Interpret as many events as possible, prevent default if indicated
+            if (interpret_events())
+                e.preventDefault();
+
+        }, true);
+
+        // When key pressed
+        element.addEventListener("keypress", function(e) {
+
+            // Only intercept if handler set
+            if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
+
+            // Ignore events which have already been handled
+            if (!markEvent(e)) return;
 
-    // When key pressed
-    element.addEventListener("keypress", function(e) {
+            var charCode;
+            if (window.event) charCode = window.event.keyCode;
+            else if (e.which) charCode = e.which;
 
-        // Only intercept if handler set
-        if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
+            // Fix modifier states
+            syncModifierStates(e);
 
-        var charCode;
-        if (window.event) charCode = window.event.keyCode;
-        else if (e.which) charCode = e.which;
+            // Log event
+            var keypressEvent = new KeypressEvent(charCode);
+            eventLog.push(keypressEvent);
 
-        // Fix modifier states
-        syncModifierStates(e);
+            // Interpret as many events as possible, prevent default if indicated
+            if (interpret_events())
+                e.preventDefault();
 
-        // Log event
-        var keypressEvent = new KeypressEvent(charCode);
-        eventLog.push(keypressEvent);
+        }, true);
+
+        // When key released
+        element.addEventListener("keyup", function(e) {
+
+            // Only intercept if handler set
+            if (!guac_keyboard.onkeyup) return;
+
+            // Ignore events which have already been handled
+            if (!markEvent(e)) return;
 
-        // Interpret as many events as possible, prevent default if indicated
-        if (interpret_events())
             e.preventDefault();
 
-    }, true);
+            var keyCode;
+            if (window.event) keyCode = window.event.keyCode;
+            else if (e.which) keyCode = e.which;
 
-    // When key released
-    element.addEventListener("keyup", function(e) {
+            // Fix modifier states
+            syncModifierStates(e);
 
-        // Only intercept if handler set
-        if (!guac_keyboard.onkeyup) return;
+            // Log event, call for interpretation
+            var keyupEvent = new KeyupEvent(keyCode, e.keyIdentifier, e.key, getEventLocation(e));
+            eventLog.push(keyupEvent);
+            interpret_events();
 
-        e.preventDefault();
+        }, true);
 
-        var keyCode;
-        if (window.event) keyCode = window.event.keyCode;
-        else if (e.which) keyCode = e.which;
-        
-        // Fix modifier states
-        syncModifierStates(e);
+        /**
+         * Handles the given "input" event, typing the data within the input text.
+         * If the event is complete (text is provided), handling of "compositionend"
+         * events is suspended, as such events may conflict with input events.
+         *
+         * @private
+         * @param {InputEvent} e
+         *     The "input" event to handle.
+         */
+        var handleInput = function handleInput(e) {
 
-        // Log event, call for interpretation
-        var keyupEvent = new KeyupEvent(keyCode, e.keyIdentifier, e.key, getEventLocation(e));
-        eventLog.push(keyupEvent);
-        interpret_events();
+            // Only intercept if handler set
+            if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
 
-    }, true);
+            // Ignore events which have already been handled
+            if (!markEvent(e)) return;
 
-    /**
-     * Handles the given "input" event, typing the data within the input text.
-     * If the event is complete (text is provided), handling of "compositionend"
-     * events is suspended, as such events may conflict with input events.
-     *
-     * @private
-     * @param {InputEvent} e
-     *     The "input" event to handle.
-     */
-    var handleInput = function handleInput(e) {
+            // Type all content written
+            if (e.data && !e.isComposing) {
+                element.removeEventListener("compositionend", handleComposition, true);
+                guac_keyboard.type(e.data);
+            }
 
-        // Only intercept if handler set
-        if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
+        };
 
-        // Type all content written
-        if (e.data && !e.isComposing) {
-            element.removeEventListener("compositionend", handleComposition, false);
-            guac_keyboard.type(e.data);
-        }
+        /**
+         * Handles the given "compositionend" event, typing the data within the
+         * composed text. If the event is complete (composed text is provided),
+         * handling of "input" events is suspended, as such events may conflict
+         * with composition events.
+         *
+         * @private
+         * @param {CompositionEvent} e
+         *     The "compositionend" event to handle.
+         */
+        var handleComposition = function handleComposition(e) {
 
-    };
+            // Only intercept if handler set
+            if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
 
-    /**
-     * Handles the given "compositionend" event, typing the data within the
-     * composed text. If the event is complete (composed text is provided),
-     * handling of "input" events is suspended, as such events may conflict
-     * with composition events.
-     *
-     * @private
-     * @param {CompositionEvent} e
-     *     The "compositionend" event to handle.
-     */
-    var handleComposition = function handleComposition(e) {
+            // Ignore events which have already been handled
+            if (!markEvent(e)) return;
 
-        // Only intercept if handler set
-        if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
+            // Type all content written
+            if (e.data) {
+                element.removeEventListener("input", handleInput, true);
+                guac_keyboard.type(e.data);
+            }
 
-        // Type all content written
-        if (e.data) {
-            element.removeEventListener("input", handleInput, false);
-            guac_keyboard.type(e.data);
-        }
+        };
+
+        // Automatically type text entered into the wrapped field
+        element.addEventListener("input", handleInput, true);
+        element.addEventListener("compositionend", handleComposition, true);
 
     };
 
-    // Automatically type text entered into the wrapped element
-    element.addEventListener("input", handleInput, false);
-    element.addEventListener("compositionend", handleComposition, false);
+    // Listen to given element, if any
+    if (element)
+        guac_keyboard.listenTo(element);
 
 };
 
 /**
+ * The unique numerical identifier to assign to the next Guacamole.Keyboard
+ * instance.
+ *
+ * @private
+ * @type {Number}
+ */
+Guacamole.Keyboard._nextID = 0;
+
+/**
  * The state of all supported keyboard modifiers.
  * @constructor
  */


[09/23] guacamole-client git commit: GUACAMOLE-352: Track in-progress composition, ignoring "input" events for a composition which is known to be incomplete.

Posted by vn...@apache.org.
GUACAMOLE-352: Track in-progress composition, ignoring "input" events for a composition which is known to be incomplete.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/646f9732
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/646f9732
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/646f9732

Branch: refs/heads/master
Commit: 646f9732f38c80cb631af4b421bca7ef4051960f
Parents: fd47d1d
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Dec 17 21:51:19 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 09:50:54 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/modules/Keyboard.js         | 22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/646f9732/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index 4c4b1ba..1df14e2 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1232,6 +1232,15 @@ Guacamole.Keyboard = function(element) {
     };
 
     /**
+     * The in-progress composition, if any, such as the intermediate result of
+     * pressing a series of dead keys.
+     *
+     * @private
+     * @type {String}
+     */
+    var inProgressComposition = '';
+
+    /**
      * Handles the given "input" event, typing the data within the input text.
      * If the event is complete (text is provided), handling of "compositionend"
      * events is suspended, as such events may conflict with input events.
@@ -1245,6 +1254,11 @@ Guacamole.Keyboard = function(element) {
         // Only intercept if handler set
         if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
 
+        // Ignore input events which represent the in-progress composition,
+        // as reported by composition events
+        if (e.data === inProgressComposition)
+            return;
+
         // Type all content written
         if (e.data && isComposed(e.data)) {
             element.removeEventListener("compositionend", handleComposition, false);
@@ -1280,6 +1294,14 @@ Guacamole.Keyboard = function(element) {
     element.addEventListener("input", handleInput, false);
     element.addEventListener("compositionend", handleComposition, false);
 
+    element.addEventListener("compositionstart", function resetComposition() {
+        inProgressComposition = '';
+    }, false);
+
+    element.addEventListener("compositionupdate", function updateComposition(e) {
+        inProgressComposition = e.data;
+    }, false);
+
 };
 
 /**


[15/23] guacamole-client git commit: GUACAMOLE-352: Ignore other input fields if they are invisible.

Posted by vn...@apache.org.
GUACAMOLE-352: Ignore other input fields if they are invisible.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/e5e01beb
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/e5e01beb
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/e5e01beb

Branch: refs/heads/master
Commit: e5e01beb60a780a54da2c7763d7f70a32adba913
Parents: 7b29f7b
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Dec 18 14:07:24 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 10:20:42 2018 -0800

----------------------------------------------------------------------
 guacamole-common-js/src/main/webapp/modules/Keyboard.js | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/e5e01beb/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index 0563f72..3a114db 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1470,6 +1470,7 @@ Guacamole.Keyboard.InputSink = function InputSink() {
     this.focus = function focus() {
         window.setTimeout(function deferRefocus() {
             field.focus(); // Focus must be deferred to work reliably across browsers
+            field.select();
         }, 0);
     };
 
@@ -1489,8 +1490,14 @@ Guacamole.Keyboard.InputSink = function InputSink() {
 
         // Do not refocus if focus is on an input field
         var focused = document.activeElement;
-        if (focused && focused !== document.body)
-            return;
+        if (focused && focused !== document.body) {
+
+            // Only consider focused input fields which are actually visible
+            var rect = focused.getBoundingClientRect();
+            if (rect.left + rect.width > 0 && rect.top + rect.height > 0)
+                return;
+
+        }
 
         // Refocus input sink instead of handling click
         sink.focus();


[07/23] guacamole-client git commit: GUACAMOLE-352: Add Guacamole.Keyboard.InputSink object to serve as a reliable default destination for input events.

Posted by vn...@apache.org.
GUACAMOLE-352: Add Guacamole.Keyboard.InputSink object to serve as a reliable default destination for input events.


Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/f9a639d2
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/f9a639d2
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/f9a639d2

Branch: refs/heads/master
Commit: f9a639d2014815c8e68bdebb17dd78283d31ee68
Parents: 3d6a3aa
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Dec 17 22:38:10 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 09:50:54 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/modules/Keyboard.js         | 88 ++++++++++++++++++++
 1 file changed, 88 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/f9a639d2/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index a11050f..ea7128b 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1324,3 +1324,91 @@ Guacamole.Keyboard.ModifierState.fromKeyboardEvent = function(e) {
     return state;
     
 };
+
+/**
+ * A hidden input field which attempts to keep itself focused at all times,
+ * except when another input field has been intentionally focused, whether
+ * programatically or by the user. The actual underlying input field, returned
+ * by getElement(), may be used as a reliable source of keyboard-related events,
+ * particularly composition and input events which may require a focused input
+ * field to be dispatched at all.
+ *
+ * @constructor
+ */
+Guacamole.Keyboard.InputSink = function InputSink() {
+
+    /**
+     * Reference to this instance of Guacamole.Keyboard.InputSink.
+     *
+     * @private
+     * @type {Guacamole.Keyboard.InputSink}
+     */
+    var sink = this;
+
+    /**
+     * The underlying input field, styled to be invisible.
+     *
+     * @private
+     * @type {Element}
+     */
+    var field = document.createElement('textarea');
+    field.setAttribute('autofocus', 'autofocus');
+    field.style.position = 'fixed';
+    field.style.border   = 'none';
+    field.style.width    = '10px';
+    field.style.height   = '10px';
+    field.style.left     = '-10px';
+    field.style.top      = '-10px';
+
+    /**
+     * Clears the contents of the underlying field. The actual clearing of the
+     * field is deferred, occurring asynchronously after the call completes.
+     *
+     * @private
+     */
+    var clear = function clear() {
+        window.setTimeout(function deferClear() {
+            field.value = '';
+        }, 0);
+    };
+
+    // Keep internal field contents clear
+    field.addEventListener("change", clear, false);
+    field.addEventListener("input", clear, false);
+
+    /**
+     * Attempts to focus the underlying input field. The focus attempt occurs
+     * asynchronously, and may silently fail depending on browser restrictions.
+     */
+    this.focus = function focus() {
+        window.setTimeout(function deferRefocus() {
+            field.focus(); // Focus must be deferred to work reliably across browsers
+        }, 0);
+    };
+
+    /**
+     * Returns the underlying input field. This input field MUST be manually
+     * added to the DOM for the Guacamole.Keyboard.InputSink to have any
+     * effect.
+     *
+     * @returns {Element}
+     */
+    this.getElement = function getElement() {
+        return field;
+    };
+
+    // Automatically refocus input sink if part of DOM
+    document.addEventListener("click", function refocusSink(e) {
+
+        // Do not refocus if focus is on an input field
+        var focused = document.activeElement;
+        if (focused && focused !== document.body)
+            return;
+
+        // Refocus input sink instead of handling click
+        sink.focus();
+        e.preventDefault();
+
+    }, true);
+
+};


[05/23] guacamole-client git commit: GUACAMOLE-352: Do not attempt to send dead keys (only the composed key should be sent).

Posted by vn...@apache.org.
GUACAMOLE-352: Do not attempt to send dead keys (only the composed key should be sent).

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/9dc86119
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/9dc86119
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/9dc86119

Branch: refs/heads/master
Commit: 9dc86119b0190a5c4f573474e8d78c3bb2381456
Parents: bd73f9c
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Dec 17 19:13:36 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 09:50:54 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/modules/Keyboard.js             | 16 ----------------
 1 file changed, 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/9dc86119/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index e41b03e..0480d4d 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -459,22 +459,6 @@ Guacamole.Keyboard = function(element) {
         "Compose": [0xFF20],
         "Control": [0xFFE3, 0xFFE3, 0xFFE4],
         "ContextMenu": [0xFF67],
-        "DeadGrave": [0xFE50],
-        "DeadAcute": [0xFE51],
-        "DeadCircumflex": [0xFE52],
-        "DeadTilde": [0xFE53],
-        "DeadMacron": [0xFE54],
-        "DeadBreve": [0xFE55],
-        "DeadAboveDot": [0xFE56],
-        "DeadUmlaut": [0xFE57],
-        "DeadAboveRing": [0xFE58],
-        "DeadDoubleacute": [0xFE59],
-        "DeadCaron": [0xFE5A],
-        "DeadCedilla": [0xFE5B],
-        "DeadOgonek": [0xFE5C],
-        "DeadIota": [0xFE5D],
-        "DeadVoicedSound": [0xFE5E],
-        "DeadSemivoicedSound": [0xFE5F],
         "Delete": [0xFFFF],
         "Down": [0xFF54],
         "End": [0xFF57],


[23/23] guacamole-client git commit: GUACAMOLE-352: Merge work around lack of key events for dead keys.

Posted by vn...@apache.org.
GUACAMOLE-352: Merge work around lack of key events for dead keys.


Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/073dbe72
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/073dbe72
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/073dbe72

Branch: refs/heads/master
Commit: 073dbe7240bcbd1246cbc1a5c035cb1e9e4bc9b0
Parents: bd73f9c a49bfad
Author: Nick Couchman <vn...@apache.org>
Authored: Tue Jan 16 13:40:43 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Tue Jan 16 13:40:43 2018 -0500

----------------------------------------------------------------------
 .../src/main/webapp/modules/InputSink.js        | 128 +++++++++
 .../src/main/webapp/modules/Keyboard.js         | 283 ++++++++++++++-----
 .../webapp/app/client/templates/client.html     |   2 +-
 .../app/clipboard/services/clipboardService.js  |   1 +
 .../app/index/controllers/indexController.js    |   5 +
 5 files changed, 349 insertions(+), 70 deletions(-)
----------------------------------------------------------------------



[11/23] guacamole-client git commit: GUACAMOLE-352: Additionally click() while attempting to refocus the input sink field. Do not rely on autofocus, which may result in the field being partly focused (outlined as focused) but not receiving any actual tex

Posted by vn...@apache.org.
GUACAMOLE-352: Additionally click() while attempting to refocus the input sink field. Do not rely on autofocus, which may result in the field being partly focused (outlined as focused) but not receiving any actual text input.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/9f6b2fad
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/9f6b2fad
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/9f6b2fad

Branch: refs/heads/master
Commit: 9f6b2fad37aa8f087d1464523c4ff1ee75ef861f
Parents: e5e01be
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Dec 18 14:56:39 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 10:20:42 2018 -0800

----------------------------------------------------------------------
 .../src/main/webapp/modules/Keyboard.js                | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/9f6b2fad/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index 3a114db..b0930c2 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1440,8 +1440,8 @@ Guacamole.Keyboard.InputSink = function InputSink() {
      * @type {Element}
      */
     var field = document.createElement('textarea');
-    field.setAttribute('autofocus', 'autofocus');
     field.style.position = 'fixed';
+    field.style.outline  = 'none';
     field.style.border   = 'none';
     field.style.width    = '10px';
     field.style.height   = '10px';
@@ -1463,6 +1463,16 @@ Guacamole.Keyboard.InputSink = function InputSink() {
     // Keep internal field contents clear
     field.addEventListener("change", clear, false);
 
+    // Whenever focus is gained, automatically click to ensure cursor is
+    // actually placed within the field (the field may simply be highlighted or
+    // outlined otherwise)
+    field.addEventListener("focus", function focusReceived() {
+        window.setTimeout(function deferRefocus() {
+            field.click();
+            field.select();
+        }, 0);
+    }, true);
+
     /**
      * Attempts to focus the underlying input field. The focus attempt occurs
      * asynchronously, and may silently fail depending on browser restrictions.
@@ -1470,7 +1480,6 @@ Guacamole.Keyboard.InputSink = function InputSink() {
     this.focus = function focus() {
         window.setTimeout(function deferRefocus() {
             field.focus(); // Focus must be deferred to work reliably across browsers
-            field.select();
         }, 0);
     };
 


[12/23] guacamole-client git commit: GUACAMOLE-352: Clarify that Guacamole.Keyboard can be given an Element or a Document.

Posted by vn...@apache.org.
GUACAMOLE-352: Clarify that Guacamole.Keyboard can be given an Element or a Document.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/5136b1cf
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/5136b1cf
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/5136b1cf

Branch: refs/heads/master
Commit: 5136b1cf8e4637c253cca609c336038edb8274e3
Parents: 86d9cc1
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Dec 18 11:20:13 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 10:20:42 2018 -0800

----------------------------------------------------------------------
 guacamole-common-js/src/main/webapp/modules/Keyboard.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/5136b1cf/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index c25a1fd..aaeb1f6 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -25,7 +25,7 @@ var Guacamole = Guacamole || {};
  * which represent keys as their corresponding X11 keysym.
  * 
  * @constructor
- * @param {Element} [element]
+ * @param {Element|Document} [element]
  *    The Element to use to provide keyboard events. If omitted, at least one
  *    Element must be manually provided through the listenTo() function for
  *    the Guacamole.Keyboard instance to have any effect.
@@ -1186,7 +1186,7 @@ Guacamole.Keyboard = function Keyboard(element) {
      * events signalled through this Guacamole.Keyboard's onkeydown and
      * onkeyup handlers.
      *
-     * @param {Element} element
+     * @param {Element|Document} element
      *     The Element to attach event listeners to for the sake of handling
      *     key or input events.
      */


[14/23] guacamole-client git commit: GUACAMOLE-352: Do not clear InputSink field upon "input" event (may be fired after a partial composition).

Posted by vn...@apache.org.
GUACAMOLE-352: Do not clear InputSink field upon "input" event (may be fired after a partial composition).

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/7b29f7b0
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/7b29f7b0
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/7b29f7b0

Branch: refs/heads/master
Commit: 7b29f7b082f4315a0a740823c6067466b16f2d8d
Parents: 5136b1c
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Dec 18 11:20:48 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 10:20:42 2018 -0800

----------------------------------------------------------------------
 guacamole-common-js/src/main/webapp/modules/Keyboard.js | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/7b29f7b0/guacamole-common-js/src/main/webapp/modules/Keyboard.js
----------------------------------------------------------------------
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index aaeb1f6..0563f72 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -1462,7 +1462,6 @@ Guacamole.Keyboard.InputSink = function InputSink() {
 
     // Keep internal field contents clear
     field.addEventListener("change", clear, false);
-    field.addEventListener("input", clear, false);
 
     /**
      * Attempts to focus the underlying input field. The focus attempt occurs


[21/23] guacamole-client git commit: GUACAMOLE-352: Remove Guacamole menu entirely when closed. Input fields within the menu must not continue to receive input.

Posted by vn...@apache.org.
GUACAMOLE-352: Remove Guacamole menu entirely when closed. Input fields within the menu must not continue to receive input.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/9065b497
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/9065b497
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/9065b497

Branch: refs/heads/master
Commit: 9065b497c2333b6034a490ccfe41d36e91d21e5b
Parents: 9f6b2fa
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Dec 18 15:41:55 2017 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jan 16 10:20:43 2018 -0800

----------------------------------------------------------------------
 guacamole/src/main/webapp/app/client/templates/client.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/9065b497/guacamole/src/main/webapp/app/client/templates/client.html
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/templates/client.html b/guacamole/src/main/webapp/app/client/templates/client.html
index 0580c8b..0d2b688 100644
--- a/guacamole/src/main/webapp/app/client/templates/client.html
+++ b/guacamole/src/main/webapp/app/client/templates/client.html
@@ -38,7 +38,7 @@
 
     <!-- Menu -->
     <div class="menu" ng-class="{open: menu.shown}" id="guac-menu">
-        <div class="menu-content">
+        <div class="menu-content" ng-if="menu.shown">
 
             <!-- Stationary header -->
             <div class="header">