]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Merge.
authorChris Porter <redacted>
Mon, 13 Feb 2012 01:46:47 +0000 (01:46 +0000)
committerChris Porter <redacted>
Mon, 13 Feb 2012 01:46:47 +0000 (01:46 +0000)
1  2 
js/irc/ircclient.js
js/qwebirc.js
js/qwebircinterface.js

diff --combined js/irc/ircclient.js
index 354e41aefa0fd5467dbddb3150d262460b7a6c0b,a26ae86861749da9f84bf6ebec6bff2d8a7788f7..dc8a09772c5b3f8ad3a7ad0784f6edc72c2020c8
@@@ -242,8 -242,6 +242,8 @@@ qwebirc.irc.IRCClient = new Class(
  
        this.exec("/AUTOJOIN");
      }
 +
 +    this.ui.signedOn();
    },
    userJoined: function(user, channel) {
      var nick = user.hostToNick();
      }
      this.tracker = undefined;
      
+     qwebirc.connected = false;
      this.newServerLine("DISCONNECT", {"m": message});
    },
    nickOnChanHasPrefix: function(nick, channel, prefix) {
      this.parent(key, value);
    },
    connected: function() {
+     qwebirc.connected = true;
      this.newServerLine("CONNECT");
    },
    serverError: function(message) {
    },
    channelCreationTime: function(channel, time) {
      this.newTargetOrActiveLine(channel, "CHANNELCREATIONTIME", {c: channel, m: qwebirc.irc.IRCDate(new Date(time * 1000))});
 -  }  
 +  },
 +  qwebircImage: function(target, url) {
 +    var w;
 +    if(target == "-STATUS") {
 +      w = this.statusWindow;
 +    } else {
 +      w = this.getWindow(target);
 +    }
 +
 +    if(!w)
 +      w = this.getActiveWindow();
 +
 +    var img = new Element("img", {src: qwebirc.global.dynamicBaseURL + "image?filename=" + url});
 +    var d = new Element("div", {styles: {"paddingTop": "2px", "paddingBottom": "2px", "paddingLeft": "9px"}});
 +    d.appendChild(img);
 +    w.scrollAdd(d);
 +    return true;
 +  }
  });
diff --combined js/qwebirc.js
index f5981c470d3fc5c356eb41b2df15ecdee485cc10,03e8b80d1cc0a486777e1b1b73eae1a553cb80b1..8e4b08561d2ffddd46fdda4714bb968aa219d9be
@@@ -1,4 -1,4 +1,4 @@@
- var qwebirc = {ui: {themes: {}, style: {}}, irc: {}, util: {crypto: {}}, config: {}, auth: {}, sound: {}, xdomain: {}};
 -var qwebirc = {ui: {themes: {}, style: {}}, irc: {}, util: {crypto: {}}, config: {}, auth: {}, sound: {}, connected: false};
++var qwebirc = {ui: {themes: {}, style: {}}, irc: {}, util: {crypto: {}}, config: {}, auth: {}, sound: {}, connected: false, xdomain: {}};
  
  if(typeof QWEBIRC_BUILD != "undefined") {
    qwebirc.BUILD = QWEBIRC_BUILD;
diff --combined js/qwebircinterface.js
index 7be8fa75077d33265f1bdfcb5bca01dd354140cf,1d7f249a6701d4e9a34a52deff10520304a62a54..44ea44c42cf3d6267e4dbaa4aa6c0851553719b5
@@@ -1,9 -1,11 +1,11 @@@
  function qwebirc_ui_onbeforeunload(e) { /* IE sucks */
-   var message = "This action will close all active IRC connections.";
-   var e = e || window.event;
-   if(e)
-     e.returnValue = message;
-   return message;
+   if(qwebirc.connected) {
+     var message = "This action will close all active IRC connections.";
+     var e = e || window.event;
+     if(e)
+       e.returnValue = message;
+     return message;
+   }
  }
  
  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 = {
        dynamicBaseURL: options.dynamicBaseURL,
        staticBaseURL: options.staticBaseURL,
 +      baseURL: options.baseURL,
        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_);