// 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);
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) {
case 5: return 'Fifth';
case 6: return 'Sixth';
case 7: return 'Seventh';
- default: return 'Next'
+ default: return 'Next';
}
};
'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
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);
+ };
+}
/*
response.setHeader('X-Generated-By', 'KiwiIRC');
hash = crypto.createHash('md5').update(touchscreen ? 't' : 'f')
- .update(debug ? 't' : 'f')
- .update(server_set ? 't' : 'f')
- .update(server)
- .update(nick)
- .update(agent)
- .update(JSON.stringify(kiwi.config))
- .digest('base64');
+ .update(debug ? 't' : 'f')
+ .update(server_set ? 't' : 'f')
+ .update(server)
+ .update(nick)
+ .update(agent)
+ .update(JSON.stringify(kiwi.config))
+ .digest('base64');
if (kiwi.cache.html[hash]) {
if (request.headers['if-none-match'] === kiwi.cache.html[hash].hash) {
response.statusCode = 304;