onNick: function (e, data) {\r
if (data.nick === kiwi.gateway.nick) {\r
kiwi.gateway.nick = data.newnick;\r
- kiwi.front.doLayout();\r
+ kiwi.front.ui.doLayout();\r
}\r
\r
_.each(Tabview.getAllTabs(), function (tab) {\r
}\r
\r
kiwi.front.doLayout();\r
- },\r
+ }\r
\r
\r
-}
\ No newline at end of file
+};
\ No newline at end of file
utilityviews: {},
boxes: {},
- buffer: [],
- buffer_pos: 0,
+ buffer: [], // Command history
+ buffer_pos: 0, // Current command history position
- cache: {},
-
- original_topic: '',
+ // Container for misc data (eg. userlist generation)
+ cache: {original_topic: '', userlist: {}},
init: function () {
/*global Box, touch_scroll:true, Tabview */
// Bind to the gateway events
kiwi.front.events.bindAll();
- this.buffer = [];
-
// Build the about box
kiwi.front.boxes.about = new Box("about");
about_info = 'UI adapted for ' + agent;
kiwi.front.ui.registerKeys();
+ window.onbeforeunload = function() {
+ return "Are you sure you leave Kiwi IRC?";
+ }
+
$('#kiwi .toolbars').resize(kiwi.front.ui.doLayoutSize);
$(window).resize(kiwi.front.ui.doLayoutSize);
} else if (e.which === 27) {
// escape
e.preventDefault();
- $(this).text(kiwi.front.original_topic);
+ $(this).text(kiwi.front.cache.original_topic);
$('#kiwi_msginput').focus();
}
});
} else if (e.keyCode === 27) {
// escape
e.preventDefault();
- $(this).text(kiwi.front.original_topic);
+ $(this).text(kiwi.front.cache.original_topic);
}
});*/
$('.cur_topic').live('change', function () {
var chan, text;
text = $(this).text();
- if (text !== kiwi.front.original_topic) {
+ if (text !== kiwi.front.cache.original_topic) {
chan = Tabview.getCurrentTab().name;
kiwi.gateway.setTopic(chan, text);
}
default:
//Tabview.getCurrentTab().addMsg(null, ' ', '--> Invalid command: '+parts[0].substring(1));
kiwi.gateway.raw(msg.substring(1));
+ break;
}
} else {
\r
\r
setTopicText: function (new_topic) {\r
- kiwi.front.original_topic = new_topic;\r
+ kiwi.front.cache.original_topic = new_topic;\r
$('#kiwi .cur_topic .topic').text(new_topic);\r
kiwi.front.ui.doLayoutSize();\r
},\r
barsHide: function () {\r
$('#kiwi .toolbars').slideUp();\r
$('#kiwi .control').slideUp();\r
- },\r
+ }\r
\r
-}
\ No newline at end of file
+};
\ No newline at end of file