From 2087f5d185fb87d400cdb903ede8b88b32eaa712 Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Sat, 30 Mar 2013 21:22:51 +0000 Subject: [PATCH] Mergability with development branch --- README.md | 2 ++ client/assets/css/style.css | 6 ++++- client/assets/dev/index.html.tmpl | 1 + client/assets/dev/view.js | 3 +++ config.example.js | 6 ++--- server/client.js | 30 +++++++--------------- server/irc/state.js | 41 +++++++++++++------------------ 7 files changed, 40 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index ecbb815..7868c35 100755 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ Our development IRC channel is on the Freenode network, irc.freenode.net #kiwiir ### Installation +*Note: This requires Node.js to run. Make sure you have installed Node.js first! http://nodejs.org/download/* + 1. Download the Kiwi source or clone the git repository: `$ git clone git@github.com:prawnsalad/KiwiIRC.git && cd KiwiIRC` diff --git a/client/assets/css/style.css b/client/assets/css/style.css index 697bbd4..7af1011 100644 --- a/client/assets/css/style.css +++ b/client/assets/css/style.css @@ -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; } + /** diff --git a/client/assets/dev/index.html.tmpl b/client/assets/dev/index.html.tmpl index 2b948d9..b2caf93 100644 --- a/client/assets/dev/index.html.tmpl +++ b/client/assets/dev/index.html.tmpl @@ -47,6 +47,7 @@
+
diff --git a/client/assets/dev/view.js b/client/assets/dev/view.js index c4c4bc6..d9522a1 100644 --- a/client/assets/dev/view.js +++ b/client/assets/dev/view.js @@ -1237,6 +1237,9 @@ _kiwi.view.Application = Backbone.View.extend({ // And move the handle just out of sight to the right el_resize_handle.css('left', el_panels.outerWidth(true)); } + + var input_wrap_width = parseInt($('#kiwi #controlbox .input_tools').outerWidth()); + el_controlbox.find('.input_wrap').css('right', input_wrap_width + 7); }, diff --git a/config.example.js b/config.example.js index a44ed93..03f73cc 100644 --- a/config.example.js +++ b/config.example.js @@ -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; diff --git a/server/client.js b/server/client.js index 4bfeb1b..66b5dd1 100755 --- a/server/client.js +++ b/server/client.js @@ -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 +} diff --git a/server/irc/state.js b/server/irc/state.js index 8dd24ed..9e7c8d7 100755 --- a/server/irc/state.js +++ b/server/irc/state.js @@ -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; -- 2.25.1