Support for changing port and using SSL on client
authorJack Allnutt <m2ys4u@Gmail.com>
Sat, 17 Sep 2011 18:10:29 +0000 (19:10 +0100)
committerJack Allnutt <m2ys4u@Gmail.com>
Sat, 17 Sep 2011 18:10:29 +0000 (19:10 +0100)
js/front.js
node/client/index.html.jade

index cc606e1ec7f8bf61cef69d2b4bee150729d3a5ab..515d980575e131f5bbbe1fd208a75840abe4582d 100644 (file)
@@ -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':
index 1c1c44a9e3e6e0b547e80f68336159555f106a73..9c8993ab0184bb09890b6d1342cd4ff269de7e5e 100644 (file)
@@ -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...