Mergability with development branch
authorJack Allnutt <m2ys4u@gmail.com>
Sat, 30 Mar 2013 21:22:51 +0000 (21:22 +0000)
committerJack Allnutt <m2ys4u@gmail.com>
Sat, 30 Mar 2013 21:29:50 +0000 (21:29 +0000)
README.md
client/assets/css/style.css
client/assets/dev/index.html.tmpl
client/assets/dev/view.js
config.example.js
server/client.js
server/irc/state.js

index ecbb815b8afd9ebde95d073b964c75f1bff57322..7868c356695a02ba7d0c3c1a58c1861e0009cc47 100755 (executable)
--- a/README.md
+++ b/README.md
@@ -8,6 +8,8 @@ Our development IRC channel is on the Freenode network, irc.freenode.net #kiwiir
 \r
 ### Installation\r
 \r
+*Note: This requires Node.js to run. Make sure you have installed Node.js first! http://nodejs.org/download/*\r
+\r
 1. Download the Kiwi source or clone the git repository:\r
 \r
     `$ git clone git@github.com:prawnsalad/KiwiIRC.git && cd KiwiIRC`\r
index 697bbd4b836d518c421407e8ef0c0a038010208b..7af1011787df29e719b2046e247f4b0a55dab0f3 100644 (file)
@@ -114,7 +114,7 @@ html, body { height:100%; }
  * Control box
  */
 #kiwi #controlbox .input {
-    height:1.7em;
+    height:1.7em; position:relative;
 }
 
 /* The nick label */
@@ -136,6 +136,10 @@ html, body { height:100%; }
 #kiwi #controlbox .nickchange input { }
 #kiwi #controlbox .nickchange button { }
 
+/* Plugin tools */
+#kiwi #controlbox .input_tools { float:right; }
+#kiwi #controlbox .input_tools .tool { margin:0 1em; display:inline; }
+
 
 
 /**
index 2b948d9783520a6792218ddd2a5da18d5923c3f1..b2caf936bfc42aacdfadfb56d975a1018c805420 100644 (file)
@@ -47,6 +47,7 @@
             <div class="input">\r
                 <span class="nick"> </span>\r
                 <div class="input_wrap"><textarea class="inp"></textarea></div>\r
+                <div class="input_tools"></div>\r
             </div>\r
         </div>\r
     </div>\r
index c4c4bc62949929d1d5561907e5b9fb88a36e4221..d9522a1e6783d561ff63d0b24efbe026a3721a9a 100644 (file)
@@ -1237,6 +1237,9 @@ _kiwi.view.Application = Backbone.View.extend({
             // And move the handle just out of sight to the right\r
             el_resize_handle.css('left', el_panels.outerWidth(true));\r
         }\r
+\r
+        var input_wrap_width = parseInt($('#kiwi #controlbox .input_tools').outerWidth());\r
+        el_controlbox.find('.input_wrap').css('right', input_wrap_width + 7);\r
     },\r
 \r
 \r
index a44ed93eca092686e27c18edccf5940414e76626..03f73cc0556dd0280e07a22ceff22b6b90d5a56b 100644 (file)
@@ -92,8 +92,8 @@ conf.webirc_pass = {
 
 // Some IRCDs require the clients IP via the username/ident
 conf.ip_as_username = [
-       "irc.network.com",
-       "127.0.0.1"
+    //"irc.network.com",
+    //"127.0.0.1"
 ];
 
 // Whether to verify IRC servers' SSL certificates against built-in well-known certificate authorities
@@ -158,4 +158,4 @@ conf.client = {
 /*
  * Do not ammend the below lines unless you understand the changes!
  */
-module.exports.production = conf;
\ No newline at end of file
+module.exports.production = conf;
index 4bfeb1bf44beddcff72cef6c10b36c0e909a9bb9..66b5dd126a48bcd6751da2f915b7365c25bcc906 100755 (executable)
@@ -114,26 +114,14 @@ function kiwiCommand(command, callback) {
             if (command.hostname && command.port && command.nick) {
                 var con;
 
-                if (global.config.restrict_server) {
-                    this.state.connect(
-                        global.config.restrict_server,
-                        global.config.restrict_server_port,
-                        global.config.restrict_server_ssl,
-                        command.nick,
-                        {hostname: this.websocket.handshake.revdns, address: this.websocket.handshake.real_address},
-                        global.config.restrict_server_password,
-                        callback);
-
-                } else {
-                    this.state.connect(
-                        command.hostname,
-                        command.port,
-                        command.ssl,
-                        command.nick,
-                        {hostname: this.websocket.handshake.revdns, address: this.websocket.handshake.real_address},
-                        command.password,
-                        callback);
-                }
+                this.state.connect(
+                    (global.config.restrict_server || command.hostname),
+                    (global.config.restrict_server_port || command.port),
+                    (global.config.restrict_server_ssl || command.ssl),
+                    command.nick,
+                    {hostname: this.websocket.handshake.revdns, address: this.websocket.handshake.real_address},
+                    (global.config.restrict_server_password || command.password),
+                    callback);
             } else {
                 return callback('Hostname, port and nickname must be specified');
             }
@@ -155,4 +143,4 @@ function websocketDisconnect() {
 // TODO: Should this close all the websocket connections too?
 function websocketError() {
     this.dispose();
-}
\ No newline at end of file
+}
index 8dd24ed0529465fa2d687e83f6c96edf6c386094..9e7c8d7df383e471c4e02868ebef346e1a3f7b3b 100755 (executable)
@@ -36,31 +36,24 @@ module.exports = State;
 State.prototype.connect = function (hostname, port, ssl, nick, user, pass, callback) {
     var that = this;
     var con, con_num;
-    if (global.config.restrict_server) {
-        con = new IrcConnection(
-            global.config.restrict_server,
-            global.config.restrict_server_port,
-            global.config.restrict_server_ssl,
-            nick,
-            user,
-            global.config.restrict_server_password,
-            this);
-
-    } else {
-        if ((global.config.max_server_conns > 0) && (!(global.config.webirc_pass && global.config.webirc_passs[hostname])))  {
-            if (global.servers.numOnHost(hostname) >= global.config.max_server_conns) {
-                return callback('Too many connections to host', {host: hostname, limit: global.config.max_server_conns});
-            }
-        }
-        con = new IrcConnection(
-            hostname,
-            port,
-            ssl,
-            nick,
-            user,
-            pass,
-            this);
+    
+    // Check the per-server limit on the number of connections
+    if ((global.config.max_server_conns > 0) &&
+        (!global.config.restrict_server) &&
+        (!(global.config.webirc_pass && global.config.webirc_pass[hostname])) &&
+        (global.servers.numOnHost(hostname) >= global.config.max_server_conns))
+    {
+        return callback('Too many connections to host', {host: hostname, limit: global.config.max_server_conns});
     }
+
+    con = new IrcConnection(
+        hostname,
+        port,
+        ssl,
+        nick,
+        user,
+        pass,
+        this);
     
     con_num = this.next_connection++;
     this.irc_connections[con_num] = con;