social_stream 0.12.14 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- data/base/app/controllers/groups_controller.rb +3 -2
- data/base/app/controllers/posts_controller.rb +2 -10
- data/base/app/helpers/activities_helper.rb +2 -1
- data/base/app/models/activity_object.rb +28 -0
- data/base/app/models/actor.rb +10 -0
- data/base/app/models/group.rb +7 -3
- data/base/app/models/user.rb +7 -2
- data/base/app/views/activities/_new.html.erb +0 -1
- data/base/app/views/activity_objects/_activity_object.html.erb +3 -3
- data/base/app/views/comments/_new.html.erb +2 -3
- data/base/app/views/groups/_new.html.erb +0 -3
- data/base/app/views/notifications/activities/_like.text.erb +1 -1
- data/base/app/views/objects/_new_activity.html.erb +2 -2
- data/base/app/views/objects/_show.html.erb +1 -1
- data/base/db/migrate/20111124100618_object_actors.rb +50 -0
- data/base/lib/social_stream-base.rb +2 -1
- data/base/lib/social_stream/ability/base.rb +1 -1
- data/base/lib/social_stream/base/version.rb +1 -1
- data/base/lib/social_stream/controllers/objects.rb +33 -0
- data/base/lib/social_stream/models/object.rb +33 -28
- data/base/lib/social_stream/test_helpers/controllers.rb +3 -1
- data/base/lib/tasks/db/populate.rake +9 -2
- data/base/spec/controllers/comments_controller_spec.rb +9 -6
- data/base/spec/controllers/groups_controller_spec.rb +7 -5
- data/base/spec/controllers/posts_controller_spec.rb +45 -9
- data/base/spec/controllers/users_controller_spec.rb +3 -1
- data/base/spec/factories/activity.rb +3 -2
- data/base/spec/factories/comment.rb +3 -2
- data/base/spec/factories/group.rb +2 -1
- data/base/spec/factories/post.rb +5 -4
- data/base/spec/models/activity_authorization_spec.rb +5 -4
- data/base/spec/models/group_spec.rb +5 -2
- data/base/spec/models/post_spec.rb +6 -2
- data/documents/app/assets/stylesheets/show.css.scss +4 -0
- data/documents/app/controllers/documents_controller.rb +2 -10
- data/documents/app/views/audios/_audio_processed.html.erb +1 -1
- data/documents/app/views/audios/_audio_processing.html.erb +1 -1
- data/documents/app/views/common_documents/_document_info.html.erb +5 -0
- data/documents/app/views/documents/_document.html.erb +1 -1
- data/documents/app/views/pictures/_picture.html.erb +4 -4
- data/documents/app/views/videos/_video_processed.html.erb +1 -1
- data/documents/app/views/videos/_video_processing.html.erb +1 -1
- data/documents/lib/social_stream/documents/version.rb +1 -1
- data/documents/social_stream-documents.gemspec +1 -1
- data/documents/spec/factories/document.rb +7 -6
- data/documents/spec/factories/picture.rb +7 -6
- data/documents/spec/spec_helper.rb +6 -1
- data/events/db/migrate/20111102145626_add_more_fields_to_events.rb +0 -4
- data/events/db/migrate/20111104182420_add_details_to_events.rb +0 -26
- data/events/lib/social_stream/events/version.rb +1 -1
- data/events/social_stream-events.gemspec +1 -1
- data/lib/social_stream/version.rb +1 -1
- data/linkser/.gitignore +14 -0
- data/linkser/.rspec +1 -0
- data/linkser/Gemfile +5 -0
- data/linkser/MIT-LICENSE +20 -0
- data/linkser/README.rdoc +6 -0
- data/linkser/Rakefile +26 -0
- data/{documents/app/views/audios/_mediapreviews.html.erb → linkser/app/assets/javascripts/linkser.js.erb} +0 -0
- data/linkser/app/assets/javascripts/social_stream-linkser.js +1 -0
- data/linkser/app/assets/stylesheets/linkser.css.scss +1 -0
- data/linkser/app/assets/stylesheets/social_stream-linkser.css +3 -0
- data/linkser/config/locales/en.yml +3 -0
- data/linkser/config/locales/es.yml +3 -0
- data/linkser/config/routes.rb +3 -0
- data/linkser/lib/generators/social_stream/linkser/install_generator.rb +24 -0
- data/linkser/lib/social_stream-linkser.rb +9 -0
- data/linkser/lib/social_stream/linkser/engine.rb +7 -0
- data/linkser/lib/social_stream/linkser/version.rb +5 -0
- data/linkser/lib/social_stream/migrations/linkser.rb +9 -0
- data/linkser/social_stream-linkser.gemspec +26 -0
- data/linkser/spec/dummy/Rakefile +7 -0
- data/linkser/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/linkser/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/linkser/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/linkser/spec/dummy/config.ru +4 -0
- data/linkser/spec/dummy/config/application.rb +45 -0
- data/linkser/spec/dummy/config/boot.rb +10 -0
- data/linkser/spec/dummy/config/database.yml +22 -0
- data/linkser/spec/dummy/config/environment.rb +5 -0
- data/linkser/spec/dummy/config/environments/development.rb +25 -0
- data/linkser/spec/dummy/config/environments/production.rb +49 -0
- data/linkser/spec/dummy/config/environments/test.rb +37 -0
- data/linkser/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/linkser/spec/dummy/config/initializers/devise.rb +176 -0
- data/linkser/spec/dummy/config/initializers/inflections.rb +10 -0
- data/linkser/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/linkser/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/linkser/spec/dummy/config/initializers/session_store.rb +8 -0
- data/linkser/spec/dummy/config/locales/en.yml +5 -0
- data/linkser/spec/dummy/config/navigation.rb +0 -0
- data/linkser/spec/dummy/config/relations.yml +39 -0
- data/linkser/spec/dummy/config/routes.rb +60 -0
- data/linkser/spec/dummy/db/.gitkeep +0 -0
- data/linkser/spec/dummy/documents/documents/000/000/001/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/002/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/003/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/004/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/005/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/006/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/007/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/008/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/009/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/010/original.pdf +157 -0
- data/linkser/spec/dummy/documents/pictures/000/000/011/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/011/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/011/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/012/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/012/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/012/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/013/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/013/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/013/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/014/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/014/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/014/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/015/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/015/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/015/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/016/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/016/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/016/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/017/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/017/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/017/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/018/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/018/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/018/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/019/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/019/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/019/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/020/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/020/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/020/thumb0.png +0 -0
- data/linkser/spec/dummy/public/404.html +26 -0
- data/linkser/spec/dummy/public/422.html +26 -0
- data/linkser/spec/dummy/public/500.html +26 -0
- data/linkser/spec/dummy/public/favicon.ico +0 -0
- data/linkser/spec/dummy/public/javascripts/application.js +2 -0
- data/linkser/spec/dummy/public/javascripts/controls.js +965 -0
- data/linkser/spec/dummy/public/javascripts/dragdrop.js +974 -0
- data/linkser/spec/dummy/public/javascripts/effects.js +1123 -0
- data/linkser/spec/dummy/public/javascripts/prototype.js +6001 -0
- data/linkser/spec/dummy/public/javascripts/rails.js +191 -0
- data/linkser/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/linkser/spec/dummy/script/rails +6 -0
- data/linkser/spec/integration/navigation_spec.rb +9 -0
- data/linkser/spec/socialstream_linkser_spec.rb +7 -0
- data/linkser/spec/spec_helper.rb +48 -0
- data/linkser/spec/support/cancan.rb +1 -0
- data/linkser/spec/support/db.rb +8 -0
- data/linkser/spec/support/devise.rb +4 -0
- data/linkser/spec/support/mock.rb +4 -0
- data/linkser/vendor/assets/javascripts/jquery.jplayer.js +78 -0
- data/linkser/vendor/assets/stylesheets/jplayer.blue.monday.css +448 -0
- data/linkser/vendor/assets/stylesheets/jplayer.blue.monday.jpg +0 -0
- data/linkser/vendor/assets/stylesheets/jplayer.blue.monday.video.play.hover.png +0 -0
- data/linkser/vendor/assets/stylesheets/jplayer.blue.monday.video.play.png +0 -0
- data/linkser/vendor/assets/stylesheets/jquery.lightbox.css +101 -0
- data/linkser/vendor/assets/stylesheets/pbar-ani.gif +0 -0
- data/presence/app/assets/images/status/offline.png +0 -0
- data/presence/app/assets/javascripts/chat_interface_manager.js.erb +65 -16
- data/presence/app/assets/javascripts/xmpp_client_management.js.erb +13 -3
- data/presence/app/controllers/xmpp_controller.rb +2 -5
- data/presence/app/views/chat/_contacts.html.erb +10 -9
- data/presence/app/views/chat/_settings.html.erb +4 -4
- data/presence/app/views/xmpp/active_users.html.erb +10 -10
- data/presence/config/locales/en.yml +6 -1
- data/presence/config/locales/es.yml +7 -1
- data/presence/config/routes.rb +1 -4
- data/presence/lib/social_stream/presence/version.rb +1 -1
- data/social_stream.gemspec +3 -3
- metadata +127 -23
- data/documents/app/views/audios/index.js.erb +0 -1
- data/documents/app/views/documents/index.js.erb +0 -1
- data/documents/app/views/pictures/_mediapreviews.html.erb +0 -8
- data/documents/app/views/pictures/index.js.erb +0 -1
- data/presence/app/views/xmpp/index.html +0 -18
- data/presence/app/views/xmpp/test.html.erb +0 -11
Binary file
|
@@ -0,0 +1,101 @@
|
|
1
|
+
/**
|
2
|
+
* jQuery lightBox plugin
|
3
|
+
* This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
|
4
|
+
* and adapted to me for use like a plugin from jQuery.
|
5
|
+
* @name jquery-lightbox-0.5.css
|
6
|
+
* @author Leandro Vieira Pinho - http://leandrovieira.com
|
7
|
+
* @version 0.5
|
8
|
+
* @date April 11, 2008
|
9
|
+
* @category jQuery plugin
|
10
|
+
* @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
|
11
|
+
* @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US
|
12
|
+
* @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
|
13
|
+
*/
|
14
|
+
#jquery-overlay {
|
15
|
+
position: absolute;
|
16
|
+
top: 0;
|
17
|
+
left: 0;
|
18
|
+
z-index: 90;
|
19
|
+
width: 100%;
|
20
|
+
height: 500px;
|
21
|
+
}
|
22
|
+
#jquery-lightbox {
|
23
|
+
position: absolute;
|
24
|
+
top: 0;
|
25
|
+
left: 0;
|
26
|
+
width: 100%;
|
27
|
+
z-index: 100;
|
28
|
+
text-align: center;
|
29
|
+
line-height: 0;
|
30
|
+
}
|
31
|
+
#jquery-lightbox a img { border: none; }
|
32
|
+
#lightbox-container-image-box {
|
33
|
+
position: relative;
|
34
|
+
background-color: #fff;
|
35
|
+
width: 250px;
|
36
|
+
height: 250px;
|
37
|
+
margin: 0 auto;
|
38
|
+
}
|
39
|
+
#lightbox-container-image { padding: 10px; }
|
40
|
+
#lightbox-loading {
|
41
|
+
position: absolute;
|
42
|
+
top: 40%;
|
43
|
+
left: 0%;
|
44
|
+
height: 25%;
|
45
|
+
width: 100%;
|
46
|
+
text-align: center;
|
47
|
+
line-height: 0;
|
48
|
+
}
|
49
|
+
#lightbox-nav {
|
50
|
+
position: absolute;
|
51
|
+
top: 0;
|
52
|
+
left: 0;
|
53
|
+
height: 100%;
|
54
|
+
width: 100%;
|
55
|
+
z-index: 10;
|
56
|
+
}
|
57
|
+
#lightbox-container-image-box > #lightbox-nav { left: 0; }
|
58
|
+
#lightbox-nav a { outline: none;}
|
59
|
+
#lightbox-nav-btnPrev, #lightbox-nav-btnNext {
|
60
|
+
width: 49%;
|
61
|
+
height: 100%;
|
62
|
+
zoom: 1;
|
63
|
+
display: block;
|
64
|
+
}
|
65
|
+
#lightbox-nav-btnPrev {
|
66
|
+
left: 0;
|
67
|
+
float: left;
|
68
|
+
}
|
69
|
+
#lightbox-nav-btnNext {
|
70
|
+
right: 0;
|
71
|
+
float: right;
|
72
|
+
}
|
73
|
+
#lightbox-container-image-data-box {
|
74
|
+
font: 10px Verdana, Helvetica, sans-serif;
|
75
|
+
background-color: #fff;
|
76
|
+
margin: 0 auto;
|
77
|
+
line-height: 1.4em;
|
78
|
+
overflow: auto;
|
79
|
+
width: 100%;
|
80
|
+
padding: 0 10px 0;
|
81
|
+
}
|
82
|
+
#lightbox-container-image-data {
|
83
|
+
padding: 0 10px;
|
84
|
+
color: #666;
|
85
|
+
}
|
86
|
+
#lightbox-container-image-data #lightbox-image-details {
|
87
|
+
width: 70%;
|
88
|
+
float: left;
|
89
|
+
text-align: left;
|
90
|
+
}
|
91
|
+
#lightbox-image-details-caption { font-weight: bold; }
|
92
|
+
#lightbox-image-details-currentNumber {
|
93
|
+
display: block;
|
94
|
+
clear: left;
|
95
|
+
padding-bottom: 1.0em;
|
96
|
+
}
|
97
|
+
#lightbox-secNav-btnClose {
|
98
|
+
width: 66px;
|
99
|
+
float: right;
|
100
|
+
padding-bottom: 0.7em;
|
101
|
+
}
|
Binary file
|
Binary file
|
@@ -1,6 +1,9 @@
|
|
1
1
|
////////////////////
|
2
2
|
//Hash table
|
3
3
|
////////////////////
|
4
|
+
|
5
|
+
//Keys: Xmpp status
|
6
|
+
//Value: Social Stream Status
|
4
7
|
var statusIcons = new Array();
|
5
8
|
statusIcons[''] = "available";
|
6
9
|
statusIcons['chat'] = "available";
|
@@ -63,29 +66,63 @@ function setUserFunctions(){
|
|
63
66
|
$(".dropdown dt a").click(function(event) {
|
64
67
|
event.preventDefault();
|
65
68
|
$(".dropdown dd ul").toggle();
|
69
|
+
|
70
|
+
if($(".dropdown dd ul").is(":visible")){
|
71
|
+
setStatusWidgetTitle("default");
|
72
|
+
} else {
|
73
|
+
setStatusWidgetTitle(userStatus);
|
74
|
+
}
|
75
|
+
|
76
|
+
restartAwayTimer(false);
|
77
|
+
|
66
78
|
});
|
67
79
|
|
68
80
|
$(".dropdown dd ul li a.option").click(function(event) {
|
69
81
|
event.preventDefault();
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
82
|
+
userStatus = $(this).find("span.value").html();
|
83
|
+
if(userStatus == "offline"){
|
84
|
+
disconnectStrophe();
|
85
|
+
} else {
|
86
|
+
sendStatus(userStatus);
|
87
|
+
}
|
74
88
|
$(".dropdown dd ul").hide();
|
75
89
|
});
|
76
90
|
|
77
|
-
|
78
|
-
function getSelectedValue(id) {
|
79
|
-
return $("#" + id).find("dt a span.value").html();
|
80
|
-
}
|
81
91
|
|
82
92
|
$(document).bind('click', function(e) {
|
83
93
|
var $clicked = $(e.target);
|
84
94
|
if (! $clicked.parents().hasClass("dropdown")){
|
85
95
|
//Click outside the select...
|
86
96
|
$(".dropdown dd ul").hide();
|
97
|
+
setStatusWidgetTitle(userStatus);
|
87
98
|
}
|
88
99
|
});
|
100
|
+
|
101
|
+
}
|
102
|
+
|
103
|
+
function setStatusWidgetTitle(status){
|
104
|
+
|
105
|
+
if ($(".dropdown dt a span").length == 0){
|
106
|
+
return;
|
107
|
+
}
|
108
|
+
|
109
|
+
if(status=="default"){
|
110
|
+
var defaultTitle = '<%=I18n.t('chat.status.choose')%>'
|
111
|
+
$(".dropdown dt a span").html(defaultTitle);
|
112
|
+
return;
|
113
|
+
}
|
114
|
+
|
115
|
+
if(status=="offline"){
|
116
|
+
var text = $("#" + status).html();
|
117
|
+
$(".dropdown dt a span").html(text);
|
118
|
+
return;
|
119
|
+
}
|
120
|
+
|
121
|
+
if ((status in statusIcons)&&($("#" + statusIcons[status]).length > 0)) {
|
122
|
+
var text = $("#" + statusIcons[status]).html();
|
123
|
+
$(".dropdown dt a span").html(text);
|
124
|
+
}
|
125
|
+
|
89
126
|
}
|
90
127
|
|
91
128
|
|
@@ -96,21 +133,32 @@ function setUserFunctions(){
|
|
96
133
|
function awayTimerFunction(){
|
97
134
|
awayCounter++;
|
98
135
|
if (awayCounter > (awayTime/awayTimerPeriod)){
|
99
|
-
|
100
|
-
|
136
|
+
if (userStatus != "dnd") {
|
137
|
+
userStatus = "away";
|
138
|
+
sendStatus(userStatus);
|
139
|
+
}
|
101
140
|
clearTimeout(awayTimer);
|
102
|
-
} else {
|
103
|
-
userStatus = "chat";
|
104
141
|
}
|
105
142
|
}
|
106
143
|
|
107
|
-
function
|
144
|
+
function autochangeStatusOnUserAway(){
|
108
145
|
if (userStatus == "away"){
|
109
|
-
|
110
|
-
|
111
|
-
|
146
|
+
userStatus = "chat";
|
147
|
+
sendStatus(userStatus);
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
function restartAwayTimer(autochangeStatus){
|
152
|
+
|
153
|
+
if (awayCounter > (awayTime/awayTimerPeriod)){
|
112
154
|
awayTimer = setInterval("awayTimerFunction()", awayTimerPeriod);
|
155
|
+
|
156
|
+
if(autochangeStatus){
|
157
|
+
autochangeStatusOnUserAway();
|
158
|
+
}
|
113
159
|
}
|
160
|
+
|
161
|
+
awayCounter = 0;
|
114
162
|
}
|
115
163
|
|
116
164
|
|
@@ -144,6 +192,7 @@ function updateChatWindow(){
|
|
144
192
|
$(".tooltip").hide() //Prevent tooltips
|
145
193
|
$("#chat_partial").html(data);
|
146
194
|
if (userConnected) {
|
195
|
+
setStatusWidgetTitle(userStatus);
|
147
196
|
$(".user_presence a[title]").tooltip();
|
148
197
|
setUserFunctions();
|
149
198
|
}
|
@@ -135,7 +135,9 @@ function onConnect(status) {
|
|
135
135
|
log('Strophe is disconnected.');
|
136
136
|
userConnected = false;
|
137
137
|
clearTimeout(awayTimer);
|
138
|
-
|
138
|
+
if(userStatus!="offline"){
|
139
|
+
setTimeout ("onReconnect()", 3000);
|
140
|
+
}
|
139
141
|
} else if (status == Strophe.Status.CONNECTED) {
|
140
142
|
log('Strophe is connected.');
|
141
143
|
log('Presenze stanza send for:' + connection.jid);
|
@@ -144,6 +146,7 @@ function onConnect(status) {
|
|
144
146
|
//addHandler:(callback, namespace to match, stanza name, stanza type, stanza id , stanza from, options)
|
145
147
|
sendStatus(userStatus);
|
146
148
|
userConnected = true;
|
149
|
+
userStatus = "chat";
|
147
150
|
awayTimer = setInterval("awayTimerFunction()", awayTimerPeriod);
|
148
151
|
timer = setInterval("timerFunction()", timerPeriod);
|
149
152
|
}
|
@@ -170,6 +173,12 @@ function onReconnect(){
|
|
170
173
|
}
|
171
174
|
}
|
172
175
|
|
176
|
+
function disconnectStrophe(){
|
177
|
+
userStatus = "offline";
|
178
|
+
connection.send($pres({type: "unavailable"}).tree());
|
179
|
+
connection.disconnect();
|
180
|
+
setStatusWidgetTitle("offline");
|
181
|
+
}
|
173
182
|
|
174
183
|
////////
|
175
184
|
//Manage Message stanzas
|
@@ -198,7 +207,7 @@ function onMessage(msg) {
|
|
198
207
|
//Manage Presence stanzas
|
199
208
|
///////
|
200
209
|
function onPresence(presence) {
|
201
|
-
|
210
|
+
|
202
211
|
//Check presence stanza type
|
203
212
|
ptype = $(presence).attr('type');
|
204
213
|
|
@@ -258,7 +267,7 @@ function sendChatMessage(from,to,text){
|
|
258
267
|
body.t(text);
|
259
268
|
var message = $msg({to: to, from: from, type: 'chat'}).cnode(body.tree());
|
260
269
|
connection.send(message.tree());
|
261
|
-
|
270
|
+
restartAwayTimer(false);
|
262
271
|
return true;
|
263
272
|
}
|
264
273
|
|
@@ -275,5 +284,6 @@ function sendStatus(status){
|
|
275
284
|
.c('show')
|
276
285
|
.t(status);
|
277
286
|
connection.send(pres.tree());
|
287
|
+
setStatusWidgetTitle(status);
|
278
288
|
}
|
279
289
|
}
|
@@ -172,15 +172,12 @@ class XmppController < ApplicationController
|
|
172
172
|
redirect_to :controller => :settings, :action => :index
|
173
173
|
end
|
174
174
|
|
175
|
-
|
175
|
+
|
176
|
+
#Test Method
|
176
177
|
def active_users
|
177
178
|
@users = User.find_all_by_connected(true)
|
178
179
|
@all_users = User.all
|
179
180
|
end
|
180
|
-
|
181
|
-
def test
|
182
|
-
#puts "TEST"
|
183
|
-
end
|
184
181
|
|
185
182
|
|
186
183
|
private
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
<div>
|
2
2
|
|
3
3
|
<div class="block">
|
4
4
|
<div class="header">
|
@@ -12,9 +12,10 @@
|
|
12
12
|
<dt><a href=""><span><%=t('chat.status.choose')%></span></a></dt>
|
13
13
|
<dd>
|
14
14
|
<ul>
|
15
|
-
<li><a href="#" class="option"><img class="flag" src="assets/status/available.png" alt=""/> <%=t('chat.status.available')%> <span class="value">chat</span></a></li>
|
16
|
-
<li><a 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 href="#" class="option"><img class="flag" src="assets/status/dnd.png" alt=""/> <%=t('chat.status.dnd')%> <span class="value">dnd</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">chat</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>
|
18
19
|
</ul>
|
19
20
|
</dd>
|
20
21
|
</div>
|
@@ -38,9 +39,9 @@
|
|
38
39
|
<% end %>
|
39
40
|
</div>
|
40
41
|
|
41
|
-
|
42
|
+
</div>
|
42
43
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
<div id="chat_divs">
|
45
|
+
<div id="chat_div">
|
46
|
+
</div>
|
47
|
+
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div class="block" id="chat_settings">
|
2
2
|
<div class="header">
|
3
3
|
<div class="header_text">
|
4
|
-
|
4
|
+
<%=t('chat.title')%>
|
5
5
|
</div>
|
6
6
|
<div class="header_icon_right">
|
7
7
|
<%= link_to (image_tag('btn/edit.png')), "javascript:showSettings(\"chat_settings\");" %>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
</div>
|
10
10
|
<div id="chat_settings_briefing" class="settings_briefing content">
|
11
11
|
<div class="form_row">
|
12
|
-
|
12
|
+
<%=t('chat.settings.title')%>
|
13
13
|
</div>
|
14
14
|
</div>
|
15
15
|
<div class="content settings_content" id="chat_settings_content" style="display:none;">
|
@@ -21,11 +21,11 @@
|
|
21
21
|
<div class="form_sub_row">
|
22
22
|
<% checked = current_user.chat_enabled %>
|
23
23
|
<%= check_box_tag 'enable_chat', true, checked %>
|
24
|
-
<%= label_tag(:enable_chat,
|
24
|
+
<%= label_tag(:enable_chat, t('chat.settings.checkbox')) %>
|
25
25
|
</div>
|
26
26
|
<div class="actions center">
|
27
27
|
<%= hidden_field_tag :settings_section, :chat %>
|
28
|
-
<%= submit_tag
|
28
|
+
<%= submit_tag t('chat.settings.update'), :class => "button" %>
|
29
29
|
</div>
|
30
30
|
</div>
|
31
31
|
</ul>
|
@@ -1,33 +1,33 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
|
-
<title>
|
4
|
+
<title>Social Stream Presence</title>
|
5
5
|
</head>
|
6
6
|
<body>
|
7
7
|
|
8
8
|
|
9
|
-
<p>
|
9
|
+
<p> Social Stream connected users </p>
|
10
10
|
|
11
11
|
<p> </p>
|
12
12
|
<ul>
|
13
|
-
<%@users.each do |user| %>
|
14
|
-
|
15
|
-
<%end%>
|
13
|
+
<%@users.each do |user| %>
|
14
|
+
<li><b><%=user.name%></b></li>
|
15
|
+
<%end%>
|
16
16
|
</ul>
|
17
17
|
<p> </p>
|
18
18
|
|
19
19
|
|
20
|
-
<p>
|
20
|
+
<p> All Social Stream users </p>
|
21
21
|
|
22
22
|
<p> </p>
|
23
23
|
<ul>
|
24
|
-
<%@all_users.each do |user| %>
|
25
|
-
|
26
|
-
<%end%>
|
24
|
+
<%@all_users.each do |user| %>
|
25
|
+
<li><b><%=user.slug%></b> with email: <%=user.email%></li>
|
26
|
+
<%end%>
|
27
27
|
</ul>
|
28
28
|
<p> </p>
|
29
29
|
|
30
|
-
<p> <a href="/test">
|
30
|
+
<p> <a href="/test">Come back</a></p>
|
31
31
|
|
32
32
|
</body>
|
33
33
|
</html>
|
@@ -8,4 +8,9 @@ en:
|
|
8
8
|
choose: "Choose status"
|
9
9
|
available: "Available"
|
10
10
|
away: "Away"
|
11
|
-
dnd: "Busy"
|
11
|
+
dnd: "Busy"
|
12
|
+
offline: "Offline"
|
13
|
+
settings:
|
14
|
+
title: "Enable and configure Social Stream Chat"
|
15
|
+
checkbox: "Enable or disable Social Stream Chat"
|
16
|
+
update: "Update Settings"
|
@@ -8,4 +8,10 @@ es:
|
|
8
8
|
choose: "Establecer estado"
|
9
9
|
available: "Disponible"
|
10
10
|
away: "Ausente"
|
11
|
-
dnd: "No molestar"
|
11
|
+
dnd: "No molestar"
|
12
|
+
offline: "Desconectado"
|
13
|
+
settings:
|
14
|
+
title: "Activación y configuración del chat de Social Stream"
|
15
|
+
checkbox: "Activar o desactivar chat"
|
16
|
+
update: "Guardar configuración"
|
17
|
+
|