From 4e5e401168634f8f429876e9da156ef2ff024b87 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 13 Aug 2013 15:08:32 -0700 Subject: [PATCH] Add GuacamoleService.Connection.open() --- guacamole/src/main/webapp/scripts/service.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/guacamole/src/main/webapp/scripts/service.js b/guacamole/src/main/webapp/scripts/service.js index 6b65749ff..85880d59c 100644 --- a/guacamole/src/main/webapp/scripts/service.js +++ b/guacamole/src/main/webapp/scripts/service.js @@ -155,6 +155,24 @@ GuacamoleService.Connection = function(protocol, id, name) { }; + /** + * Opens this connection in a new tab/window. + */ + this.open = function() { + + // Get URL + var url = "client.xhtml?id=" + encodeURIComponent(guac_connection.id); + + // Attempt to focus existing window + var current = window.open(null, guac_connection.id); + + // If window did not already exist, set up as + // Guacamole client + if (!current.GuacUI) + window.open(url, guac_connection.id); + + }; + }; /**