onTopicSetBy: function (e, data) {\r
var when, tab = Tabview.getTab(data.channel);\r
if (tab) {\r
- when = new Date(data.when*1000).toLocaleString();\r
+ when = new Date(data.when * 1000).toLocaleString();\r
tab.addMsg(null, '', 'Topic set by ' + data.nick + ' at ' + when, 'topic');\r
}\r
},\r
} else {\r
msg = f(data.attempts) + ' attempt at reconnecting in ' + secs + ' second' + (((secs > 1) || (secs === 0)) ? 's' : '') + '...';\r
}\r
- \r
+\r
err_box.text(msg);\r
},\r
/**\r
* Sort the window list
*/
sortWindowList: function () {
- var win_list = $('#kiwi .windowlist ul');
- var listitems = win_list.children('li').get();
+ var win_list = $('#kiwi .windowlist ul'),
+ listitems = win_list.children('li').get();
listitems.sort(function (a, b) {
- if (a == Tabview.getServerTab().tab[0]) {
+ if (a === Tabview.getServerTab().tab[0]) {
return -1;
}
- if (b == Tabview.getServerTab().tab[0]) {
+ if (b === Tabview.getServerTab().tab[0]) {
return 1;
}
- var compA = $(a).text().toUpperCase();
- var compB = $(b).text().toUpperCase();
+ var compA = $(a).text().toUpperCase(),
+ compB = $(b).text().toUpperCase();
return (compA < compB) ? -1 : (compA > compB) ? 1 : 0;
- })
+ });
$.each(listitems, function(idx, itm) {
win_list.append(itm);
var tab;
// Make sure we actually have a name
- if (typeof name !== 'string') return null;
+ if (typeof name !== 'string') {
+ return null;
+ }
// Go through each tabview and pick out the matching one
$.each(kiwi.front.tabviews, function (i, item) {
- if (item.name.toLowerCase() == name.toLowerCase()) {
+ if (item.name.toLowerCase() === name.toLowerCase()) {
tab = item;
return false;
}
var windows, meta, num, msg, data, self;\r
windows = $('#windows');\r
\r
- if (navigator.appVersion.indexOf("Mac") != -1) {\r
+ if (navigator.appVersion.indexOf("Mac") !== -1) {\r
meta = e.ctrlKey;\r
} else {\r
meta = e.altKey;\r
preventRefresh: function () {\r
$(document).keydown(function (e) {\r
// meta + r || F5\r
- if ((e.metaKey && e.which == 82) || e.which == 116) {\r
+ if ((e.metaKey && e.which === 82) || e.which === 116) {\r
e.preventDefault();\r
e.stopPropagation();\r
\r
s,\r
current_s,\r
next_s;\r
- b.css({display: 'block', position: 'absolute', height:'100%', width:'100%'});\r
+ b.css({display: 'block', position: 'absolute', height: '100%', width: '100%'});\r
$('#kiwi').append(b);\r
\r
/**\r
var b = 3, ret = {};\r
ret.top = el.offset().top;\r
ret.left = el.offset().left;\r
- ret.width = parseInt(el.outerWidth(true), 10) - (b*2);\r
- ret.height = parseInt(el.outerHeight(true), 10) - (b*2);\r
+ ret.width = parseInt(el.outerWidth(true), 10) - (b * 2);\r
+ ret.height = parseInt(el.outerHeight(true), 10) - (b * 2);\r
return ret;\r
};\r
\r
s = [\r
- function(){\r
+ function () {\r
b.animate(bounds($('#kiwi .msginput')), 2000, '', next_s);\r
},\r
\r
- function(){\r
+ function () {\r
b.animate(bounds($('#kiwi .userlist')), 2000, '', next_s);\r
},\r
\r
- function(){\r
+ function () {\r
b.animate(bounds($('#panel1')), 2000, '', next_s);\r
},\r
\r
- function(){\r
+ function () {\r
b.animate(bounds($('#kiwi .cur_topic')), 2000, '', next_s);\r
},\r
\r
- function(){\r
+ function () {\r
b.animate(bounds($('#kiwi .windowlist')), 2000, '', next_s);\r
}\r
];\r
request: request,
type: type,
target: target,
- params: params,
+ params: params
}
};
-
+
kiwi.gateway.sendData(data, callback);
},
* @param {Function} callback A callback function
*/
raw: function (data, callback) {
- var data = {
+ data = {
method: 'raw',
args: {
data: data
* @param {Function} callback A callback function
*/
kiwi: function (target, data, callback) {
- var data = {
+ data = {
method: 'kiwi',
args: {
target: target,
data: data
}
};
-
+
kiwi.gateway.sendData(data, callback);
- },
+ }
};