social_stream-events 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,7 @@
1
+ //= require jquery.boxy
1
2
  //= require jquery.watermark
3
+ //= require fullcalendar
4
+ //= require scheduler
2
5
  //
3
6
  //= require social_stream-base
4
7
  //
@@ -11,6 +11,10 @@ SocialStream.Event = (function(SS, $, undefined) {
11
11
  $.each(indexCallbacks, function(i, callback){ callback(); });
12
12
  }
13
13
 
14
+ var color = function(){
15
+ SocialStream.Events.current.eventColor;
16
+ }
17
+
14
18
  var fixDates = function(){
15
19
  $(".event").each(function(){
16
20
  dateString = $(this).find("time").attr("datetime");
@@ -44,6 +48,7 @@ SocialStream.Event = (function(SS, $, undefined) {
44
48
 
45
49
  return {
46
50
  addIndexCallback: addIndexCallback,
51
+ color: color,
47
52
  index: index
48
53
  }
49
54
 
@@ -1,8 +1,6 @@
1
1
  class EventsController < ApplicationController
2
2
  include SocialStream::Controllers::Objects
3
3
 
4
- belongs_to_subjects :optional => true
5
-
6
4
  before_filter :profile_subject!, :only => :index
7
5
 
8
6
  def index
@@ -31,7 +29,7 @@ class EventsController < ApplicationController
31
29
 
32
30
  def collection
33
31
  @activities =
34
- profile_subject.wall(:profile,
32
+ (profile_subject || current_subject).wall(:profile,
35
33
  :for => current_subject,
36
34
  :object_type => :Event)
37
35
  end
data/app/models/event.rb CHANGED
@@ -64,7 +64,7 @@ class Event < ActiveRecord::Base
64
64
  def room_belongs_to_receiver
65
65
  return if room_id.blank?
66
66
 
67
- unless _contact.receiver.room_ids.include?(room_id)
67
+ unless owner.room_ids.include?(room_id)
68
68
  errors.add(:room_id, :invalid)
69
69
  end
70
70
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  jQuery.each(<%= raw Array.wrap(@event.to_json).to_json %>,
7
7
  function(index, ev) {
8
- ev.color = SocialStream.Events.tools.eventColor(<%= @event.room_id %>);
8
+ ev.color = SocialStream.Event.color(<%= @event.room_id %>);
9
9
 
10
10
  cal.fullCalendar('renderEvent', ev,
11
11
  true // make the event "stick"
@@ -78,7 +78,7 @@
78
78
  success: function(events) {
79
79
  callback(
80
80
  $.map(events, function(event) {
81
- event.color = SocialStream.Events.tools.eventColor(event.roomId);
81
+ event.color = SocialStream.Event.color(event.roomId);
82
82
  return event;
83
83
  }
84
84
  )
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Events
3
- VERSION = "0.12.0".freeze
3
+ VERSION = "0.12.1".freeze
4
4
  end
5
5
  end
@@ -12,9 +12,8 @@ Gem::Specification.new do |s|
12
12
  s.files = `git ls-files`.split("\n")
13
13
 
14
14
  # Gem dependencies
15
- s.add_runtime_dependency('social_stream-base', '~> 0.20.0')
15
+ s.add_runtime_dependency('social_stream-base', '~> 0.20.1')
16
16
  s.add_runtime_dependency('rails-scheduler', '~> 0.0.8')
17
- s.add_runtime_dependency('coffee-rails', '>= 3.1.0')
18
17
 
19
18
  # Development Gem dependencies
20
19
  s.add_development_dependency('sqlite3-ruby')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_stream-events
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,22 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-04-23 00:00:00.000000000Z
13
+ date: 2012-05-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: social_stream-base
17
- requirement: &89675600 !ruby/object:Gem::Requirement
17
+ requirement: &83962560 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
21
21
  - !ruby/object:Gem::Version
22
- version: 0.20.0
22
+ version: 0.20.1
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *89675600
25
+ version_requirements: *83962560
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rails-scheduler
28
- requirement: &89675350 !ruby/object:Gem::Requirement
28
+ requirement: &83961770 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,21 +33,10 @@ dependencies:
33
33
  version: 0.0.8
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *89675350
37
- - !ruby/object:Gem::Dependency
38
- name: coffee-rails
39
- requirement: &89675120 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ! '>='
43
- - !ruby/object:Gem::Version
44
- version: 3.1.0
45
- type: :runtime
46
- prerelease: false
47
- version_requirements: *89675120
36
+ version_requirements: *83961770
48
37
  - !ruby/object:Gem::Dependency
49
38
  name: sqlite3-ruby
50
- requirement: &89674930 !ruby/object:Gem::Requirement
39
+ requirement: &83961500 !ruby/object:Gem::Requirement
51
40
  none: false
52
41
  requirements:
53
42
  - - ! '>='
@@ -55,7 +44,7 @@ dependencies:
55
44
  version: '0'
56
45
  type: :development
57
46
  prerelease: false
58
- version_requirements: *89674930
47
+ version_requirements: *83961500
59
48
  description: ! 'Social Stream is a Ruby on Rails engine providing your application
60
49
  with social networking features and activity streams.
61
50
 
@@ -77,7 +66,6 @@ files:
77
66
  - app/assets/javascripts/social_stream.event.js
78
67
  - app/assets/javascripts/social_stream.events.action.js
79
68
  - app/assets/javascripts/social_stream.events.poster.js
80
- - app/assets/javascripts/social_stream.events.tools.js.coffee
81
69
  - app/assets/stylesheets/events.css.scss
82
70
  - app/assets/stylesheets/social_stream-events.css
83
71
  - app/controllers/events_controller.rb
@@ -155,10 +143,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
143
  version: '0'
156
144
  requirements: []
157
145
  rubyforge_project:
158
- rubygems_version: 1.8.12
146
+ rubygems_version: 1.8.15
159
147
  signing_key:
160
148
  specification_version: 3
161
149
  summary: Scheduled events support for Social Stream, the core for building social
162
150
  network websites
163
151
  test_files: []
164
- has_rdoc:
@@ -1,50 +0,0 @@
1
- # Place all the behaviors and hooks related to the matching controller here.
2
- # All this logic will automatically be available in application.js.
3
- # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
4
- #
5
- #= require fullcalendar
6
- #= require jquery.boxy
7
- #= require sprintf
8
- #= require scheduler
9
-
10
- SocialStream.Events.tools = {}
11
-
12
- SocialStream.Events.tools.currentRGB = () ->
13
- [ parseInt(SocialStream.Events.current.eventColor[1..2], 16),
14
- parseInt(SocialStream.Events.current.eventColor[3..4], 16),
15
- parseInt(SocialStream.Events.current.eventColor[5..6], 16) ]
16
-
17
- SocialStream.Events.tools.colorRange = () ->
18
- min = 0
19
-
20
- for color in SocialStream.Events.tools.currentRGB()
21
- if color < min
22
- min = color
23
-
24
- parseInt 2 * (255 - min) / 3
25
-
26
- SocialStream.Events.tools.increaseColor = (delta) ->
27
- (if (color + delta) > 255 then 255 else (color + delta)) for color in SocialStream.Events.tools.currentRGB()
28
-
29
-
30
- SocialStream.Events.tools.eventColorScale = (index) ->
31
- range = SocialStream.Events.tools.colorRange()
32
-
33
- delta = range * (index + 1) / (SocialStream.Events.current.roomIndex.length + 1)
34
-
35
- delta = parseInt(delta)
36
-
37
- newColor = SocialStream.Events.tools.increaseColor(delta)
38
-
39
- sprintf "#%02x%02x%02x", newColor[0], newColor[1], newColor[2]
40
-
41
-
42
- SocialStream.Events.tools.eventColor = (roomId) ->
43
- currentColor = SocialStream.Events.current.eventColor
44
-
45
- if not roomId? or not SocialStream.Events.current.roomIndex? or SocialStream.Events.current.roomIndex.length == 0
46
- return currentColor
47
-
48
- currentRoomIndex = SocialStream.Events.current.roomIndex.indexOf(roomId)
49
-
50
- SocialStream.Events.tools.eventColorScale(currentRoomIndex)