// 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':
// 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.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();
response.statusCode = 304;
} else {
response.setHeader('Etag', hash2);
+ response.setHeader('Content-type', 'text/html');
response.write(html);
}
} else {
!!! 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")
| <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>