|
@@ -729,6 +729,7 @@
|
|
|
|
|
|
events: {
|
|
|
'click .close-chatbox-button': 'closeChat',
|
|
|
+ 'click .toggle-chatbox-button': 'toggleChat',
|
|
|
'keypress textarea.chat-textarea': 'keyPressed',
|
|
|
'click .toggle-smiley': 'toggleEmoticonMenu',
|
|
|
'click .toggle-smiley ul li': 'insertEmoticon',
|
|
@@ -1116,6 +1117,32 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ saveToggleState: function () {
|
|
|
+ var flyout = this.$el.find('.box-flyout');
|
|
|
+ if (flyout.hasClass('minimized')) {
|
|
|
+ flyout.removeClass('minimized');
|
|
|
+ this.model.save({'minimized': false});
|
|
|
+ } else {
|
|
|
+ flyout.addClass('minimized');
|
|
|
+ this.model.save({'minimized': true});
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ swapToggleIcon: function ($el) {
|
|
|
+ if ($el.hasClass('icon-minus')) {
|
|
|
+ $el.removeClass('icon-minus').addClass('icon-plus');
|
|
|
+ } else {
|
|
|
+ $el.removeClass('icon-plus').addClass('icon-minus');
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ toggleChat: function (ev) {
|
|
|
+ this.saveToggleState();
|
|
|
+ this.$el.find('form.sendXMPPMessage').toggle();
|
|
|
+ this.$el.find('div.chat-content').slideToggle('fast');
|
|
|
+ this.swapToggleIcon($(ev.target));
|
|
|
+ },
|
|
|
+
|
|
|
updateVCard: function () {
|
|
|
var jid = this.model.get('jid'),
|
|
|
rosteritem = converse.roster.get(jid);
|
|
@@ -1692,14 +1719,21 @@
|
|
|
tagName: 'div',
|
|
|
className: 'chatroom',
|
|
|
events: {
|
|
|
- 'click a.close-chatbox-button': 'closeChat',
|
|
|
- 'click a.configure-chatroom-button': 'configureChatRoom',
|
|
|
+ 'click .close-chatbox-button': 'closeChat',
|
|
|
+ 'click .toggle-chatbox-button': 'toggleChat',
|
|
|
+ 'click .configure-chatroom-button': 'configureChatRoom',
|
|
|
'click .toggle-smiley': 'toggleEmoticonMenu',
|
|
|
'click .toggle-smiley ul li': 'insertEmoticon',
|
|
|
'keypress textarea.chat-textarea': 'keyPressed'
|
|
|
},
|
|
|
is_chatroom: true,
|
|
|
|
|
|
+ toggleChat: function (ev) {
|
|
|
+ this.saveToggleState();
|
|
|
+ this.$el.find('div.chat-body').slideToggle('fast');
|
|
|
+ this.swapToggleIcon($(ev.target));
|
|
|
+ },
|
|
|
+
|
|
|
sendChatRoomMessage: function (body) {
|
|
|
var match = body.replace(/^\s*/, "").match(/^\/(.*?)(?: (.*))?$/) || [false],
|
|
|
$chat_content;
|