Add support for secure (SSL) & passworded servers #110

Merged
merged 1 commit into from May 22, 2012
View
10 assets/js/views/overview.js
@@ -47,6 +47,10 @@ var OverviewView = Backbone.View.extend({
$('.error').removeClass('error');
var server = $('#connect-server').val();
var nick = $('#connect-nick').val();
+ var port = $('#connect-port').val();
+ var secure = $('#connect-secure').val();
+ var selfSigned = $('#connect-selfSigned').val();
+ var password = $('#connect-password').val();
if (!server) {
$('#connect-server').closest('.clearfix').addClass('error');
$('#connect-server').addClass('error');
@@ -61,7 +65,11 @@ var OverviewView = Backbone.View.extend({
var connectInfo = {
nick: nick,
- server: server
+ server: server,
+ port: port,
+ secure: secure,
+ selfSigned: selfSigned,
+ password: password
};
irc.me = new User(connectInfo);
irc.me.on('change:nick', irc.appView.renderUserBox);
View
4 lib/irchandler.js
@@ -123,6 +123,10 @@ var irchandler = exports.irchandler = function(socket) {
}
if(client === undefined) {
client = new irc.Client(data.server, data.nick, {
+ port: data.port || 6667,
+ password: data.password,
+ secure: data.secure,
+ selfSigned: data.selfSigned,
debug: true,
logged_in: false,
showErrors: true,
View
16 views/templates.jade
@@ -42,6 +42,22 @@ script(id="overview_connection", type="text/html")
label(for="connect-nick") Nick
.controls
input#connect-nick(type="text")
+ .control-group
+ label(for="connect-port") Port
+ .controls
+ input#connect-port(type="text")
+ .control-group
+ label(for="connect-secure") SSL
+ .controls
+ input#connect-secure(type="checkbox")
+ .control-group
+ label(for="connect-selfSigned") Self-signed SSL Cert
+ .controls
+ input#connect-selfSigned(type="checkbox")
+ .control-group
+ label(for="connect-password") Password
+ .controls
+ input#connect-password(type="password")
a(id="connect-button", class="btn btn-primary", type="button") Connect
script(id="overview_settings", type="text/html")