Commit 2669a179 authored by JC Brand's avatar JC Brand

Add a controlbox model and view and fixed ordering of chatboxes.

parent 56d6c39d
This diff is collapsed.
...@@ -368,25 +368,6 @@ xmppchat.UI = (function (xmppUI, $, console) { ...@@ -368,25 +368,6 @@ xmppchat.UI = (function (xmppUI, $, console) {
}); });
}; };
ob.restoreOpenChats = function () {
/* Check the open-chats cookie and re-open all the chatboxes it mentions.
* We need to wait for current chatbox creation to finish before we create the
* next, so we use a task buffer to make sure the next task is only
* executed after the previous is done.
*/
var cookie = jQuery.cookie('chats-open-'+xmppchat.username),
open_chats = [];
jQuery.cookie('chats-open-'+xmppchat.username, null, {path: '/'});
if (cookie) {
open_chats = cookie.split('|');
// FIXME: Change this so that the online contacts box is always created first.
for (var i=0; i<open_chats.length; i++) {
xmppchat.Taskbuffer.tasks.push({'that': this, 'method':this.getChatbox, 'parameters':[open_chats[i]]});
}
xmppchat.Taskbuffer.handleTasks();
}
};
ob.keyPressed = function (ev, textarea) { ob.keyPressed = function (ev, textarea) {
var $textarea = jQuery(textarea), var $textarea = jQuery(textarea),
...@@ -482,24 +463,8 @@ xmppchat.UI = (function (xmppUI, $, console) { ...@@ -482,24 +463,8 @@ xmppchat.UI = (function (xmppUI, $, console) {
// Event handlers // Event handlers
// -------------- // --------------
$(document).ready(function () { $(document).ready(function () {
var chatdata = jQuery('span#babble-client-chatdata'),
$toggle = $('a#toggle-online-users');
xmppchat.username = chatdata.attr('username');
xmppchat.base_url = chatdata.attr('base_url');
xmppchat.UI.createStatusSelectWidget(); xmppchat.UI.createStatusSelectWidget();
$toggle.unbind('click');
$toggle.bind('click', function (e) {
e.preventDefault();
if ($("div#online-users-container").is(':visible')) {
xmppchat.UI.closeChat('online-users-container');
} else {
xmppchat.UI.getChatbox('online-users-container');
}
});
$(document).unbind('jarnxmpp.message'); $(document).unbind('jarnxmpp.message');
$(document).bind('jarnxmpp.message', function (event) { $(document).bind('jarnxmpp.message', function (event) {
xmppchat.UI.addMessageToChatbox(event); xmppchat.UI.addMessageToChatbox(event);
...@@ -518,10 +483,6 @@ $(document).ready(function () { ...@@ -518,10 +483,6 @@ $(document).ready(function () {
xmppchat.UI.keyPressed(ev, this); xmppchat.UI.keyPressed(ev, this);
}); });
$('a.close-controlbox-button').live('click', function (ev) {
xmppchat.UI.closeChat('online-users-container');
});
$('ul.tabs').tabs('div.panes > div'); $('ul.tabs').tabs('div.panes > div');
$('#fancy-xmpp-status-select').click(function (ev) { $('#fancy-xmpp-status-select').click(function (ev) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment