social_stream-base 0.9.24 → 0.9.25
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/models/contact.rb
CHANGED
|
@@ -126,7 +126,9 @@ class Contact < ActiveRecord::Base
|
|
|
126
126
|
# We need to update that status here
|
|
127
127
|
def relation_ids=(ids)
|
|
128
128
|
remove_follower(ids)
|
|
129
|
-
|
|
129
|
+
if defined?(SocialStream::Presence) and SocialStream::Presence.enable
|
|
130
|
+
SocialStream::Presence::XmppServerOrder::removeBuddy(self)
|
|
131
|
+
end
|
|
130
132
|
association(:relations).ids_writer(ids)
|
|
131
133
|
end
|
|
132
134
|
|
data/config/routes.rb
CHANGED
|
@@ -23,9 +23,23 @@ Rails.application.routes.draw do
|
|
|
23
23
|
resource :like
|
|
24
24
|
resource :profile
|
|
25
25
|
resources :activities
|
|
26
|
+
|
|
27
|
+
# Nested Social Stream objects configured in config/initializers/social_stream.rb
|
|
28
|
+
#
|
|
29
|
+
# /users/demo/posts
|
|
30
|
+
(SocialStream.objects - [ :actor ]).each do |object|
|
|
31
|
+
resources object.to_s.pluralize
|
|
32
|
+
end
|
|
26
33
|
end
|
|
27
34
|
end
|
|
28
35
|
|
|
36
|
+
# Social Stream objects configured in config/initializers/social_stream.rb
|
|
37
|
+
#
|
|
38
|
+
# /posts
|
|
39
|
+
(SocialStream.objects - [ :actor ]).each do |object|
|
|
40
|
+
resources object.to_s.pluralize
|
|
41
|
+
end
|
|
42
|
+
|
|
29
43
|
resources :contacts do
|
|
30
44
|
collection do
|
|
31
45
|
get 'pending'
|
|
@@ -72,10 +86,6 @@ Rails.application.routes.draw do
|
|
|
72
86
|
|
|
73
87
|
match 'ties' => 'ties#index', :as => :ties
|
|
74
88
|
|
|
75
|
-
# Social Stream objects configured in config/initializers/social_stream.rb
|
|
76
|
-
(SocialStream.objects - [ :actor ]).each do |object|
|
|
77
|
-
resources object.to_s.pluralize
|
|
78
|
-
end
|
|
79
89
|
|
|
80
90
|
##API###
|
|
81
91
|
match 'api/keygen' => 'api#create_key', :as => :api_keygen
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/*
|
|
3
|
+
Screw - A jQuery plugin
|
|
4
|
+
==================================================================
|
|
5
|
+
©2010-2011 JasonLau.biz - Version 1.0.4
|
|
6
|
+
==================================================================
|
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
|
8
|
+
it under the terms of the GNU General Public License as published by
|
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
(at your option) any later version.
|
|
11
|
+
|
|
12
|
+
This program is distributed in the hope that it will be useful,
|
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
GNU General Public License for more details.
|
|
16
|
+
|
|
17
|
+
You should have received a copy of the GNU General Public License
|
|
18
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
(function($){
|
|
23
|
+
$.fn.extend({
|
|
24
|
+
screw: function(options) {
|
|
25
|
+
var defaults = {
|
|
26
|
+
loadingHTML : 'Loading ... '
|
|
27
|
+
}
|
|
28
|
+
var option = $.extend(defaults, options);
|
|
29
|
+
var obj = $(this);
|
|
30
|
+
|
|
31
|
+
return this.each(function() {
|
|
32
|
+
$(window).scroll(function() {
|
|
33
|
+
screwIt($(this));
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
var screwIt = function(it){
|
|
37
|
+
var h = $(window).height(), w = $(window).width(), st = it.scrollTop(), t = h+st;
|
|
38
|
+
$(".screw-image").each(function(){
|
|
39
|
+
var pos = $(this).offset(), rand = Math.round(Math.random()*1000);
|
|
40
|
+
if(t >= pos.top && pos.left <= w){
|
|
41
|
+
if(!$(this).hasClass('screw-loaded') && !$(this).hasClass('screw-loading')){
|
|
42
|
+
|
|
43
|
+
$(this).addClass('screw-loading').html('<div id="screw-loading-' + rand + '">' + option.loadingHTML + '</div>');
|
|
44
|
+
// Stop cache
|
|
45
|
+
var url = $(this).attr('rel'), patt = /&/g;
|
|
46
|
+
if(patt.test(url)){
|
|
47
|
+
url += '&screw_rand=' + rand;
|
|
48
|
+
} else {
|
|
49
|
+
url += '?screw_rand=' + rand;
|
|
50
|
+
}
|
|
51
|
+
// Preload image
|
|
52
|
+
objImage = new Image();
|
|
53
|
+
objImage.src = url;
|
|
54
|
+
var o = $(this);
|
|
55
|
+
objImage.onload = function(){
|
|
56
|
+
o.append('<img style="display:none" id="screw-content-' + rand + '" class="screw-content" src="' + url + '" />');
|
|
57
|
+
$('#screw-loading-' + rand).fadeOut('slow', function(){
|
|
58
|
+
$('#screw-content-' + rand).fadeIn('slow');
|
|
59
|
+
o.removeClass('screw-loading').addClass('screw-loaded');
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
$(".screw").each(function(){
|
|
67
|
+
var pos = $(this).offset(), o = $(this), rand = Math.round(Math.random()*1000), data_type = 'html';
|
|
68
|
+
if(t >= pos.top && pos.left <= w){
|
|
69
|
+
if($(this).hasClass('screw-xml')){
|
|
70
|
+
data_type = 'xml';
|
|
71
|
+
} else if($(this).hasClass('screw-json')){
|
|
72
|
+
data_type = 'json';
|
|
73
|
+
} else if($(this).hasClass('screw-script')){
|
|
74
|
+
data_type = 'script';
|
|
75
|
+
}
|
|
76
|
+
if((!$(this).hasClass('screw-loaded') || $(this).hasClass('screw-repeat') && !$(this).hasClass('screw-loading'))){
|
|
77
|
+
o.addClass('screw-loading');
|
|
78
|
+
if(option.loadingHTML){
|
|
79
|
+
o.html('<div id="screw-loading-' + rand + '">' + option.loadingHTML + '</div>');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if(o.hasClass('screw-replace')){
|
|
83
|
+
if($(this).attr('rel')){
|
|
84
|
+
$.get($(this).attr('rel'), { screwrand : Math.round(Math.random()*1000) }, function(data) {
|
|
85
|
+
o.replaceWith(data);
|
|
86
|
+
}, data_type);
|
|
87
|
+
} else if($(this).attr('rev')){
|
|
88
|
+
o.replaceWith($(this).attr('rev'));
|
|
89
|
+
}
|
|
90
|
+
} else if(o.hasClass('screw-append')){
|
|
91
|
+
if($(this).attr('rel')){
|
|
92
|
+
$.get($(this).attr('rel'), { screwrand : Math.round(Math.random()*1000) }, function(data) {
|
|
93
|
+
o.append('<div style="display:none" id="screw-content-' + rand + '" class="screw-content">' + data + '</div>');
|
|
94
|
+
showContent(rand);
|
|
95
|
+
}, data_type);
|
|
96
|
+
} else if($(this).attr('rev')){
|
|
97
|
+
o.append('<div style="display:none" id="screw-content-' + rand + '" class="screw-content">' + $(this).attr('rev') + '</div>');
|
|
98
|
+
showContent(rand);
|
|
99
|
+
}
|
|
100
|
+
} else if(o.hasClass('screw-prepend')){
|
|
101
|
+
if($(this).attr('rel')){
|
|
102
|
+
$.get($(this).attr('rel'), { screwrand : Math.round(Math.random()*1000) }, function(data) {
|
|
103
|
+
o.prepend('<div style="display:none" id="screw-content-' + rand + '" class="screw-content">' + data + '</div>');
|
|
104
|
+
showContent(rand);
|
|
105
|
+
}, data_type);
|
|
106
|
+
} else if($(this).attr('rev')){
|
|
107
|
+
o.prepend('<div style="display:none" id="screw-content-' + rand + '" class="screw-content">' + $(this).attr('rev') + '</div>');
|
|
108
|
+
showContent(rand);
|
|
109
|
+
}
|
|
110
|
+
} else if(o.hasClass('screw-before')){
|
|
111
|
+
if($(this).attr('rel')){
|
|
112
|
+
$.get($(this).attr('rel'), { screwrand : Math.round(Math.random()*1000) }, function(data) {
|
|
113
|
+
o.before('<div style="display:none" id="screw-content-' + rand + '" class="screw-content">' + data + '</div>');
|
|
114
|
+
showContent(rand);
|
|
115
|
+
}, data_type);
|
|
116
|
+
} else if($(this).attr('rev')){
|
|
117
|
+
o.before('<div style="display:none" id="screw-content-' + rand + '" class="screw-content">' + $(this).attr('rev') + '</div>');
|
|
118
|
+
showContent(rand);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if(o.hasClass('screw-repeat') && pos.top < $(window).height() && pos.left < $(window).width()){
|
|
122
|
+
if($(this).attr('rel')){
|
|
123
|
+
$.get($(this).attr('rel'), { screwrand : Math.round(Math.random()*1000) }, function(data) {
|
|
124
|
+
o.before('<div style="display:none" id="screw-content-' + rand + '" class="screw-content">' + data + '</div>');
|
|
125
|
+
showContent(rand);
|
|
126
|
+
}, data_type);
|
|
127
|
+
} else if($(this).attr('rev')){
|
|
128
|
+
o.before('<div style="display:none" id="screw-content-' + rand + '" class="screw-content">' + $(this).attr('rev') + '</div>');
|
|
129
|
+
showContent(rand);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
} else if(o.hasClass('screw-after')){
|
|
134
|
+
if($(this).attr('rel')){
|
|
135
|
+
$.get($(this).attr('rel'), { screwrand : Math.round(Math.random()*1000) }, function(data) {
|
|
136
|
+
o.after('<div style="display:none" id="screw-content-' + rand + '" class="screw-content">' + data + '</div>');
|
|
137
|
+
showContent(rand);
|
|
138
|
+
}, data_type);
|
|
139
|
+
} else if($(this).attr('rev')){
|
|
140
|
+
o.after('<div style="display:none" id="screw-content-' + rand + '" class="screw-content">' + $(this).attr('rev') + '</div>');
|
|
141
|
+
showContent(rand);
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
if($(this).attr('rel')){
|
|
145
|
+
$.get($(this).attr('rel'), { screwrand : Math.round(Math.random()*1000) }, function(data) {
|
|
146
|
+
o.append('<div style="display:none" id="screw-content-' + rand + '" class="screw-content">' + data + '</div>');
|
|
147
|
+
showContent(rand);
|
|
148
|
+
}, data_type);
|
|
149
|
+
} else if($(this).attr('rev')){
|
|
150
|
+
o.append('<div style="display:none" id="screw-content-' + rand + '" class="screw-content">' + $(this).attr('rev') + '</div>');
|
|
151
|
+
showContent(rand);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
o.removeClass('screw-loading').addClass('screw-loaded');
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
$(".screw-remove").each(function(){
|
|
160
|
+
if($(this).hasClass('screw-loaded')){
|
|
161
|
+
var p = $(this).position();
|
|
162
|
+
if(p.top < st || p.left > w){
|
|
163
|
+
if($(this).is(':visible')){
|
|
164
|
+
$(this).fadeOut('slow');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
var showContent = function(rand){
|
|
173
|
+
if(option.loadingHTML){
|
|
174
|
+
$('#screw-loading-' + rand).fadeOut('slow', function(){
|
|
175
|
+
$('#screw-content-' + rand).fadeIn('slow');
|
|
176
|
+
});
|
|
177
|
+
} else {
|
|
178
|
+
$('#screw-content-' + rand).fadeIn('slow');
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
screwIt($(window));
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
})(jQuery);
|
|
188
|
+
-->
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: social_stream-base
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 9
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 9
|
|
9
|
-
-
|
|
10
|
-
version: 0.9.
|
|
9
|
+
- 25
|
|
10
|
+
version: 0.9.25
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- GING - DIT - UPM
|
|
@@ -16,7 +16,7 @@ autorequire:
|
|
|
16
16
|
bindir: bin
|
|
17
17
|
cert_chain: []
|
|
18
18
|
|
|
19
|
-
date: 2011-
|
|
19
|
+
date: 2011-11-04 00:00:00 +01:00
|
|
20
20
|
default_executable:
|
|
21
21
|
dependencies:
|
|
22
22
|
- !ruby/object:Gem::Dependency
|
|
@@ -1063,6 +1063,7 @@ files:
|
|
|
1063
1063
|
- vendor/assets/javascripts/jquery.fcbkcomplete.js
|
|
1064
1064
|
- vendor/assets/javascripts/jquery.lightbox-with-resize-plugin.js
|
|
1065
1065
|
- vendor/assets/javascripts/jquery.livequery.js
|
|
1066
|
+
- vendor/assets/javascripts/jquery.screw.js
|
|
1066
1067
|
- vendor/assets/javascripts/jquery.scrollTo.min.js
|
|
1067
1068
|
- vendor/assets/javascripts/jquery.tipsy.js
|
|
1068
1069
|
- vendor/assets/javascripts/jquery.validate.js
|