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 2017/09/04 01:10:55 UTC

[1/4] incubator-guacamole-client git commit: GUACAMOLE-128: Check clipboard for received events only during bubble phase (allow clipboard service to manage propagation from its event target).

Repository: incubator-guacamole-client
Updated Branches:
  refs/heads/master ab88eb2ff -> 0e2da5a2a


GUACAMOLE-128: Check clipboard for received events only during bubble phase (allow clipboard service to manage propagation from its event target).

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

Branch: refs/heads/master
Commit: 1c50311178d3af5f5af07561ccc2f3f599bf62fe
Parents: 6ce1eb1
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Sep 3 16:32:39 2017 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Sun Sep 3 18:02:46 2017 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/1c503111/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 0f4d78d..3a9230b 100644
--- a/guacamole/src/main/webapp/app/index/controllers/indexController.js
+++ b/guacamole/src/main/webapp/app/index/controllers/indexController.js
@@ -137,8 +137,8 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
 
     // Attempt to read the clipboard if it may have changed
     $window.addEventListener('load',  checkClipboard, true);
-    $window.addEventListener('copy',  checkClipboard, true);
-    $window.addEventListener('cut',   checkClipboard, true);
+    $window.addEventListener('copy',  checkClipboard);
+    $window.addEventListener('cut',   checkClipboard);
     $window.addEventListener('focus', function focusGained(e) {
 
         // Only recheck clipboard if it's the window itself that gained focus


[3/4] incubator-guacamole-client git commit: GUACAMOLE-128: Do not allow overlapping clipboard read attempts.

Posted by vn...@apache.org.
GUACAMOLE-128: Do not allow overlapping clipboard read attempts.


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

Branch: refs/heads/master
Commit: 75a575d050abcca8c8dec98df39ee0b3bb322dea
Parents: ab88eb2
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Sep 3 16:07:21 2017 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Sun Sep 3 18:02:46 2017 -0700

----------------------------------------------------------------------
 .../app/clipboard/services/clipboardService.js   | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/75a575d0/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 07091f3..939161e 100644
--- a/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
+++ b/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
@@ -45,6 +45,14 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
     var CLIPBOARD_READ_DELAY = 100;
 
     /**
+     * The promise associated with the current pending clipboard read attempt.
+     * If no clipboard read is active, this will be null.
+     *
+     * @type Promise.<ClipboardData>
+     */
+    var pendingRead = null;
+
+    /**
      * Reference to the window.document object.
      *
      * @private
@@ -398,8 +406,16 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
      */
     service.getLocalClipboard = function getLocalClipboard() {
 
+        // If the clipboard is already being read, do not overlap the read
+        // attempts; instead share the result across all requests
+        if (pendingRead)
+            return pendingRead;
+
         var deferred = $q.defer();
 
+        // Mark read attempt as in progress
+        pendingRead = deferred.promise;
+
         // Wait for the next event queue run before attempting to read
         // clipboard data (in case the copy/cut has not yet completed)
         $window.setTimeout(function deferredClipboardRead() {
@@ -467,6 +483,9 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
                 originalElement.focus();
                 popSelection();
 
+                // No read is pending any longer
+                pendingRead = null;
+
             });
 
             // Ensure clipboard element is blurred (and that the "focus" event


[4/4] incubator-guacamole-client git commit: GUACAMOLE-128: Merge fix clipboard bounce.

Posted by vn...@apache.org.
GUACAMOLE-128: Merge fix clipboard bounce.


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

Branch: refs/heads/master
Commit: 0e2da5a2a0da10572909b4958cc79a3d6be1d740
Parents: ab88eb2 1c50311
Author: Nick Couchman <vn...@apache.org>
Authored: Sun Sep 3 21:10:00 2017 -0400
Committer: Nick Couchman <vn...@apache.org>
Committed: Sun Sep 3 21:10:00 2017 -0400

----------------------------------------------------------------------
 .../app/clipboard/services/clipboardService.js  | 20 ++++++++++++++++++++
 .../app/index/controllers/indexController.js    |  4 ++--
 2 files changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[2/4] incubator-guacamole-client git commit: GUACAMOLE-128: Stop propagation of "cut" events from within clipboard service event target.

Posted by vn...@apache.org.
GUACAMOLE-128: Stop propagation of "cut" events from within clipboard service event target.

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

Branch: refs/heads/master
Commit: 6ce1eb1d3a2d63597cc61b00a850619bb3546552
Parents: 75a575d
Author: Michael Jumper <mj...@apache.org>
Authored: Sun Sep 3 16:30:52 2017 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Sun Sep 3 18:02:46 2017 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/6ce1eb1d/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 939161e..06abb04 100644
--- a/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
+++ b/guacamole/src/main/webapp/app/clipboard/services/clipboardService.js
@@ -86,6 +86,7 @@ angular.module('clipboard').factory('clipboardService', ['$injector',
     };
 
     // Prevent events generated due to execCommand() from disturbing external things
+    clipboardContent.addEventListener('cut',   stopEventPropagation);
     clipboardContent.addEventListener('copy',  stopEventPropagation);
     clipboardContent.addEventListener('paste', stopEventPropagation);