social_stream-presence 0.1.7 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/assets/javascripts/chat_interface_manager.js.erb +2 -1
- data/app/assets/javascripts/chat_parser.js +14 -0
- data/app/assets/javascripts/chat_window_manager.js +70 -22
- data/app/assets/javascripts/xmpp_client_management.js.erb +2 -2
- data/app/assets/stylesheets/{chat.css → chat.css.scss} +69 -48
- data/ejabberd/ejabberd_files.zip +0 -0
- data/ejabberd/ejabberd_scripts/emanagement +4 -4
- data/ejabberd/mod_sspresence/mod_sspresence.beam +0 -0
- data/lib/social_stream/presence/models/buddy_manager.rb +5 -4
- data/lib/social_stream/presence/version.rb +1 -1
- data/lib/social_stream/presence/xmpp_server_order.rb +2 -1
- data/vendor/assets/javascripts/jquery.ui.chatbox.js +72 -18
- metadata +5 -25
@@ -278,9 +278,10 @@ function putReceivedMessageOnChatWindow(from_jid,from_slug,body,msgID){
|
|
278
278
|
|
279
279
|
//Parse content before show it.
|
280
280
|
var content = getParsedContent(Strophe.getText(body), false)
|
281
|
+
var headerMessage = getParsedName(from_name,false);
|
281
282
|
|
282
283
|
//Show message to chatBox.
|
283
|
-
$("#" + from_slug).chatbox("option", "boxManager").addMsg(
|
284
|
+
$("#" + from_slug).chatbox("option", "boxManager").addMsg(headerMessage, content);
|
284
285
|
|
285
286
|
//Rotate chatBoxes priority.
|
286
287
|
rotatePriority(from_slug);
|
@@ -241,3 +241,17 @@ function getUrlType(url){
|
|
241
241
|
return "link"
|
242
242
|
}
|
243
243
|
}
|
244
|
+
|
245
|
+
|
246
|
+
///////////////////////////////////////////////////////
|
247
|
+
// Parsing user titles
|
248
|
+
///////////////////////////////////////////////////////
|
249
|
+
|
250
|
+
function getParsedName(name, fromUser){
|
251
|
+
if (fromUser){
|
252
|
+
var chatTextclass = "ownName"
|
253
|
+
} else {
|
254
|
+
var chatTextclass = "guestName"
|
255
|
+
}
|
256
|
+
return ("<span class=\"" + chatTextclass + "\">" + name + "</span>");
|
257
|
+
}
|
@@ -1,10 +1,12 @@
|
|
1
1
|
////////////////////
|
2
|
-
//Chat functions
|
2
|
+
//Chat Window Manager functions
|
3
3
|
////////////////////
|
4
4
|
|
5
5
|
var nBox = 0;
|
6
6
|
var maxBox = 5;
|
7
7
|
var chatBoxWidth = 230;
|
8
|
+
var chatBoxHeight = 170;
|
9
|
+
var videoBoxHeight = 150;
|
8
10
|
var visibleChatBoxes = new Array();
|
9
11
|
var chatBoxSeparation = chatBoxWidth+12;
|
10
12
|
|
@@ -19,8 +21,6 @@ function createChatBox(guest_slug,guest_name,guest_jid,user_name,user_jid){
|
|
19
21
|
|
20
22
|
//Add div with id = guest_slug
|
21
23
|
$("#chat_divs").append("<div id=" + guest_slug + " name=" + guest_name + "></div>")
|
22
|
-
|
23
|
-
//Add CSS [...]
|
24
24
|
|
25
25
|
|
26
26
|
//Offset Management for new box
|
@@ -34,6 +34,8 @@ function createChatBox(guest_slug,guest_name,guest_jid,user_name,user_jid){
|
|
34
34
|
hidden: false,
|
35
35
|
offset: offset, // relative to right edge of the browser window
|
36
36
|
width: chatBoxWidth, // width of the chatbox
|
37
|
+
height: chatBoxHeight, // height of the chatbox
|
38
|
+
video: 0, //height of the videoBox
|
37
39
|
title : guest_name,
|
38
40
|
position: position,
|
39
41
|
priority: visibleChatBoxes.length+1,
|
@@ -53,7 +55,8 @@ function createChatBox(guest_slug,guest_name,guest_jid,user_name,user_jid){
|
|
53
55
|
|
54
56
|
messageSent : function(id, user, msg) {
|
55
57
|
rotatePriority(guest_slug);
|
56
|
-
|
58
|
+
var headerMessage = getParsedName(id,true);
|
59
|
+
$("#" + guest_slug).chatbox("option", "boxManager").addMsg(headerMessage, getParsedContent(msg,true));
|
57
60
|
sendChatMessage(user_jid,guest_jid,msg);
|
58
61
|
}});
|
59
62
|
|
@@ -102,37 +105,82 @@ function getBoxParams(){
|
|
102
105
|
}
|
103
106
|
|
104
107
|
|
108
|
+
function getChatVariableFromSlug(slug){
|
109
|
+
return "slug_" + slug;
|
110
|
+
}
|
111
|
+
|
112
|
+
|
113
|
+
function getSlugFromChatVariable(variable){
|
114
|
+
return variable.split("_")[1];
|
115
|
+
}
|
116
|
+
|
117
|
+
|
118
|
+
////////////////////
|
119
|
+
//Box replacement
|
120
|
+
////////////////////
|
121
|
+
|
105
122
|
function getBoxIndexToReplace(){
|
106
123
|
|
107
|
-
|
108
|
-
|
124
|
+
tmp = visibleChatBoxes[0];
|
125
|
+
for (i=0;i<visibleChatBoxes.length;i++){
|
109
126
|
if (visibleChatBoxes[i].chatbox("option", "priority") > tmp.chatbox("option", "priority")) {
|
110
|
-
|
111
|
-
|
127
|
+
tmp = visibleChatBoxes[i];
|
128
|
+
}
|
112
129
|
}
|
113
|
-
|
114
|
-
|
130
|
+
|
131
|
+
return visibleChatBoxes.indexOf(tmp);
|
115
132
|
}
|
116
133
|
|
117
134
|
|
118
135
|
function rotatePriority(guest_slug){
|
119
|
-
|
120
|
-
|
121
|
-
|
136
|
+
priority = $("#" + guest_slug).chatbox("option", "priority")
|
137
|
+
if(priority>1){
|
138
|
+
for (i=0;i<visibleChatBoxes.length;i++){
|
122
139
|
if(visibleChatBoxes[i].chatbox("option", "priority")<priority){
|
123
|
-
|
124
|
-
|
125
|
-
}
|
126
|
-
|
127
|
-
|
140
|
+
visibleChatBoxes[i].chatbox("option", "priority",visibleChatBoxes[i].chatbox("option", "priority")+1);
|
141
|
+
}
|
142
|
+
}
|
143
|
+
$("#" + guest_slug).chatbox("option", "priority", 1);
|
144
|
+
}
|
128
145
|
}
|
129
146
|
|
130
147
|
|
131
|
-
|
132
|
-
|
148
|
+
////////////////////
|
149
|
+
//Video Window Manager functions
|
150
|
+
////////////////////
|
151
|
+
|
152
|
+
function getVideoBoxFromSlug(slug){
|
153
|
+
return $("#" + slug).parent().find("div.ui-videobox")
|
133
154
|
}
|
134
155
|
|
156
|
+
function showVideoBox(slug,embed){
|
157
|
+
var chatBox = window[getChatVariableFromSlug(slug)]
|
158
|
+
getVideoBoxFromSlug(slug).html(embed);
|
159
|
+
chatBox.chatbox("option", "video",videoBoxHeight);
|
160
|
+
}
|
135
161
|
|
136
|
-
|
137
|
-
|
162
|
+
|
163
|
+
function hideVideoBox(slug){
|
164
|
+
var chatBox = window[getChatVariableFromSlug(slug)]
|
165
|
+
chatBox.chatbox("option", "video", 0);
|
166
|
+
}
|
167
|
+
|
168
|
+
|
169
|
+
//Function called from JQuery UI Plugin
|
170
|
+
function toogleVideoBox(uiElement){
|
171
|
+
var slug = $(uiElement.element).attr("id");
|
172
|
+
toogleVideoBoxForSlug(slug)
|
173
|
+
}
|
174
|
+
|
175
|
+
function toogleVideoBoxForSlug(slug){
|
176
|
+
var chatBox = window[getChatVariableFromSlug(slug)]
|
177
|
+
if (chatBox.chatbox("option", "video")==0){
|
178
|
+
showVideoBox(slug,getVideoEmbedForSlug(slug))
|
179
|
+
} else {
|
180
|
+
hideVideoBox(slug);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
|
184
|
+
function getVideoEmbedForSlug(slug){
|
185
|
+
return "<img src=\"http://www.batiburrillo.net/wp-content/uploads/2011/03/Freemake.jpg?cda6c1\" width=\"" + (chatBoxWidth-20) + "\"/>"
|
138
186
|
}
|
@@ -91,10 +91,10 @@ function ifCookie(){
|
|
91
91
|
|
92
92
|
//Global variables
|
93
93
|
var userStatus = "chat";
|
94
|
-
var awayTimerPeriod =
|
94
|
+
var awayTimerPeriod = 60000;
|
95
95
|
var timerPeriod = 5000;
|
96
96
|
var refreshMinTime = 3*timerPeriod;
|
97
|
-
var awayTime =
|
97
|
+
var awayTime = 20*60000; //20 minutes
|
98
98
|
var awayCounter = 0;
|
99
99
|
var timerCounter = 0;
|
100
100
|
var connection = null;
|
@@ -1,21 +1,28 @@
|
|
1
|
+
@import "colors";
|
2
|
+
|
3
|
+
|
1
4
|
/* Chatbox style sheet */
|
2
5
|
|
6
|
+
.ui-widget-content{
|
7
|
+
border: none;
|
8
|
+
}
|
9
|
+
|
3
10
|
.ui-chatbox {
|
4
11
|
position: fixed;
|
5
12
|
bottom:0;
|
6
13
|
padding: 2px 2px 2px 2px;
|
7
14
|
padding: 2px 2px 2px 2px;
|
8
|
-
background:
|
15
|
+
background: $separation-color;
|
9
16
|
}
|
10
17
|
|
11
18
|
.ui-state-highlight {
|
12
|
-
background:
|
13
|
-
background-color:
|
14
|
-
border: 1px solid
|
19
|
+
background: $separation-color;
|
20
|
+
background-color: $separation-color;
|
21
|
+
border: 1px solid $separation-color;
|
15
22
|
}
|
16
23
|
|
17
24
|
.chatWindowhighlighted {
|
18
|
-
color:
|
25
|
+
color: $fill-color;
|
19
26
|
}
|
20
27
|
|
21
28
|
.ui-chatbox-titlebar {
|
@@ -33,28 +40,28 @@
|
|
33
40
|
padding: 3px 3px 3px 3px;
|
34
41
|
height: 150px;
|
35
42
|
overflow-y: auto;
|
36
|
-
background:
|
43
|
+
background: $text-over-main;
|
37
44
|
}
|
38
45
|
|
39
46
|
.ui-chatbox-input {
|
40
47
|
padding: 3px 3px 3px 3px;
|
41
|
-
border-top: 1px solid
|
48
|
+
border-top: 1px solid $separation-color;
|
42
49
|
overflow: hidden;
|
43
|
-
/* background: #FFFFFF; */
|
44
50
|
}
|
45
51
|
|
46
52
|
.ui-chatbox-input-box {
|
47
53
|
margin: 5px 5px 5px 5px;
|
48
|
-
border:
|
54
|
+
border: 1px solid $separation-color;
|
49
55
|
height: 35px;
|
50
56
|
}
|
51
57
|
|
58
|
+
|
52
59
|
.ui-chatbox-icon {
|
53
60
|
float: right;
|
54
61
|
}
|
55
62
|
|
56
63
|
.ui-chatbox-input-focus {
|
57
|
-
border-color:
|
64
|
+
border-color: $header-notification-color;
|
58
65
|
}
|
59
66
|
|
60
67
|
.ui-chatbox-msg {
|
@@ -62,10 +69,27 @@
|
|
62
69
|
clear: both;
|
63
70
|
}
|
64
71
|
|
72
|
+
.ui-chatbox-log {
|
73
|
+
border: none;
|
74
|
+
}
|
75
|
+
|
76
|
+
|
77
|
+
/* video window style */
|
78
|
+
div.ui-videobox{
|
79
|
+
height: 0px;
|
80
|
+
border-bottom: 1px solid $separation-color;
|
81
|
+
}
|
82
|
+
|
83
|
+
div.ui-videobox-icon{
|
84
|
+
|
85
|
+
}
|
86
|
+
|
87
|
+
/* notifications style sheet */
|
88
|
+
|
65
89
|
div.ui-chatbox-notify{
|
66
90
|
visibility: hidden;
|
67
|
-
background:
|
68
|
-
background-color:
|
91
|
+
background: $fill-color;
|
92
|
+
background-color: $fill-color;
|
69
93
|
color: black;
|
70
94
|
z-index: 1;
|
71
95
|
position:absolute;
|
@@ -76,7 +100,7 @@ div.ui-chatbox-notify{
|
|
76
100
|
text-align: center;
|
77
101
|
border-style:solid;
|
78
102
|
border-width:1px;
|
79
|
-
border-color:
|
103
|
+
border-color: $fill-color;
|
80
104
|
opacity:0.95;
|
81
105
|
filter:alpha(opacity=95); /* For IE8 and earlier */
|
82
106
|
}
|
@@ -87,6 +111,7 @@ p.ui-chatbox-notify-text{
|
|
87
111
|
}
|
88
112
|
|
89
113
|
|
114
|
+
|
90
115
|
/* Ticks */
|
91
116
|
|
92
117
|
.chat-thick {
|
@@ -108,6 +133,10 @@ p.ui-chatbox-notify-text{
|
|
108
133
|
background-position: -96px -128px;
|
109
134
|
}
|
110
135
|
|
136
|
+
.chat-videothick{
|
137
|
+
display: none;
|
138
|
+
}
|
139
|
+
|
111
140
|
|
112
141
|
/* Presence Partial */
|
113
142
|
|
@@ -147,7 +176,7 @@ div.user_presence {
|
|
147
176
|
|
148
177
|
#passwordFormChat{
|
149
178
|
width: 150px;
|
150
|
-
background-color:
|
179
|
+
background-color: $main-color;
|
151
180
|
padding-top:3px;
|
152
181
|
padding-bottom:1px;
|
153
182
|
}
|
@@ -168,7 +197,7 @@ input.chat_password{
|
|
168
197
|
input.connectChatButton{
|
169
198
|
text-align: center;
|
170
199
|
width: 150px;
|
171
|
-
background-color:
|
200
|
+
background-color: $main-color;
|
172
201
|
border: 0 none;
|
173
202
|
cursor: pointer;
|
174
203
|
color: white;
|
@@ -189,28 +218,19 @@ input.connectChatButton{
|
|
189
218
|
width:160px;
|
190
219
|
padding: 18px 25px 15px 25px;
|
191
220
|
margin: -15px 0px 0px 0px;
|
192
|
-
color
|
221
|
+
color: white;
|
193
222
|
background:transparent url(black_arrow3.png);
|
194
223
|
text-align: center;
|
195
|
-
/* border: 5px solid red; */
|
196
224
|
}
|
197
225
|
|
198
226
|
|
199
|
-
/* Status style sheet */
|
200
227
|
|
228
|
+
/* Status style sheet */
|
201
229
|
|
202
230
|
#status{
|
203
231
|
z-index: 1;
|
204
232
|
}
|
205
|
-
|
206
|
-
.desc {
|
207
|
-
color:#6b6b6b;
|
208
|
-
}
|
209
|
-
|
210
|
-
.desc a {
|
211
|
-
color:#0092dd;
|
212
|
-
}
|
213
|
-
|
233
|
+
|
214
234
|
.dropdown dd, .dropdown dt, .dropdown ul {
|
215
235
|
margin:0px;
|
216
236
|
padding:0px;
|
@@ -221,29 +241,28 @@ input.connectChatButton{
|
|
221
241
|
}
|
222
242
|
|
223
243
|
.dropdown a, .dropdown a:visited {
|
224
|
-
color
|
244
|
+
color: $main-color;
|
225
245
|
text-decoration:none;
|
226
246
|
outline:none;
|
227
247
|
}
|
228
248
|
|
229
249
|
.dropdown a:hover {
|
230
|
-
color
|
250
|
+
color: $main-color;
|
231
251
|
}
|
232
252
|
.dropdown dt a:hover {
|
233
|
-
color
|
234
|
-
border: 1px solid
|
253
|
+
color: $main-color;
|
254
|
+
border: 1px solid $main-color;
|
235
255
|
}
|
236
256
|
|
237
257
|
.dropdown dt a {
|
238
|
-
background
|
258
|
+
background:$secondary-color url(btn/arrowBlue.png) no-repeat scroll right center;
|
239
259
|
display:block;
|
240
260
|
padding-right:20px;
|
241
|
-
border:1px solid
|
261
|
+
border:1px solid $secondary-color;
|
242
262
|
width:128px;
|
243
263
|
}
|
244
264
|
|
245
265
|
|
246
|
-
|
247
266
|
.dropdown dt a span {
|
248
267
|
cursor:pointer;
|
249
268
|
display:block;
|
@@ -251,8 +270,9 @@ input.connectChatButton{
|
|
251
270
|
}
|
252
271
|
|
253
272
|
.dropdown dd ul {
|
254
|
-
background
|
255
|
-
border:1px solid
|
273
|
+
background: $secondary-color none repeat scroll 0 0;
|
274
|
+
border:1px solid $secondary-color;
|
275
|
+
color: $secondary-color;
|
256
276
|
display:none;
|
257
277
|
left:0px;
|
258
278
|
padding:5px 0px;
|
@@ -274,7 +294,7 @@ input.connectChatButton{
|
|
274
294
|
}
|
275
295
|
|
276
296
|
.dropdown dd ul li a:hover {
|
277
|
-
background-color
|
297
|
+
background-color: $separation-color;
|
278
298
|
}
|
279
299
|
|
280
300
|
.dropdown img.flag {
|
@@ -287,22 +307,23 @@ input.connectChatButton{
|
|
287
307
|
display:none;
|
288
308
|
}
|
289
309
|
|
290
|
-
.input_select{
|
291
|
-
width: 100%;
|
292
|
-
background-color: #D0C9AF;
|
293
|
-
margin-top:5px;
|
294
|
-
margin-bottom:5px;
|
295
|
-
}
|
296
|
-
|
297
310
|
|
298
311
|
/* Chat text style */
|
299
312
|
|
300
313
|
.ownChatText {
|
301
|
-
color:
|
314
|
+
color: $main-color;
|
302
315
|
}
|
303
316
|
|
304
317
|
.guestChatText {
|
305
|
-
color:
|
318
|
+
color: $sentence-color;
|
319
|
+
}
|
320
|
+
|
321
|
+
.ownName {
|
322
|
+
color: $main-color;
|
323
|
+
}
|
324
|
+
|
325
|
+
.guestName {
|
326
|
+
color: $sentence-color;
|
306
327
|
}
|
307
328
|
|
308
329
|
.chatImage {
|
@@ -321,9 +342,9 @@ input.connectChatButton{
|
|
321
342
|
}
|
322
343
|
|
323
344
|
a.chatLink:link, a.chatLink:visited {
|
324
|
-
color:
|
345
|
+
color: $main-color;
|
325
346
|
}
|
326
347
|
|
327
348
|
a.chatImageLink:link, a.chatImageLink:visited {
|
328
|
-
color:
|
349
|
+
color: $main-color;
|
329
350
|
}
|
data/ejabberd/ejabberd_files.zip
CHANGED
Binary file
|
@@ -54,7 +54,7 @@ PARAMS_FOR_COMMANDS = {
|
|
54
54
|
'sendMessageToUser' => 3,
|
55
55
|
'getUserResource' => 1,
|
56
56
|
'isEjabberdNodeStarted' => 0,
|
57
|
-
'broadcast' =>
|
57
|
+
'broadcast' => 3,
|
58
58
|
'checkEjabberdctlQuotedString' => 0,
|
59
59
|
'getConnectedUsers' => 0,
|
60
60
|
'help' => 0,
|
@@ -79,7 +79,7 @@ SYNTAX_FOR_COMMANDS = {
|
|
79
79
|
'sendMessageToUser' => 'sendMessageToUser from_name to_name msg',
|
80
80
|
'getUserResource' => 'getUserResource username',
|
81
81
|
'isEjabberdNodeStarted' => 'isEjabberdNodeStarted',
|
82
|
-
'broadcast' => 'broadcast users msg (users values: "all" or slugs array)',
|
82
|
+
'broadcast' => 'broadcast admin users msg (users values: "all" or slugs array)',
|
83
83
|
'checkEjabberdctlQuotedString' => 'checkEjabberdctlQuotedString',
|
84
84
|
'getConnectedUsers' => 'getConnectedUsers',
|
85
85
|
'help' => 'help',
|
@@ -364,7 +364,7 @@ def getConnectedUsers
|
|
364
364
|
return users
|
365
365
|
end
|
366
366
|
|
367
|
-
def broadcast(users,msg)
|
367
|
+
def broadcast(admin,users,msg)
|
368
368
|
output = executeCommand("ejabberdctl connected-users")
|
369
369
|
lines = output.split("\n");
|
370
370
|
lines.each do |line|
|
@@ -372,7 +372,7 @@ def broadcast(users,msg)
|
|
372
372
|
if (users == "all") or (users.length > 1 and users.include?(username))
|
373
373
|
s = line.split("@")[1];
|
374
374
|
resource = s.split("/")[1];
|
375
|
-
sendMessageToUser(
|
375
|
+
sendMessageToUser(admin,username,msg)
|
376
376
|
end
|
377
377
|
end
|
378
378
|
return "Done"
|
Binary file
|
@@ -31,23 +31,24 @@ module SocialStream
|
|
31
31
|
user_name = self.sender.name
|
32
32
|
buddy_sid = self.receiver.slug + "@" + domain
|
33
33
|
buddy_name = self.receiver.name
|
34
|
+
site_name = I18n.t('site.name').delete(' ')
|
34
35
|
|
35
36
|
#Check if is a positive and replied tie
|
36
37
|
if self.bidirectional?
|
37
38
|
#Execute setRosterForBidirectionalTie(userASid,userBSid,userANick,userBNick,groupForA,groupForB)
|
38
|
-
SocialStream::Presence::XmppServerOrder::setRosterForBidirectionalTie(user_sid,buddy_sid,user_name,buddy_name,
|
39
|
+
SocialStream::Presence::XmppServerOrder::setRosterForBidirectionalTie(user_sid,buddy_sid,user_name,buddy_name,site_name,site_name)
|
39
40
|
elsif self.positive?
|
40
41
|
#Case: Possitive tie unidirectional
|
41
42
|
#Execute addBuddyToRoster(userSID,buddySID,buddyNick,buddyGroup,subscription_type)
|
42
43
|
subscription_type = "from"
|
43
|
-
SocialStream::Presence::XmppServerOrder::addBuddyToRoster(user_sid,buddy_sid,buddy_name,
|
44
|
+
SocialStream::Presence::XmppServerOrder::addBuddyToRoster(user_sid,buddy_sid,buddy_name,site_name,subscription_type)
|
44
45
|
else
|
45
46
|
#Negative Tie
|
46
47
|
|
47
48
|
if self.contact.positive_replied?
|
48
49
|
#Bidirectional contacts
|
49
50
|
#Execute unsetRosterForBidirectionalTie(user_sid,oldfriend_sid,oldfriendNick,oldfriendGroup)
|
50
|
-
SocialStream::Presence::XmppServerOrder::unsetRosterForBidirectionalTie(buddy_sid,user_sid,user_name,
|
51
|
+
SocialStream::Presence::XmppServerOrder::unsetRosterForBidirectionalTie(buddy_sid,user_sid,user_name,site_name)
|
51
52
|
else
|
52
53
|
SocialStream::Presence::XmppServerOrder::removeBuddyFromRoster(user_sid,buddy_sid)
|
53
54
|
end
|
@@ -85,7 +86,7 @@ module SocialStream
|
|
85
86
|
# #Check if is a positive and replied tie
|
86
87
|
# if self.bidirectional?
|
87
88
|
# #Execute unsetRosterForBidirectionalTie(user_sid,oldfriend_sid,oldfriendNick,oldfriendGroup)
|
88
|
-
# SocialStream::Presence::XmppServerOrder::unsetRosterForBidirectionalTie(buddy_sid,user_sid,user_name,
|
89
|
+
# SocialStream::Presence::XmppServerOrder::unsetRosterForBidirectionalTie(buddy_sid,user_sid,user_name,site_name)
|
89
90
|
# elsif self.positive?
|
90
91
|
# #Case: Possitive tie unidirectional
|
91
92
|
# #Execute removeBuddyFromRoster(user_sid,buddy_sid)
|
@@ -60,6 +60,7 @@ module SocialStream
|
|
60
60
|
#"Populate rosters"
|
61
61
|
users = User.all
|
62
62
|
checkedUsers = []
|
63
|
+
site_name = I18n.t('site.name').delete(' ')
|
63
64
|
|
64
65
|
users.each do |user|
|
65
66
|
checkedUsers << user.slug
|
@@ -69,7 +70,7 @@ module SocialStream
|
|
69
70
|
domain = SocialStream::Presence.domain
|
70
71
|
user_sid = user.slug + "@" + domain
|
71
72
|
contact_sid = contact.slug + "@" + domain
|
72
|
-
commands << buildCommand("emanagement","setBidireccionalBuddys",[user_sid,contact_sid,user.name,contact.name,
|
73
|
+
commands << buildCommand("emanagement","setBidireccionalBuddys",[user_sid,contact_sid,user.name,contact.name,site_name,site_name])
|
73
74
|
end
|
74
75
|
end
|
75
76
|
end
|
@@ -22,6 +22,8 @@
|
|
22
22
|
hidden: false,
|
23
23
|
offset: 0, // relative to right edge of the browser window
|
24
24
|
width: 230, // width of the chatbox
|
25
|
+
height: 400, // height of the chatbox
|
26
|
+
video: 0, // height of the videoBox
|
25
27
|
messageSent: function(id, user, msg){
|
26
28
|
// override this
|
27
29
|
this.boxManager.addMsg(user.first_name, msg);
|
@@ -168,6 +170,24 @@
|
|
168
170
|
.text('minimize')
|
169
171
|
.appendTo(uiChatboxTitlebarMinimize),
|
170
172
|
|
173
|
+
//Video Menu button
|
174
|
+
uiChatboxTitlebarVideo = (self.uiChatboxTitlebarVideo = $('<a href="#"></a>'))
|
175
|
+
.addClass('ui-corner-all ' +
|
176
|
+
'ui-chatbox-icon' + ' ui-videobox-icon'
|
177
|
+
)
|
178
|
+
.attr('role', 'button')
|
179
|
+
//.hover(function() {uiChatboxTitlebarMinimize.addClass('ui-state-hover');},
|
180
|
+
// function() {uiChatboxTitlebarMinimize.removeClass('ui-state-hover');})
|
181
|
+
.click(function(event) {
|
182
|
+
toogleVideoBox(self)
|
183
|
+
return false;
|
184
|
+
})
|
185
|
+
.appendTo(uiChatboxTitlebar),
|
186
|
+
uiChatboxTitlebarVideoText = $('<span></span>')
|
187
|
+
.addClass('ui-icon-circle-triangle-e ' + 'chat-thick ' + ' chat-videothick' )
|
188
|
+
.text('video')
|
189
|
+
.appendTo(uiChatboxTitlebarVideo),
|
190
|
+
|
171
191
|
|
172
192
|
// content
|
173
193
|
uiChatboxContent = (self.uiChatboxContent = $('<div></div>'))
|
@@ -175,6 +195,19 @@
|
|
175
195
|
'ui-chatbox-content '
|
176
196
|
)
|
177
197
|
.appendTo(uiChatbox),
|
198
|
+
|
199
|
+
//VideoBox div
|
200
|
+
uiVideobox = (self.uiVideobox = $('<div></div>'))
|
201
|
+
.addClass('ui-widget-content ' +
|
202
|
+
'ui-videobox'
|
203
|
+
)
|
204
|
+
.click(function(event) {
|
205
|
+
// anything?
|
206
|
+
|
207
|
+
})
|
208
|
+
.appendTo(uiChatboxContent),
|
209
|
+
|
210
|
+
//ChatBoxLog
|
178
211
|
uiChatboxLog = (self.uiChatboxLog = self.element)
|
179
212
|
//.show()
|
180
213
|
.addClass('ui-widget-content '+
|
@@ -235,11 +268,13 @@
|
|
235
268
|
|
236
269
|
// switch focus to input box when whatever clicked
|
237
270
|
uiChatboxContent.children().click(function(){
|
238
|
-
|
239
|
-
|
271
|
+
// click on any children, set focus on input box
|
272
|
+
self.uiChatboxInputBox.focus();
|
240
273
|
});
|
241
274
|
|
242
275
|
self._setWidth(self.options.width);
|
276
|
+
self._setHeight(self.options.height);
|
277
|
+
self._setVideo(self.options.video);
|
243
278
|
self._position(self.options.offset);
|
244
279
|
|
245
280
|
self.options.boxManager.init(self);
|
@@ -251,22 +286,28 @@
|
|
251
286
|
|
252
287
|
_setOption: function(option, value) {
|
253
288
|
if(value != null){
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
289
|
+
switch(option) {
|
290
|
+
case "hidden":
|
291
|
+
if(value) {
|
292
|
+
this.uiChatbox.hide();
|
293
|
+
}
|
294
|
+
else {
|
295
|
+
this.uiChatbox.show();
|
296
|
+
}
|
297
|
+
break;
|
298
|
+
case "offset":
|
299
|
+
this._position(value);
|
300
|
+
break;
|
301
|
+
case "width":
|
302
|
+
this._setWidth(value);
|
303
|
+
break;
|
304
|
+
case "height":
|
305
|
+
this._setHeight(value);
|
306
|
+
break;
|
307
|
+
case "video":
|
308
|
+
this._setVideo(value);
|
309
|
+
break;
|
310
|
+
}
|
270
311
|
}
|
271
312
|
|
272
313
|
$.Widget.prototype._setOption.apply(this, arguments);
|
@@ -278,6 +319,19 @@
|
|
278
319
|
// this is a hack, but i can live with it so far
|
279
320
|
this.uiChatboxInputBox.css("width", (width - 14) + "px");
|
280
321
|
},
|
322
|
+
|
323
|
+
_setHeight: function(height) {
|
324
|
+
this.uiChatboxLog.height(height + "px");
|
325
|
+
},
|
326
|
+
|
327
|
+
_setVideo: function(videoHeight) {
|
328
|
+
this.uiVideobox.height(videoHeight + "px");
|
329
|
+
if (videoHeight==0){
|
330
|
+
this.uiVideobox.hide();
|
331
|
+
} else {
|
332
|
+
this.uiVideobox.show();
|
333
|
+
}
|
334
|
+
},
|
281
335
|
|
282
336
|
_position: function(offset) {
|
283
337
|
this.uiChatbox.css("right", offset);
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream-presence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 7
|
9
|
-
version: 0.1.7
|
4
|
+
prerelease:
|
5
|
+
version: 0.2.0
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Aldo Gordillo
|
@@ -14,7 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-12-
|
13
|
+
date: 2011-12-16 00:00:00 +01:00
|
18
14
|
default_executable:
|
19
15
|
dependencies:
|
20
16
|
- !ruby/object:Gem::Dependency
|
@@ -25,10 +21,6 @@ dependencies:
|
|
25
21
|
requirements:
|
26
22
|
- - ~>
|
27
23
|
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 0
|
30
|
-
- 10
|
31
|
-
- 0
|
32
24
|
version: 0.10.0
|
33
25
|
type: :runtime
|
34
26
|
version_requirements: *id001
|
@@ -40,8 +32,6 @@ dependencies:
|
|
40
32
|
requirements:
|
41
33
|
- - ">="
|
42
34
|
- !ruby/object:Gem::Version
|
43
|
-
segments:
|
44
|
-
- 0
|
45
35
|
version: "0"
|
46
36
|
type: :runtime
|
47
37
|
version_requirements: *id002
|
@@ -53,8 +43,6 @@ dependencies:
|
|
53
43
|
requirements:
|
54
44
|
- - ">="
|
55
45
|
- !ruby/object:Gem::Version
|
56
|
-
segments:
|
57
|
-
- 0
|
58
46
|
version: "0"
|
59
47
|
type: :runtime
|
60
48
|
version_requirements: *id003
|
@@ -66,8 +54,6 @@ dependencies:
|
|
66
54
|
requirements:
|
67
55
|
- - ">="
|
68
56
|
- !ruby/object:Gem::Version
|
69
|
-
segments:
|
70
|
-
- 0
|
71
57
|
version: "0"
|
72
58
|
type: :runtime
|
73
59
|
version_requirements: *id004
|
@@ -79,8 +65,6 @@ dependencies:
|
|
79
65
|
requirements:
|
80
66
|
- - ">="
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
segments:
|
83
|
-
- 0
|
84
68
|
version: "0"
|
85
69
|
type: :development
|
86
70
|
version_requirements: *id005
|
@@ -122,7 +106,7 @@ files:
|
|
122
106
|
- app/assets/javascripts/social_stream-presence.js
|
123
107
|
- app/assets/javascripts/store.js
|
124
108
|
- app/assets/javascripts/xmpp_client_management.js.erb
|
125
|
-
- app/assets/stylesheets/chat.css
|
109
|
+
- app/assets/stylesheets/chat.css.scss
|
126
110
|
- app/assets/stylesheets/social_stream-presence.css
|
127
111
|
- app/controllers/xmpp_controller.rb
|
128
112
|
- app/helpers/xmpp_helper.rb
|
@@ -240,21 +224,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
240
224
|
requirements:
|
241
225
|
- - ">="
|
242
226
|
- !ruby/object:Gem::Version
|
243
|
-
segments:
|
244
|
-
- 0
|
245
227
|
version: "0"
|
246
228
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
247
229
|
none: false
|
248
230
|
requirements:
|
249
231
|
- - ">="
|
250
232
|
- !ruby/object:Gem::Version
|
251
|
-
segments:
|
252
|
-
- 0
|
253
233
|
version: "0"
|
254
234
|
requirements: []
|
255
235
|
|
256
236
|
rubyforge_project: social_stream-presence
|
257
|
-
rubygems_version: 1.
|
237
|
+
rubygems_version: 1.6.1
|
258
238
|
signing_key:
|
259
239
|
specification_version: 3
|
260
240
|
summary: Presence capabilities for Social Stream, the core for building social network websites
|