Rename div#online-users-container to div#controlbox

This commit is contained in:
JC Brand 2012-09-19 05:55:24 +02:00
parent f8ebdb2303
commit 85b27f07be

View File

@ -548,13 +548,13 @@ xmppchat.SettingsPanel = Backbone.View.extend({
xmppchat.ControlBox = xmppchat.ChatBox.extend({ xmppchat.ControlBox = xmppchat.ChatBox.extend({
initialize: function () { initialize: function () {
this.set({ this.set({
'box_id' : 'online-users-container' 'box_id' : 'controlbox'
}); });
} }
}); });
xmppchat.ControlBoxView = xmppchat.ChatBoxView.extend({ xmppchat.ControlBoxView = xmppchat.ChatBoxView.extend({
el: '#online-users-container', el: '#controlbox',
events: { events: {
'click a.close-controlbox-button': 'closeChat' 'click a.close-controlbox-button': 'closeChat'
}, },
@ -686,7 +686,7 @@ xmppchat.ChatRoomView = xmppchat.ChatBoxView.extend({
}, },
onLeave: function () { onLeave: function () {
var controlboxview = xmppchat.chatboxesview.views['online-users-container']; var controlboxview = xmppchat.chatboxesview.views['controlbox'];
if (controlboxview) { if (controlboxview) {
controlboxview.roomspanel.trigger('update-rooms-list'); controlboxview.roomspanel.trigger('update-rooms-list');
} }
@ -757,7 +757,7 @@ xmppchat.ChatRoomView = xmppchat.ChatBoxView.extend({
}, },
onRoster: function (roster, room) { onRoster: function (roster, room) {
var controlboxview = xmppchat.chatboxesview.views['online-users-container']; var controlboxview = xmppchat.chatboxesview.views['controlbox'];
if (controlboxview) { if (controlboxview) {
controlboxview.roomspanel.trigger('update-rooms-list'); controlboxview.roomspanel.trigger('update-rooms-list');
} }
@ -797,11 +797,11 @@ xmppchat.ChatBoxesView = Backbone.View.extend({
jQuery.cookie('chats-open-'+xmppchat.username, null, {path: '/'}); jQuery.cookie('chats-open-'+xmppchat.username, null, {path: '/'});
if (cookie) { if (cookie) {
open_chats = cookie.split('|'); open_chats = cookie.split('|');
if (_.indexOf(open_chats, 'online-users-container') != -1) { if (_.indexOf(open_chats, 'controlbox') != -1) {
this.renderChat('online-users-container'); this.renderChat('controlbox');
} }
_.each(open_chats, $.proxy(function (jid) { _.each(open_chats, $.proxy(function (jid) {
if (jid != 'online-users-container') { if (jid != 'controlbox') {
if (_.str.include(jid, xmppchat.connection.muc_domain)) { if (_.str.include(jid, xmppchat.connection.muc_domain)) {
this.renderChat(jid); this.renderChat(jid);
} else { } else {
@ -823,7 +823,7 @@ xmppchat.ChatBoxesView = Backbone.View.extend({
renderChat: function (jid, name) { renderChat: function (jid, name) {
var box, view; var box, view;
if (jid === 'online-users-container') { if (jid === 'controlbox') {
box = new xmppchat.ControlBox({'id': jid, 'jid': jid}); box = new xmppchat.ControlBox({'id': jid, 'jid': jid});
view = new xmppchat.ControlBoxView({ view = new xmppchat.ControlBoxView({
model: box model: box
@ -868,7 +868,7 @@ xmppchat.ChatBoxesView = Backbone.View.extend({
view.focus(); view.focus();
} else { } else {
view.show(); view.show();
if (jid !== 'online-users-container') { if (jid !== 'controlbox') {
view.scrolldown(); view.scrolldown();
view.focus(); view.focus();
} }
@ -952,7 +952,7 @@ xmppchat.RosterItemView = Backbone.View.extend({
position: { position: {
my: 'center', my: 'center',
at: 'center', at: 'center',
of: '#online-users-container' of: '#controlbox'
}, },
modal: true, modal: true,
buttons: { buttons: {
@ -1021,7 +1021,7 @@ xmppchat.RosterItemView = Backbone.View.extend({
ev.preventDefault(); ev.preventDefault();
that.declineRequest(); that.declineRequest();
}); });
xmppchat.chatboxesview.openChat('online-users-container'); xmppchat.chatboxesview.openChat('controlbox');
} else if (subscription === 'both') { } else if (subscription === 'both') {
this.$el.addClass('current-xmpp-contact'); this.$el.addClass('current-xmpp-contact');
this.$el.html(this.template(item.toJSON())); this.$el.html(this.template(item.toJSON()));
@ -1498,10 +1498,10 @@ $(document).ready($.proxy(function () {
// Controlbox toggler // Controlbox toggler
$toggle.bind('click', $.proxy(function (e) { $toggle.bind('click', $.proxy(function (e) {
e.preventDefault(); e.preventDefault();
if ($("div#online-users-container").is(':visible')) { if ($("div#controlbox").is(':visible')) {
this.chatboxesview.closeChat('online-users-container'); this.chatboxesview.closeChat('controlbox');
} else { } else {
this.chatboxesview.openChat('online-users-container'); this.chatboxesview.openChat('controlbox');
} }
}, this)); }, this));
}, this)); }, this));