From: Michael Jumper Date: Sun, 11 Sep 2011 23:10:38 +0000 (-0700) Subject: Partial implementation of new format instructions in output. X-Git-Url: http://git.alex.org.uk Partial implementation of new format instructions in output. --- diff --git a/src/main/resources/guacamole.js b/src/main/resources/guacamole.js index 0e5a5af..ec925f4 100644 --- a/src/main/resources/guacamole.js +++ b/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