Removing debugging, adding some comments
authorJack Allnutt <m2ys4u@Gmail.com>
Sat, 3 Nov 2012 20:42:25 +0000 (20:42 +0000)
committerJack Allnutt <m2ys4u@Gmail.com>
Sat, 3 Nov 2012 20:42:25 +0000 (20:42 +0000)
client/assets/dev/model_application.js

index b3d11c7c467f3b099aaf6bf39ed08a1aef2a13ec..e11bb95909555b61a8c296758237ca9436f39f61 100644 (file)
@@ -152,32 +152,37 @@ kiwi.model.Application = function () {
                 parts.shift();\r
 \r
                 if (parts.length > 0 && parts[0]) {\r
+                    // Check to see if we're dealing with an irc: uri, or whether we need to extract the server/channel info from the HTTP URL path.\r
                     uricheck = parts[0].substr(0, 7).toLowerCase();\r
                     if ((uricheck === 'ircs%3a') || (uricheck.substr(0,6) === 'irc%3a')) {\r
                         parts[0] = decodeURIComponent(parts[0]);\r
-                        console.log(parts[0]);\r
                         // irc[s]://<host>[:<port>]/[<channel>[?<password>]]\r
                         uricheck = /^irc(s)?:(?:\/\/?)?([^:\/]+)(?::([0-9]+))?(?:(?:\/)([^\?]*)(?:(?:\?)(.*))?)?$/.exec(parts[0]);\r
-                        console.log(uricheck);\r
+                        /*\r
+                            uricheck[1] = ssl (optional)\r
+                            uricheck[2] = host\r
+                            uricheck[3] = port (optional)\r
+                            uricheck[4] = channel (optional)\r
+                            uricheck[5] = channel key (optional, channel must also be set)\r
+                        */\r
                         if (uricheck) {\r
-                            if (uricheck[1]) {\r
+                            if (typeof uricheck[1] !== 'undefined') {\r
                                 defaults.ssl = true;\r
                                 if (defaults.port === 6667) {\r
                                     defaults.port = 6697;\r
                                 }\r
                             }\r
                             defaults.server = uricheck[2];\r
-                            if (uricheck[3]) {\r
+                            if (typeof uricheck[3] !== 'undefined') {\r
                                 defaults.port = uricheck[3];\r
                             }\r
-                            if (uricheck[4]) {\r
+                            if (typeof uricheck[4] !== 'undefined') {\r
                                 defaults.channel = '#' + uricheck[4];\r
-                                if (uricheck[5]) {\r
+                                if (typeof uricheck[5] !== 'undefined') {\r
                                     defaults.channel_key = uricheck[5];\r
                                 }\r
                             }\r
                         }\r
-                        console.log(defaults);\r
                         parts = [];\r
                     } else {\r
                         // Extract the port+ssl if we find one\r