From 46f98bec8d31906686e73d286b751eaabdd7d3c4 Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Sat, 17 Sep 2011 19:10:29 +0100 Subject: [PATCH] Support for changing port and using SSL on client --- js/front.js | 17 +++++++++++++---- node/client/index.html.jade | 6 ++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/js/front.js b/js/front.js index cc606e1..515d980 100644 --- a/js/front.js +++ b/js/front.js @@ -103,6 +103,8 @@ kiwi.front = { $('#kiwi .formconnectwindow').submit(function () { var netsel = $('#kiwi .formconnectwindow .network'), + netport = $('#kiwi .formconnectwindow .port'), + netssl = $('#kiwi .formconnectwindow .ssl'), nick = $('#kiwi .formconnectwindow .nick'), tmp; @@ -119,7 +121,7 @@ kiwi.front = { kiwi.front.doLayout(); try { - kiwi.front.run('/connect ' + netsel.val()); + kiwi.front.run('/connect ' + netsel.val() + ' ' + netport.val() + ' ' + (netssl.attr('checked') ? 'true' : '')); } catch (e) {} $('#kiwi .connectwindow').slideUp('', kiwi.front.barsShow); @@ -282,15 +284,22 @@ kiwi.front = { case '/connect': case '/server': if (parts[1] === undefined) { - alert('Usage: /connect servername [port]'); + alert('Usage: /connect servername [[port] [ssl]]'); break; } if (parts[2] === undefined) { parts[2] = 6667; } - kiwi.front.cur_channel.addMsg(null, ' ', '=== Connecting to ' + parts[1] + '...', 'status'); - kiwi.gateway.connect(parts[1], parts[2], 0); + + if ((parts[3] === undefined) || (parts[3] === 'false') || (parts[3] === 'no')) { + parts[3] = false; + } else { + parts[3] = true; + } + + kiwi.front.cur_channel.addMsg(null, ' ', '=== Connecting to ' + parts[1] + ' on port ' + parts[2] + ((parts[3]) ? ' using SSL' : '') + '...', 'status'); + kiwi.gateway.connect(parts[1], parts[2], parts[3]); break; case '/nick': diff --git a/node/client/index.html.jade b/node/client/index.html.jade index 1c1c44a..9c8993a 100644 --- a/node/client/index.html.jade +++ b/node/client/index.html.jade @@ -144,6 +144,12 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb") li label(for="channel") Channel: input(type="text", id="channel", name="channel", class="channel", value="#kiwiirc") + li + label(for="port") Port: + input(type="text", id="port", name="port", class="port", value="6667") + li + label(for="ssl") SSL: + input(type="checkbox", id="ssl", name="ssl", class="ssl") a.connect(href="") Connect... -- 2.25.1