]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
https location support.
authorChris Porter <redacted>
Thu, 12 May 2011 15:14:35 +0000 (16:14 +0100)
committerChris Porter <redacted>
Thu, 12 May 2011 15:14:35 +0000 (16:14 +0100)
js/qwebircinterface.js
js/ui/panes/embed.js

index cab0249bfb6b9821361ffc52cb97eb468da4e533..6adc6ca63289f057cef9ec0d6a1b3086cca74a55 100644 (file)
@@ -28,6 +28,21 @@ qwebirc.ui.Interface = new Class({
   },
   initialize: function(element, ui, options) {
     this.setOptions(options);
+    var extractHost = function(uri) {
+      var start = uri.indexOf('?');
+      if(start != -1)
+        uri = uri.substring(0, start);
+      var start = uri.indexOf('#');
+      if(start != -1)
+        uri = uri.substring(0, start);
+
+      if(uri.substr(uri.length - 1) != "/")
+        uri = uri + "/";
+
+      return uri;
+    };
+
+    options.baseURL = extractHost(document.location.href);
     
     /* HACK */
     qwebirc.global = {
@@ -37,6 +52,7 @@ qwebirc.ui.Interface = new Class({
       nicknameValidator: $defined(options.nickValidation) ? new qwebirc.irc.NicknameValidator(options.nickValidation) : new qwebirc.irc.DummyNicknameValidator()
     };
 
+
     window.addEvent("domready", function() {
       var callback = function(options) {
         var IRC = new qwebirc.irc.IRCClient(options, ui_);
index baf4cba3fbd3df562679a15522ff592aaba12738..c52ce6b28cb2459a45ced666d4afd2ea380a13bb 100644 (file)
@@ -319,6 +319,6 @@ qwebirc.ui.EmbedWizard = new Class({
         URL.push("uio=" + uioptions);
     }
     
-    return this.options.baseURL + (URL.length>0?"?":"") + URL.join("&");
+    return qwebirc.global.baseURL + (URL.length>0?"?":"") + URL.join("&");
   }
 });