From 56c6c1d637db66f6c1c78ebd0ebe674a0479d4c8 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 27 Sep 2013 17:03:49 -0700 Subject: [PATCH] Add onsync handler. --- .../src/main/resources/guacamole.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/guacamole-common-js/src/main/resources/guacamole.js b/guacamole-common-js/src/main/resources/guacamole.js index aa860b886..04aae5b50 100644 --- a/guacamole-common-js/src/main/resources/guacamole.js +++ b/guacamole-common-js/src/main/resources/guacamole.js @@ -751,6 +751,17 @@ Guacamole.Client = function(tunnel) { */ this.onfile = null; + /** + * Fired whenever a sync instruction is received from the server, indicating + * that the server is finished processing any input from the client and + * has sent any results. + * + * @event + * @param {Number} timestamp The timestamp associated with the sync + * instruction. + */ + this.onsync = null; + // Layers function getBufferLayer(index) { @@ -1376,6 +1387,10 @@ Guacamole.Client = function(tunnel) { if (currentState == STATE_WAITING) setState(STATE_CONNECTED); + // Call sync handler if defined + if (guac_client.onsync) + guac_client.onsync(timestamp); + }, "transfer": function(parameters) {