social_stream-base 0.9.26 → 0.9.27

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,7 +19,7 @@
19
19
  /****************** WALL - HEADER *********************/
20
20
  #wrapper_activities_header { padding-top: 5px; padding-bottom: 5px; background-color: $secondary-color;}
21
21
  #activities_title { vertical-align: top; margin-left: 10px; font-weight: bold;}
22
- #activities_header { width: 100%; margin-bottom: 5px; text-align: center; padding-top: 5px;}
22
+ #activities_header { width: 100%; margin-bottom: 5px; text-align: center; padding-top: 5px;min-height: 35px;}
23
23
  #activities_header input[type="text"] { color: $main-color; padding: 5px 5px 5px 5px; width:95%;
24
24
  border:1px solid $input-border-color;}
25
25
  #activities_share_btn { text-align: right; padding: 5px 16px 0px 10px; vertical-align: middle;}
@@ -191,19 +191,29 @@ div.chzn-container ul.chzn-choices li.search-field input{ cursor:pointer;}
191
191
  }
192
192
 
193
193
  #activity_form_select {
194
- margin-left: 10px;
194
+ margin-left: 6px;
195
195
  }
196
196
 
197
197
  .activity_form_selector{
198
198
  padding: 5px;
199
+ margin: 1px 2px;
199
200
  margin-bottom: 5px;
200
201
  float: left;
201
- border: 2px solid transparent;
202
+ background: $text-over-main;
203
+ border: 1px solid $separation-color;
202
204
  cursor: pointer;
203
205
  }
204
206
 
205
207
  .activity_form_selector.selected{
206
- border: 2px solid #46B9E8;
208
+ background: $auxiliar-color;
209
+ border: 1px solid $main-color;
210
+ color: $text-over-main;
211
+ font-weight: bold;
212
+ }
213
+
214
+ .activity_form_selector:hover{
215
+ background: $auxiliar-color;
216
+ color: $text-over-main;
207
217
  }
208
218
 
209
219
  .more_pending{
@@ -2,7 +2,7 @@
2
2
 
3
3
  /****************** HEADER STRUCTURE ******/
4
4
  #headerFront { width: 100%; padding: 0; background: $header-color; padding: 2px 0px 0px 0px;}
5
- #header_left { left: 0px; float: left; padding-left: 5px;}
5
+ #header_left { left: 0px; float: left; padding-left: 15px; padding-right: 5px; width:155px;}
6
6
  #header_right { right: 0px; float: right; padding-right: 10px; }
7
7
  .banner_top{ width: 960px; margin-left: auto; margin-right: auto; margin-top: 3px; padding-bottom: 3px;
8
8
  position: relative; }
@@ -4,7 +4,7 @@
4
4
  /********************************* Header **************/
5
5
  #header_search {
6
6
  float: left;
7
- padding: 1px 0 0 10px;
7
+ padding: 1px 0 0 2px;
8
8
  z-index: 2001;
9
9
  }
10
10
  #header_search_input, #global_search_input {
@@ -261,6 +261,15 @@ class Activity < ActiveRecord::Base
261
261
  allow?(subject, 'destroy')
262
262
  end
263
263
 
264
+ # Can subject edit the object of this activity?
265
+ def edit_object_by?(subject)
266
+ subject.present? &&
267
+ direct_object.present? &&
268
+ ! direct_object.is_a?(Actor) &&
269
+ ! direct_object.class.ancestors.include?(SocialStream::Models::Subject) &&
270
+ allow?(subject, 'update')
271
+ end
272
+
264
273
  # The {Relation} with which activity is shared
265
274
  def audience_in_words(subject, options = {})
266
275
  options[:details] ||= :full
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Base
3
- VERSION = "0.9.26".freeze
3
+ VERSION = "0.9.27".freeze
4
4
  end
5
5
  end
@@ -1,96 +1,224 @@
1
- (function($) {
2
- $.fn.tipsy = function(options) {
1
+ // tipsy, facebook style tooltips for jquery
2
+ // version 1.0.0a
3
+ // (c) 2008-2010 jason frame [jason@onehackoranother.com]
4
+ // released under the MIT license
3
5
 
4
- options = $.extend({}, $.fn.tipsy.defaults, options);
5
-
6
- return this.each(function() {
7
-
8
- var opts = $.fn.tipsy.elementOptions(this, options);
9
-
10
- $(this).hover(function() {
6
+ (function($) {
7
+
8
+ function maybeCall(thing, ctx) {
9
+ return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
10
+ };
11
+
12
+ function Tipsy(element, options) {
13
+ this.$element = $(element);
14
+ this.options = options;
15
+ this.enabled = true;
16
+ this.fixTitle();
17
+ };
18
+
19
+ Tipsy.prototype = {
20
+ show: function() {
21
+ var title = this.getTitle();
22
+ if (title && this.enabled) {
23
+ var $tip = this.tip();
24
+
25
+ $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
26
+ $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
27
+ $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
11
28
 
12
- $.data(this, 'cancel.tipsy', true);
13
29
 
14
- var tip = $.data(this, 'active.tipsy');
15
- if (!tip) {
16
- tip = $('<div class="tipsy"><div class="tipsy-inner"/></div>');
17
- tip.css({position: 'absolute', zIndex: 100000});
18
- $.data(this, 'active.tipsy', tip);
30
+ if (this.options.hoverable) {
31
+ $tip.hover(tipOver, tipOut);
19
32
  }
20
33
 
21
- if ($(this).attr('title') || typeof($(this).attr('original-title')) != 'string') {
22
- $(this).attr('original-title', $(this).attr('title') || '').removeAttr('title');
34
+ var that = this;
35
+ function tipOver() {
36
+ that.hoverTooltip = true;
23
37
  }
24
-
25
- var title;
26
- if (typeof opts.title == 'string') {
27
- title = $(this).attr(opts.title == 'title' ? 'original-title' : opts.title);
28
- } else if (typeof opts.title == 'function') {
29
- title = opts.title.call(this);
38
+ function tipOut() {
39
+ if (that.hoverState == 'in') return; // If field is still focused.
40
+ that.hoverTooltip = false;
41
+ if (that.options.trigger != 'manual') {
42
+ var eventOut = that.options.trigger == 'hover' ? 'mouseleave.tipsy' : 'blur.tipsy';
43
+ that.$element.trigger(eventOut);
44
+ }
30
45
  }
31
-
32
- tip.find('.tipsy-inner')[opts.html ? 'html' : 'text'](title || opts.fallback);
33
-
34
- var pos = $.extend({}, $(this).offset(), {width: this.offsetWidth, height: this.offsetHeight});
35
- tip.get(0).className = 'tipsy'; // reset classname in case of dynamic gravity
36
- tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body);
37
- var actualWidth = tip[0].offsetWidth, actualHeight = tip[0].offsetHeight;
38
- var gravity = (typeof opts.gravity == 'function') ? opts.gravity.call(this) : opts.gravity;
39
-
46
+
47
+ var pos = $.extend({}, this.$element.offset(), {
48
+ width: this.$element[0].offsetWidth,
49
+ height: this.$element[0].offsetHeight
50
+ });
51
+
52
+ var actualWidth = $tip[0].offsetWidth,
53
+ actualHeight = $tip[0].offsetHeight,
54
+ gravity = maybeCall(this.options.gravity, this.$element[0]);
55
+
56
+ var tp;
40
57
  switch (gravity.charAt(0)) {
41
58
  case 'n':
42
- tip.css({top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-north');
59
+ tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
43
60
  break;
44
61
  case 's':
45
- tip.css({top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-south');
62
+ tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
46
63
  break;
47
64
  case 'e':
48
- tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}).addClass('tipsy-east');
65
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
49
66
  break;
50
67
  case 'w':
51
- tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}).addClass('tipsy-west');
68
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
52
69
  break;
53
70
  }
54
-
55
- if (opts.fade) {
56
- tip.css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: 0.8});
57
- } else {
58
- tip.css({visibility: 'visible'});
59
- }
60
-
61
- }, function() {
62
- $.data(this, 'cancel.tipsy', false);
63
- var self = this;
64
- setTimeout(function() {
65
- if ($.data(this, 'cancel.tipsy')) return;
66
- var tip = $.data(self, 'active.tipsy');
67
- if (opts.fade) {
68
- tip.stop().fadeOut(function() { $(this).remove(); });
71
+
72
+ if (gravity.length == 2) {
73
+ if (gravity.charAt(1) == 'w') {
74
+ tp.left = pos.left + pos.width / 2 - 15;
69
75
  } else {
70
- tip.remove();
76
+ tp.left = pos.left + pos.width / 2 - actualWidth + 15;
71
77
  }
72
- }, 100);
73
-
74
- });
75
-
76
- });
78
+ }
79
+
80
+ $tip.css(tp).addClass('tipsy-' + gravity);
81
+ $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
82
+ if (this.options.className) {
83
+ $tip.addClass(maybeCall(this.options.className, this.$element[0]));
84
+ }
85
+
86
+ if (this.options.fade) {
87
+ $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
88
+ } else {
89
+ $tip.css({visibility: 'visible', opacity: this.options.opacity});
90
+ }
91
+ }
92
+ },
93
+
94
+ hide: function() {
95
+ if (this.options.fade) {
96
+ this.tip().stop().fadeOut(function() { $(this).remove(); });
97
+ } else {
98
+ this.tip().remove();
99
+ }
100
+ },
101
+
102
+ fixTitle: function() {
103
+ var $e = this.$element;
104
+ if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
105
+ $e.attr('original-title', $e.attr('title') || '').removeAttr('title');
106
+ }
107
+ },
108
+
109
+ getTitle: function() {
110
+ var title, $e = this.$element, o = this.options;
111
+ this.fixTitle();
112
+ var title, o = this.options;
113
+ if (typeof o.title == 'string') {
114
+ title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
115
+ } else if (typeof o.title == 'function') {
116
+ title = o.title.call($e[0]);
117
+ }
118
+ title = ('' + title).replace(/(^\s*|\s*$)/, "");
119
+ return title || o.fallback;
120
+ },
121
+
122
+ tip: function() {
123
+ if (!this.$tip) {
124
+ this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
125
+ }
126
+ return this.$tip;
127
+ },
128
+
129
+ validate: function() {
130
+ if (!this.$element[0].parentNode) {
131
+ this.hide();
132
+ this.$element = null;
133
+ this.options = null;
134
+ }
135
+ },
77
136
 
137
+ enable: function() { this.enabled = true; },
138
+ disable: function() { this.enabled = false; },
139
+ toggleEnabled: function() { this.enabled = !this.enabled; }
78
140
  };
79
141
 
80
- // Overwrite this method to provide options on a per-element basis.
81
- // For example, you could store the gravity in a 'tipsy-gravity' attribute:
82
- // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
83
- // (remember - do not modify 'options' in place!)
84
- $.fn.tipsy.elementOptions = function(ele, options) {
85
- return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
142
+ $.fn.tipsy = function(options) {
143
+
144
+ if (options === true) {
145
+ return this.data('tipsy');
146
+ } else if (typeof options == 'string') {
147
+ var tipsy = this.data('tipsy');
148
+ if (tipsy) tipsy[options]();
149
+ return this;
150
+ }
151
+
152
+ options = $.extend({}, $.fn.tipsy.defaults, options);
153
+ if (options.hoverable) {
154
+ options.delayOut = options.delayOut || 200;
155
+ }
156
+
157
+ function get(ele) {
158
+ var tipsy = $.data(ele, 'tipsy');
159
+ if (!tipsy) {
160
+ tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
161
+ $.data(ele, 'tipsy', tipsy);
162
+ }
163
+ return tipsy;
164
+ }
165
+
166
+ function enter() {
167
+ var tipsy = get(this);
168
+ tipsy.hoverState = 'in';
169
+ if (options.delayIn == 0) {
170
+ tipsy.show();
171
+ } else {
172
+ tipsy.fixTitle();
173
+ setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
174
+ }
175
+ };
176
+
177
+ function leave() {
178
+ var tipsy = get(this);
179
+ tipsy.hoverState = 'out';
180
+ if (options.delayOut == 0) {
181
+ tipsy.hide();
182
+ } else {
183
+ setTimeout(function() { if (tipsy.hoverState == 'out' && !tipsy.hoverTooltip) tipsy.hide(); }, options.delayOut);
184
+ }
185
+ };
186
+
187
+ if (!options.live) this.each(function() { get(this); });
188
+
189
+ if (options.trigger != 'manual') {
190
+ var binder = options.live ? 'live' : 'bind',
191
+ eventIn = options.trigger == 'hover' ? 'mouseenter.tipsy' : 'focus.tipsy',
192
+ eventOut = options.trigger == 'hover' ? 'mouseleave.tipsy' : 'blur.tipsy';
193
+ this[binder](eventIn, enter)[binder](eventOut, leave);
194
+ }
195
+
196
+ return this;
197
+
86
198
  };
87
199
 
88
200
  $.fn.tipsy.defaults = {
201
+ className: null,
202
+ delayIn: 0,
203
+ delayOut: 0,
89
204
  fade: false,
90
205
  fallback: '',
91
206
  gravity: 'n',
92
207
  html: false,
93
- title: 'title'
208
+ live: false,
209
+ hoverable: false,
210
+ offset: 0,
211
+ opacity: 0.8,
212
+ title: 'title',
213
+ trigger: 'hover'
214
+ };
215
+
216
+ // Overwrite this method to provide options on a per-element basis.
217
+ // For example, you could store the gravity in a 'tipsy-gravity' attribute:
218
+ // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
219
+ // (remember - do not modify 'options' in place!)
220
+ $.fn.tipsy.elementOptions = function(ele, options) {
221
+ return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
94
222
  };
95
223
 
96
224
  $.fn.tipsy.autoNS = function() {
@@ -101,4 +229,35 @@
101
229
  return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
102
230
  };
103
231
 
232
+ /**
233
+ * yields a closure of the supplied parameters, producing a function that takes
234
+ * no arguments and is suitable for use as an autogravity function like so:
235
+ *
236
+ * @param margin (int) - distance from the viewable region edge that an
237
+ * element should be before setting its tooltip's gravity to be away
238
+ * from that edge.
239
+ * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
240
+ * if there are no viewable region edges effecting the tooltip's
241
+ * gravity. It will try to vary from this minimally, for example,
242
+ * if 'sw' is preferred and an element is near the right viewable
243
+ * region edge, but not the top edge, it will set the gravity for
244
+ * that element's tooltip to be 'se', preserving the southern
245
+ * component.
246
+ */
247
+ $.fn.tipsy.autoBounds = function(margin, prefer) {
248
+ return function() {
249
+ var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
250
+ boundTop = $(document).scrollTop() + margin,
251
+ boundLeft = $(document).scrollLeft() + margin,
252
+ $this = $(this);
253
+
254
+ if ($this.offset().top < boundTop) dir.ns = 'n';
255
+ if ($this.offset().left < boundLeft) dir.ew = 'w';
256
+ if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
257
+ if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
258
+
259
+ return dir.ns + (dir.ew ? dir.ew : '');
260
+ }
261
+ };
262
+
104
263
  })(jQuery);
@@ -1,7 +1,25 @@
1
- .tipsy { padding: 5px; font-size: 10px; opacity: 0.8; filter: alpha(opacity=80); background-repeat: no-repeat; background-image: url(../images/tipsy.gif); }
2
- .tipsy-inner { padding: 5px 8px 4px 8px; background-color: black; color: white; max-width: 200px; text-align: center; }
3
- .tipsy-inner { -moz-border-radius:3px; -webkit-border-radius:3px; }
4
- .tipsy-north { background-position: top center; }
5
- .tipsy-south { background-position: bottom center; }
6
- .tipsy-east { background-position: right center; }
7
- .tipsy-west { background-position: left center; }
1
+ .tipsy { font-size: 10px; position: absolute; padding: 5px; z-index: 100000; }
2
+ .tipsy-inner { background-color: #000; color: #FFF; max-width: 200px; padding: 5px 8px 4px 8px; text-align: center; }
3
+
4
+ /* Rounded corners */
5
+ .tipsy-inner { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
6
+
7
+ /* Uncomment for shadow */
8
+ /*.tipsy-inner { box-shadow: 0 0 5px #000000; -webkit-box-shadow: 0 0 5px #000000; -moz-box-shadow: 0 0 5px #000000; }*/
9
+
10
+ .tipsy-arrow { position: absolute; width: 0; height: 0; line-height: 0; border: 5px dashed #000; }
11
+
12
+ /* Rules to colour arrows */
13
+ .tipsy-arrow-n { border-bottom-color: #000; }
14
+ .tipsy-arrow-s { border-top-color: #000; }
15
+ .tipsy-arrow-e { border-left-color: #000; }
16
+ .tipsy-arrow-w { border-right-color: #000; }
17
+
18
+ .tipsy-n .tipsy-arrow { top: 0px; left: 50%; margin-left: -5px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent; }
19
+ .tipsy-nw .tipsy-arrow { top: 0; left: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
20
+ .tipsy-ne .tipsy-arrow { top: 0; right: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
21
+ .tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -5px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
22
+ .tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
23
+ .tipsy-se .tipsy-arrow { bottom: 0; right: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
24
+ .tipsy-e .tipsy-arrow { right: 0; top: 50%; margin-top: -5px; border-left-style: solid; border-right: none; border-top-color: transparent; border-bottom-color: transparent; }
25
+ .tipsy-w .tipsy-arrow { left: 0; top: 50%; margin-top: -5px; border-right-style: solid; border-left: none; border-top-color: transparent; border-bottom-color: transparent; }
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: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 26
10
- version: 0.9.26
9
+ - 27
10
+ version: 0.9.27
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-11-04 00:00:00 +01:00
19
+ date: 2011-11-08 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency