social_stream-presence 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,7 +23,7 @@ function initSound(sound){
23
23
  var html5audio=document.createElement('audio')
24
24
 
25
25
  if (html5audio.canPlayType){
26
- path = 'assets/chat/' + sound;
26
+ path = '/assets/chat/' + sound;
27
27
  window[sound] = new Audio();
28
28
 
29
29
  for(i=0; i<html5_audiotypes.length; i++){
@@ -183,6 +183,7 @@ function updateChatWindow(){
183
183
  setStatusWidgetTitle(userStatus);
184
184
  $(".user_presence a[title]").tooltip();
185
185
  setUserFunctions();
186
+ updateConnectedUsersOfMainChatBox();
186
187
  if (afterNewConnectionFlag){
187
188
  afterNewConnectionFlag = false;
188
189
  restoreChatData();
@@ -230,7 +231,7 @@ function getAllConnectedSlugs(){
230
231
  connectedSlugs=[];
231
232
  connectionBoxes = $('div.user_presence[slug]');
232
233
  $.each(connectionBoxes, function(index, value) {
233
- if($(value).is(":visible")){
234
+ if($(value).css("display")!="none"){
234
235
  connectedSlugs.push($(value).attr("slug"))
235
236
  }
236
237
  });
@@ -321,4 +322,15 @@ function notifyWhenUsersDisconnect(){
321
322
  function hideAllNotifications(){
322
323
  var notification = $("div.ui-chatbox-notify");
323
324
  hideChatNotification(notification);
324
- }
325
+ }
326
+
327
+
328
+
329
+ ////////////////////
330
+ //Update connected users of MainChatBox
331
+ ////////////////////
332
+
333
+ function updateConnectedUsersOfMainChatBox(){
334
+ var connectedUsers = getAllConnectedSlugs().length;
335
+ changeMainChatBoxHeaderTitle( '<%=I18n.t('chat.title')%>' + " (" + connectedUsers + ")");
336
+ }
@@ -143,7 +143,7 @@ function splitFirst(word,key){
143
143
  function buildIconImage(icon){
144
144
  if (icon in chatIcons){
145
145
  image_file = chatIcons[icon]
146
- return "<img class=\"chatEmoticon\" src=\"assets/emoticons/" + image_file + "\"/>";
146
+ return "<img class=\"chatEmoticon\" src=\"/assets/emoticons/" + image_file + "\"/>";
147
147
  }
148
148
  return icon
149
149
  }
@@ -250,6 +250,8 @@ function createMainChatBox(){
250
250
  $("#chat_partial").css("margin-left",-3)
251
251
  $(".dropdown dd ul").css("min-width",147)
252
252
 
253
+ //Header title
254
+ updateConnectedUsersOfMainChatBox();
253
255
  }
254
256
  }
255
257
  }
@@ -270,3 +272,7 @@ function modifyChatPartialIfMainBox(chatPartial){
270
272
 
271
273
  return chatPartial;
272
274
  }
275
+
276
+ function changeMainChatBoxHeaderTitle(title){
277
+ $($(mainChatBox.parent().parent()).find(".ui-chatbox-titlebar").find("span")[0]).html(title);
278
+ }
@@ -2,7 +2,6 @@
2
2
  //Global constants
3
3
  ////////////////////
4
4
  var domain = '<%=SocialStream::Presence.domain%>';
5
- var sound_path = "/assets/audio/chat/onMessage";
6
5
 
7
6
 
8
7
  ////////////////////
@@ -319,6 +318,7 @@ function processAvailablePresenceStanza(presence){
319
318
  if (cacheConnectedUsers.indexOf(slug) != -1) {
320
319
  showConnectionBoxFromSlug(slug);
321
320
  hideChatNotificationForSlug(slug);
321
+ updateConnectedUsersOfMainChatBox();
322
322
  }
323
323
  } else {
324
324
  setTimeout("refreshChatWindow()", 3000);
@@ -334,6 +334,7 @@ function processUnavailablePresenceStanza(presence){
334
334
  if (getConnectionBoxFromSlug(slug)!=null){
335
335
  hideConnectionBoxFromSlug(slug)
336
336
  showChatNotificationForSlug(slug,$(getConnectionBoxFromSlug(slug)).attr("name") + " is offline");
337
+ updateConnectedUsersOfMainChatBox();
337
338
  }
338
339
  }
339
340
  }
@@ -28,6 +28,8 @@
28
28
  .ui-chatbox-titlebar {
29
29
  padding: 3px 3px 3px 3px;
30
30
  height: 20px;
31
+ background-color: $secondary-color;
32
+ color: $main-color;
31
33
  }
32
34
 
33
35
  .ui-chatbox-content {
@@ -53,6 +55,7 @@
53
55
  margin: 5px 5px 5px 5px;
54
56
  border: 1px solid $separation-color;
55
57
  height: 35px;
58
+ color: $main-color;
56
59
  }
57
60
 
58
61
 
@@ -12,10 +12,10 @@
12
12
  <dt><a href=""><span><%=t('chat.status.choose')%></span></a></dt>
13
13
  <dd>
14
14
  <ul id="statusList">
15
- <li><a id="available" href="#" class="option"><img class="flag" src="assets/status/available.png" alt=""/> <%=t('chat.status.available')%> <span class="value">available</span></a></li>
16
- <li><a id="away" href="#" class="option"><img class="flag" src="assets/status/away.png" alt=""/> <%=t('chat.status.away')%> <span class="value">away</span></a></li>
17
- <li><a id="dnd" href="#" class="option"><img class="flag" src="assets/status/dnd.png" alt=""/> <%=t('chat.status.dnd')%> <span class="value">dnd</span></a></li>
18
- <li><a id="offline" href="#" class="option"><img class="flag" src="assets/status/offline.png" alt=""/> <%=t('chat.status.offline')%> <span class="value">offline</span></a></li>
15
+ <li><a id="available" href="#" class="option"><img class="flag" src="/assets/status/available.png" alt=""/> <%=t('chat.status.available')%> <span class="value">available</span></a></li>
16
+ <li><a id="away" href="#" class="option"><img class="flag" src="/assets/status/away.png" alt=""/> <%=t('chat.status.away')%> <span class="value">away</span></a></li>
17
+ <li><a id="dnd" href="#" class="option"><img class="flag" src="/assets/status/dnd.png" alt=""/> <%=t('chat.status.dnd')%> <span class="value">dnd</span></a></li>
18
+ <li><a id="offline" href="#" class="option"><img class="flag" src="/assets/status/offline.png" alt=""/> <%=t('chat.status.offline')%> <span class="value">offline</span></a></li>
19
19
  </ul>
20
20
  </dd>
21
21
  </div>
@@ -1,5 +1,5 @@
1
1
  module Socialstream
2
2
  module Presence
3
- VERSION = "0.6.0"
3
+ VERSION = "0.6.1"
4
4
  end
5
5
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  # Gem dependencies
22
- s.add_runtime_dependency('social_stream-base', '~> 0.15.0')
22
+ s.add_runtime_dependency('social_stream-base', '~> 0.15.1')
23
23
 
24
24
  s.add_runtime_dependency "xmpp4r"
25
25
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_stream-presence
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,18 +13,18 @@ date: 2012-02-06 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: social_stream-base
16
- requirement: &79169370 !ruby/object:Gem::Requirement
16
+ requirement: &80060050 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.15.0
21
+ version: 0.15.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *79169370
24
+ version_requirements: *80060050
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: xmpp4r
27
- requirement: &79169160 !ruby/object:Gem::Requirement
27
+ requirement: &80059820 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *79169160
35
+ version_requirements: *80059820
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: net-ssh
38
- requirement: &79168920 !ruby/object:Gem::Requirement
38
+ requirement: &80059590 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *79168920
46
+ version_requirements: *80059590
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: net-sftp
49
- requirement: &79168690 !ruby/object:Gem::Requirement
49
+ requirement: &80059370 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *79168690
57
+ version_requirements: *80059370
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: ruby-debug19
60
- requirement: &79168470 !ruby/object:Gem::Requirement
60
+ requirement: &80059160 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *79168470
68
+ version_requirements: *80059160
69
69
  description: Social Stream is a Ruby on Rails engine providing your application with
70
70
  social networking features and activity streams.
71
71
  email: