From f29a101537501789e01405172b366297319b9a8a Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 11 Sep 2011 16:10:38 -0700 Subject: [PATCH] Partial implementation of new format instructions in output. --- .../src/main/resources/guacamole.js | 34 ++++--------------- .../src/main/resources/tunnel.js | 29 +++++++++++++--- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/guacamole-common-js/src/main/resources/guacamole.js b/guacamole-common-js/src/main/resources/guacamole.js index 0e5a5af1c..ec925f415 100644 --- a/guacamole-common-js/src/main/resources/guacamole.js +++ b/guacamole-common-js/src/main/resources/guacamole.js @@ -102,7 +102,7 @@ Guacamole.Client = function(display, tunnel) { if (!isConnected()) return; - tunnel.sendMessage("key:" + keysym + "," + pressed + ";"); + tunnel.sendMessage("key", keysym, pressed); }; guac_client.sendMouseState = function(mouseState) { @@ -128,7 +128,7 @@ Guacamole.Client = function(display, tunnel) { if (mouseState.down) buttonMask |= 16; // Send message - tunnel.sendMessage("mouse:" + mouseState.x + "," + mouseState.y + "," + buttonMask + ";"); + tunnel.sendMessage("mouse", mouseState.x, mouseState.y, buttonMask); }; guac_client.setClipboard = function(data) { @@ -137,7 +137,7 @@ Guacamole.Client = function(display, tunnel) { if (!isConnected()) return; - tunnel.sendMessage("clipboard:" + escapeGuacamoleString(data) + ";"); + tunnel.sendMessage("clipboard", data); }; // Handlers @@ -384,7 +384,7 @@ Guacamole.Client = function(display, tunnel) { // Send sync response when layers are finished if (layersToSync == 0) - tunnel.sendMessage("sync:" + timestamp + ";"); + tunnel.sendMessage("sync", timestamp); } @@ -402,7 +402,7 @@ Guacamole.Client = function(display, tunnel) { // If all layers are ready, then we didn't install any hooks. // Send sync message now, if (layersToSync == 0) - tunnel.sendMessage("sync:" + timestamp + ";"); + tunnel.sendMessage("sync", timestamp); } @@ -425,35 +425,13 @@ Guacamole.Client = function(display, tunnel) { && currentState != STATE_DISCONNECTING) { setState(STATE_DISCONNECTING); - tunnel.sendMessage("disconnect;"); + tunnel.sendMessage("disconnect"); tunnel.disconnect(); setState(STATE_DISCONNECTED); } } - function escapeGuacamoleString(str) { - - var escapedString = ""; - - for (var i=0; i