From 04135b14c9e578da3ff23e42495e6bb4631314ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez?= Date: Mon, 28 Jul 2014 12:02:34 +0000 Subject: [PATCH] Fixed index.xhtml to work on be compatible with uds 1.5 (needs a minor change to client-ui.js to get paramaters from "query.ui" instead of from document.location.search --- guacamole-tunnel/src/main/webapp/index.xhtml | 8 +++++--- guacamole-tunnel/src/main/webapp/scripts/client-ui.js | 8 +++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/guacamole-tunnel/src/main/webapp/index.xhtml b/guacamole-tunnel/src/main/webapp/index.xhtml index 7622c3dc..90a64f90 100644 --- a/guacamole-tunnel/src/main/webapp/index.xhtml +++ b/guacamole-tunnel/src/main/webapp/index.xhtml @@ -177,13 +177,15 @@ var params = {}, re=/[^?]*\?([^&]*)&(.*)/; - params.data = res[1] - params.data = res[2] + var res = re.exec(qs); + + params.data = res[1]; + params.exit = res[2]; return params; } - window.query = getQueryParams(document.location); + window.query = getQueryParams(document.location.href); // Sanity check Guacamole JavaScript API version // if (Guacamole.API_VERSION !== "0.9.1") diff --git a/guacamole-tunnel/src/main/webapp/scripts/client-ui.js b/guacamole-tunnel/src/main/webapp/scripts/client-ui.js index 286dbb54..291165b2 100644 --- a/guacamole-tunnel/src/main/webapp/scripts/client-ui.js +++ b/guacamole-tunnel/src/main/webapp/scripts/client-ui.js @@ -998,8 +998,13 @@ GuacUI.Client.connect = function() { // all parameters should be preserved and passed on for // the sake of authentication. + var queryArr = []; + for( k in window.query ) { + queryArr.push(k+"="+window.query[k]) + } + var connect_string = - window.location.search.substring(1) + queryArr.join('&') + "&width=" + Math.floor(optimal_width) + "&height=" + Math.floor(optimal_height) + "&dpi=" + Math.floor(optimal_dpi); @@ -1028,6 +1033,7 @@ GuacUI.Client.connect = function() { window.location = window.query.exit; }; + console.log(connect_string); // Connect guac.connect(connect_string);