Commit 46ac0b542334310eafbb92c55c6bc29c24458a60
1 parent
c6c0ced9
Exists in
master
and in
27 other branches
Adding new div buddies
Showing
2 changed files
with
13 additions
and
10 deletions
Show diff stats
app/views/shared/logged_in/xmpp_chat.html.erb
| ... | ... | @@ -28,8 +28,10 @@ |
| 28 | 28 | <div class='body'> |
| 29 | 29 | <%= text_field_tag(:query, '', :placeholder => _('Search...'), :class => 'search') %> |
| 30 | 30 | |
| 31 | - <ul class='buddies online'></ul> | |
| 32 | - <ul class='buddies offline'></ul> | |
| 31 | + <div class='buddies'> | |
| 32 | + <ul class='online'></ul> | |
| 33 | + <ul class='offline'></ul> | |
| 34 | + </div> | |
| 33 | 35 | </div> |
| 34 | 36 | </div> |
| 35 | 37 | |
| ... | ... | @@ -46,7 +48,7 @@ |
| 46 | 48 | <img class="avatar"> |
| 47 | 49 | <span class="other-name"></span> |
| 48 | 50 | </span> |
| 49 | - <a href="#" class="back"><%= _('Back') %></a> | |
| 51 | + <a href="" class="back"><%= _('Back') %></a> | |
| 50 | 52 | </div> |
| 51 | 53 | <div class='history'></div> |
| 52 | 54 | <div class='input-div'> | ... | ... |
public/javascripts/chat.js
| ... | ... | @@ -65,7 +65,7 @@ jQuery(function($) { |
| 65 | 65 | }, |
| 66 | 66 | insert_or_update_group: function (jid, presence) { |
| 67 | 67 | var jid_id = Jabber.jid_to_id(jid); |
| 68 | - var list = $('#buddy-list .buddies.online'); | |
| 68 | + var list = $('#buddy-list .buddies .online'); | |
| 69 | 69 | var item = $('#' + jid_id); |
| 70 | 70 | presence = presence || ($(item).length > 0 ? $(item).parent('li').attr('class') : 'offline'); |
| 71 | 71 | log('adding or updating contact ' + jid + ' as ' + presence); |
| ... | ... | @@ -78,7 +78,7 @@ jQuery(function($) { |
| 78 | 78 | var jid_id = Jabber.jid_to_id(jid); |
| 79 | 79 | var item = $('#' + jid_id); |
| 80 | 80 | presence = presence || ($(item).length > 0 ? $(item).parent('li').attr('class') : 'offline'); |
| 81 | - var list = $('#buddy-list .buddies' + (presence=='offline' ? '.offline' : '.online')); | |
| 81 | + var list = $('#buddy-list .buddies ' + (presence=='offline' ? '.offline' : '.online')); | |
| 82 | 82 | |
| 83 | 83 | log('adding or updating contact ' + jid + ' as ' + presence); |
| 84 | 84 | Jabber.insert_or_update_user(list, item, jid, name, presence, Jabber.template('.buddy-item'), 'chat'); |
| ... | ... | @@ -528,7 +528,7 @@ jQuery(function($) { |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | // open new conversation or change to already opened tab |
| 531 | - $('#buddy-list .buddy-list li a').live('click', function() { | |
| 531 | + $('#buddy-list .buddies li a').live('click', function() { | |
| 532 | 532 | var jid_id = $(this).attr('id'); |
| 533 | 533 | var name = Jabber.name_of(jid_id); |
| 534 | 534 | var conversation = create_conversation_tab(name, jid_id); |
| ... | ... | @@ -627,7 +627,7 @@ jQuery(function($) { |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | function count_unread_messages(jid_id, hide) { |
| 630 | - var unread = $('.buddy-list #'+jid_id+ ' .unread-messages'); | |
| 630 | + var unread = $('.buddies #'+jid_id+ ' .unread-messages'); | |
| 631 | 631 | if (hide) { |
| 632 | 632 | unread.hide(); |
| 633 | 633 | Jabber.unread_messages_of(jid_id, 0); |
| ... | ... | @@ -645,7 +645,7 @@ jQuery(function($) { |
| 645 | 645 | function update_total_unread_messages() { |
| 646 | 646 | var total_unread = $('#openchat .unread-messages'); |
| 647 | 647 | var sum = 0; |
| 648 | - $('.buddy-list .unread-messages').each(function() { | |
| 648 | + $('.buddies .unread-messages').each(function() { | |
| 649 | 649 | sum += Number($(this).text()); |
| 650 | 650 | }); |
| 651 | 651 | if(sum>0) { |
| ... | ... | @@ -713,7 +713,7 @@ jQuery(function($) { |
| 713 | 713 | } |
| 714 | 714 | |
| 715 | 715 | $('.title-bar a').click(function() { |
| 716 | - $(this).parents('.status-group').find('.buddy-list').toggle('fast'); | |
| 716 | + $(this).parents('.status-group').find('.buddies').toggle('fast'); | |
| 717 | 717 | }); |
| 718 | 718 | $('#chat').on('click', '.occupants a', function() { |
| 719 | 719 | $(this).siblings('.occupant-list').toggle('fast'); |
| ... | ... | @@ -726,7 +726,8 @@ jQuery(function($) { |
| 726 | 726 | } else if($presence == 'dnd') { |
| 727 | 727 | $('#chat-busy').trigger('click'); |
| 728 | 728 | } |
| 729 | - $('#chat #buddy-list').perfectScrollbar(); | |
| 729 | + | |
| 730 | + $('#chat #buddy-list .buddies').perfectScrollbar(); | |
| 730 | 731 | |
| 731 | 732 | // custom css expression for a case-insensitive contains() |
| 732 | 733 | jQuery.expr[':'].Contains = function(a,i,m){ | ... | ... |