Merge
authorDarren <darren@darrenwhitlen.com>
Thu, 22 Sep 2011 22:21:48 +0000 (23:21 +0100)
committerDarren <darren@darrenwhitlen.com>
Thu, 22 Sep 2011 22:21:48 +0000 (23:21 +0100)
js/front.js
js/gateway.js
js/util.js
node/app.js
node/client/index.html.jade

index 2f7160fc4a5497b2f1f4afd76105eee355181b18..93d296c6415589e57cf8d704ec8278b596384f17 100644 (file)
@@ -274,8 +274,9 @@ kiwi.front = {
         // Update msg if it's been changed by any plugins
         msg = plugin_event.command.toString();
 
-        console.log("running " + msg);
+        
         if (msg.substring(0, 1) === '/') {
+            console.log("running " + msg);
             parts = msg.split(' ');
             switch (parts[0].toLowerCase()) {
             case '/j':
@@ -536,7 +537,9 @@ kiwi.front = {
                 // Rejoin channels
                 channels = '';
                 $.each(kiwi.front.tabviews, function (i, tabview) {
-                    if (tabview.name == 'server') return;
+                    if (tabview.name === 'server') {
+                        return;
+                    }
                     channels += tabview.name + ',';
                 });
                 console.log('Rejoining: ' + channels);
@@ -575,7 +578,9 @@ kiwi.front = {
         var err_box, f, msg;
 
         err_box = $('.messages .msg.error.disconnect .text');
-        if (!err_box) return;
+        if (!err_box) {
+            return;
+        }
 
         f = function (num) {
             switch (num) {
@@ -586,7 +591,7 @@ kiwi.front = {
             case 5: return 'Fifth';
             case 6: return 'Sixth';
             case 7: return 'Seventh';
-            default: return 'Next'
+            default: return 'Next';
             }
         };
 
index f181fcb582b8891388985fd70f2475788f6561ae..65782f5783bc60ab5ee148caf4c81509952919fe 100644 (file)
@@ -25,8 +25,7 @@ kiwi.gateway = {
                 'try multiple transports': true,
                 'connect timeout': 3000,
                 'max reconnection attempts': 7,
-                'reconnection delay': 2000,
-
+                'reconnection delay': 2000
             });
             kiwi.gateway.socket.on('connect_failed', function (reason) {
                 // TODO: When does this even actually get fired? I can't find a case! ~Darren
index 1a3e4bcbfc43405f800a616c6ff5c3e1c9bf1044..e7c07c296370e64b114b0a2da2ddeaf9a846a020 100644 (file)
@@ -40,19 +40,22 @@ function randomString(string_length) {
     return randomstring;
 }
 
-String.prototype.trim = function () {
-    return this.replace(/^\s+|\s+$/g, "");
-};
-
-String.prototype.lpad = function (length, character) {
-    var padding = "",
-        i;
-    for (i = 0; i < length; i++) {
-        padding += character;
-    }
-    return (padding + this).slice(-length);
-};
+if (typeof String.prototype.trim === 'undefined') {
+    String.prototype.trim = function () {
+        return this.replace(/^\s+|\s+$/g, "");
+    };
+}
 
+if (typeof String.prototype.lpad === 'undefined') {
+    String.prototype.lpad = function (length, character) {
+        var padding = "",
+            i;
+        for (i = 0; i < length; i++) {
+            padding += character;
+        }
+        return (padding + this).slice(-length);
+    };
+}
 
 
 /*
index 0bf378181dc85e8afcb7aa3b876fe53f1244b14e..cf024c008ed0f9b3d42ccca78e0db751c5f4efd7 100644 (file)
@@ -602,6 +602,7 @@ this.httpHandler = function (request, response) {
                     response.statusCode = 304;
                 } else {
                     response.setHeader('Etag', kiwi.cache.html[hash].hash);
+                    response.setHeader('Content-type', 'text/html');
                     response.write(kiwi.cache.html[hash].html);
                 }
                 response.end();
@@ -616,6 +617,7 @@ this.httpHandler = function (request, response) {
                             response.statusCode = 304;
                         } else {
                             response.setHeader('Etag', hash2);
+                            response.setHeader('Content-type', 'text/html');
                             response.write(html);
                         }
                     } else {
index e7eb904f3e12a078ca30af5a8c906e261a0eda62..49b597f35bd67ebb6ee9ec1ab607dda5dcf1b211 100644 (file)
@@ -1,5 +1,5 @@
 !!! 5
-html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb")
+html(lang="en-gb")
     head
 
         meta(http-equiv="Content-Type", content="text/html; charset=utf-8")
@@ -197,4 +197,4 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb")
             |        <input type="hidden" class="userbox_nick" value="${nick}" />
             |        <a class="userbox_query">Message</a>
             |        <a class="userbox_whois">Info</a>
-            |    </div>
\ No newline at end of file
+            |    </div>