]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/qwebircinterface.js
Try not to corrupt the namespaces.
[irc/quakenet/qwebirc.git] / js / qwebircinterface.js
index 8f9562610761e2d157cd77d9c52fafb49bf43ff1..62fc9d7c82a0c4c633faf19ac724ae41f0546c7f 100644 (file)
@@ -1,4 +1,4 @@
-var QWebIRCInterface = new Class({
+qwebirc.ui.Interface = new Class({
   Implements: [Options],
   options: {
     initialNickname: "qwebirc" + Math.ceil(Math.random() * 100000),
@@ -10,13 +10,13 @@ var QWebIRCInterface = new Class({
     this.setOptions(options);
 
     window.addEvent("domready", function() {
-      var ui_ = new ui($(element), new Theme(this.options.theme));
+      var ui_ = new ui($(element), new qwebirc.ui.Theme(this.options.theme));
       var inick = this.options.initialNickname;
       var ichans = this.options.initialChannels;
       var autoNick = true;
       
       var callback = function(options) {
-        var IRC = new IRCClient(options, ui_);
+        var IRC = new qwebirc.irc.IRCClient(options, ui_);
         IRC.connect();
         window.addEvent("beforeunload", function() {
           IRC.quit("Page closed");
@@ -25,7 +25,7 @@ var QWebIRCInterface = new Class({
 
       var supplied = false; 
       if(this.options.searchURL) {
-        var args = parseURI(String(document.location));
+        var args = qwebirc.util.parseURI(String(document.location));
         
         var chans = args["channels"];
         var nick = args["nick"];
@@ -44,12 +44,15 @@ var QWebIRCInterface = new Class({
           supplied = true;
         }
         
-        if(nick) {
+        if($defined(nick)) {
           inick = nick;
           autoNick = false;
         }
+        
+        if(supplied && args["prompt"])
+          supplied = false;
       }
-
+      
       var details = ui_.loginBox(callback, inick, ichans, supplied, autoNick);
     }.bind(this));
   }