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