summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Sorvig <msorvig@trolltech.com>2009-09-07 18:37:47 +0200
committerMorten Sorvig <msorvig@trolltech.com>2009-09-07 18:37:47 +0200
commitd2c2218e2fb1fa43379580295c98f7121a48e2b8 (patch)
tree37e20ff367dc0042ec85a4e7b75f27de046c2123
parent5e650ba413d2fc730ae923802bf4ebd2e694f0e3 (diff)
no need to set the host
-rw-r--r--src/eventhandler.js10
-rw-r--r--src/index.html2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/eventhandler.js b/src/eventhandler.js
index 24b189d..5d4f7a2 100644
--- a/src/eventhandler.js
+++ b/src/eventhandler.js
@@ -467,7 +467,15 @@ var webclientObjectCounter = 0;
function setUpWebClientObject(webclientObject)
{
- webclientObject.baseUrl = webclientObject.attributes["src"].value + "/";
+ // Set the base url, this tells QWebClient where to
+ // "phone home". Use the "src" attribute on the webclient
+ // div (set in the html code), or window.location host if
+ // not set.
+ if (webclientObject.attributes["src"])
+ webclientObject.baseUrl = webclientObject.attributes["src"].value + "/";
+ else
+ webclientObject.baseUrl = window.location.host + "/";
+
if (webclientObject.baseUrl.indexOf("http://") == -1)
webclientObject.baseUrl = "http://" + webclientObject.baseUrl;
diff --git a/src/index.html b/src/index.html
index ab2d936..320484a 100644
--- a/src/index.html
+++ b/src/index.html
@@ -1 +1 @@
-<html> <head> <script type="text/javascript" src=":qwebclient.js"></script> </head> <body> <div class="qwebclient" src="INSERT_HOSTNAME"></div> </body> </html> \ No newline at end of file
+<html> <head> <script type="text/javascript" src=":qwebclient.js"></script> </head> <body> <div class="qwebclient"></div> </body> </html> \ No newline at end of file