From 05a7c87b4c1ba583e110ceef0b6a893c957de6fa Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 7 Apr 2014 17:32:26 -0700 Subject: [PATCH] GUAC-608: Add support for stream style clipboard. --- .../src/main/webapp/modules/Client.js | 68 +++++++++++++++++-- 1 file changed, 61 insertions(+), 7 deletions(-) diff --git a/guacamole-common-js/src/main/webapp/modules/Client.js b/guacamole-common-js/src/main/webapp/modules/Client.js index ac8f91d34..4459c8f7a 100644 --- a/guacamole-common-js/src/main/webapp/modules/Client.js +++ b/guacamole-common-js/src/main/webapp/modules/Client.js @@ -249,7 +249,8 @@ Guacamole.Client = function(tunnel) { /** * Sets the clipboard of the remote client to the given text data. - * + * + * @deprecated Use createClipboardStream() instead. * @param {String} data The data to send as the clipboard contents. */ this.setClipboard = function(data) { @@ -258,12 +259,22 @@ Guacamole.Client = function(tunnel) { if (!isConnected()) return; - tunnel.sendMessage("clipboard", data); + // Open stream + var stream = guac_client.createClipboardStream("text/plain"); + var writer = new Guacamole.StringWriter(stream); + + // Send text chunks + for (var i=0; i