summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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